BackstageClient.inventoryReservations
BackstageClient.inventoryReservations in @ticketlayer/backstage.
@ticketlayer/backstage / BackstageClient / inventoryReservations
inventoryReservations: {
checkAvailability: (request: {
requests: {
inventoryId: string;
quantity?: number;
seatIds?: string[];
}[];
}, requestOptions?: RequestOptions) => Promise<{
available: boolean;
availableQuantity: number;
requestedQuantity: number;
}>;
confirmReservation: (id: string, request: {
accountId: string;
referenceId?: string;
referenceType?: "subscription" | "order" | "hold";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>;
extendReservation: (id: string, request: {
expiresAt: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>;
getReservation: (id: string, options?: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>;
listReservations: (options?: {
accountId?: string;
inventoryId?: string;
referenceId?: string;
referenceType?: "subscription" | "order" | "hold";
type?: "confirmed" | "maintenance" | "hold" | "temporary";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}[]>;
releaseReservation: (id: string, request: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<string>;
reserve: (request: {
accountId: string;
inventoryId: string;
quantity?: number;
referenceId: string;
referenceType: "subscription" | "order" | "hold";
seatIds?: string[];
ttlSeconds?: number;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>;
};Defined in: client.ts:4281
Inventory Reservations methods
checkAvailability()#
checkAvailability: (request: {
requests: {
inventoryId: string;
quantity?: number;
seatIds?: string[];
}[];
}, requestOptions?: RequestOptions) => Promise<{
available: boolean;
availableQuantity: number;
requestedQuantity: number;
}>;Check availability Check if requested quantity is available in inventory. Requires inventory.read; only inventory on the accounts it is held on is looked up, and any other id answers as not found.
Parameters#
| Parameter | Type |
|---|---|
request | { requests: { inventoryId: string; quantity?: number; seatIds?: string[]; }[]; } |
request.requests | { inventoryId: string; quantity?: number; seatIds?: string[]; }[] |
requestOptions? | RequestOptions |
Returns#
Promise<{
available: boolean;
availableQuantity: number;
requestedQuantity: number;
}>
Operation Id#
checkAvailability
confirmReservation()#
confirmReservation: (id: string, request: {
accountId: string;
referenceId?: string;
referenceType?: "subscription" | "order" | "hold";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>;Confirm reservation Confirm a temporary reservation (converts reserved to confirmed)
Parameters#
| Parameter | Type |
|---|---|
id | string |
request | { accountId: string; referenceId?: string; referenceType?: "subscription" | "order" | "hold"; } |
request.accountId | string |
request.referenceId? | string |
request.referenceType? | "subscription" | "order" | "hold" |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>
Operation Id#
confirmReservation
extendReservation()#
extendReservation: (id: string, request: {
expiresAt: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>;Extend reservation Extend the expiry time of a temporary reservation
Parameters#
| Parameter | Type |
|---|---|
id | string |
request | { expiresAt: string; } |
request.expiresAt | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>
Operation Id#
extendReservation
getReservation()#
getReservation: (id: string, options?: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>;Get reservation Get a specific reservation by ID
Parameters#
| Parameter | Type |
|---|---|
id | string |
options? | { accountId: string; } |
options.accountId? | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>
Operation Id#
getReservation
listReservations()#
listReservations: (options?: {
accountId?: string;
inventoryId?: string;
referenceId?: string;
referenceType?: "subscription" | "order" | "hold";
type?: "confirmed" | "maintenance" | "hold" | "temporary";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}[]>;List reservations List all reservations with optional filtering
Parameters#
| Parameter | Type |
|---|---|
options? | { accountId?: string; inventoryId?: string; referenceId?: string; referenceType?: "subscription" | "order" | "hold"; type?: "confirmed" | "maintenance" | "hold" | "temporary"; } |
options.accountId? | string |
options.inventoryId? | string |
options.referenceId? | string |
options.referenceType? | "subscription" | "order" | "hold" |
options.type? | "confirmed" | "maintenance" | "hold" | "temporary" |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}[]>
Operation Id#
listReservations
releaseReservation()#
releaseReservation: (id: string, request: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<string>;Release reservation Release a reservation and return inventory to available
Parameters#
| Parameter | Type |
|---|---|
id | string |
request | { accountId: string; } |
request.accountId | string |
requestOptions? | RequestOptions |
Returns#
Promise<string>
Operation Id#
releaseReservation
reserve()#
reserve: (request: {
accountId: string;
inventoryId: string;
quantity?: number;
referenceId: string;
referenceType: "subscription" | "order" | "hold";
seatIds?: string[];
ttlSeconds?: number;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>;Reserve inventory Create a temporary reservation for GA or allocated seats
Parameters#
| Parameter | Type |
|---|---|
request | { accountId: string; inventoryId: string; quantity?: number; referenceId: string; referenceType: "subscription" | "order" | "hold"; seatIds?: string[]; ttlSeconds?: number; } |
request.accountId | string |
request.inventoryId? | string |
request.quantity? | number |
request.referenceId? | string |
request.referenceType? | "subscription" | "order" | "hold" |
request.seatIds? | string[] |
request.ttlSeconds? | number |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
expiresAt: string | null;
heldBy: string | null;
id: string;
inventoryId: string;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
quantity: number;
reason: string | null;
referenceId: string | null;
referenceType: "subscription" | "order" | "hold" | null;
seatIds: string[] | null;
type: "confirmed" | "maintenance" | "hold" | "temporary";
updatedAt: string;
}>
Operation Id#
reserveInventory