Skip to content
Docs
Reference

BackstageClient.inventoryReservations

BackstageClient.inventoryReservations in @ticketlayer/backstage.

@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#

ParameterType
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#

ParameterType
idstring
request{ accountId: string; referenceId?: string; referenceType?: "subscription" | "order" | "hold"; }
request.accountIdstring
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#

ParameterType
idstring
request{ expiresAt: string; }
request.expiresAtstring
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#

ParameterType
idstring
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#

ParameterType
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#

ParameterType
idstring
request{ accountId: string; }
request.accountIdstring
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#

ParameterType
request{ accountId: string; inventoryId: string; quantity?: number; referenceId: string; referenceType: "subscription" | "order" | "hold"; seatIds?: string[]; ttlSeconds?: number; }
request.accountIdstring
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