BackstageClient.inventory
BackstageClient.inventory in @ticketlayer/backstage.
@ticketlayer/backstage / BackstageClient / inventory
inventory: {
create: (request: {
accountId: string;
eventId?: string;
eventLayoutAreaId?: string;
eventOccurrenceId?: string;
isAllocated?: boolean;
metadata?: Record<string, any>;
productId?: string;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>;
delete: (id: string, options?: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<string>;
get: (id: string, options?: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>;
getAuditLog: (id: string, options?: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<{
action: string;
actorId: string | null;
actorType: string | null;
changes: {
[key: string]: unknown;
};
createdAt: string;
id: number;
inventoryId: string;
referenceId: string | null;
referenceType: string | null;
}[]>;
list: (options?: {
eventId?: string;
eventOccurrenceId?: string;
isAllocated?: "true" | "false";
productId?: string;
sourceType?: "product" | "event_occurrence_area";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}[]>;
updateCapacity: (id: string, request: {
accountId: string;
totalCapacity: number;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>;
};Defined in: client.ts:4124
Inventory methods
create()#
create: (request: {
accountId: string;
eventId?: string;
eventLayoutAreaId?: string;
eventOccurrenceId?: string;
isAllocated?: boolean;
metadata?: Record<string, any>;
productId?: string;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>;Create inventory Create a new inventory bucket for tracking capacity
Parameters#
| Parameter | Type |
|---|---|
request | { accountId: string; eventId?: string; eventLayoutAreaId?: string; eventOccurrenceId?: string; isAllocated?: boolean; metadata?: Record<string, any>; productId?: string; sourceType: "product" | "event_occurrence_area"; totalCapacity: number; } |
request.accountId | string |
request.eventId? | string |
request.eventLayoutAreaId? | string |
request.eventOccurrenceId? | string |
request.isAllocated? | boolean |
request.metadata? | Record<string, any> |
request.productId? | string |
request.sourceType? | "product" | "event_occurrence_area" |
request.totalCapacity? | number |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>
Operation Id#
createInventory
delete()#
delete: (id: string, options?: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<string>;Delete inventory Delete an inventory bucket (only if no confirmed reservations)
Parameters#
| Parameter | Type |
|---|---|
id | string |
options? | { accountId: string; } |
options.accountId? | string |
requestOptions? | RequestOptions |
Returns#
Promise<string>
Operation Id#
deleteInventory
get()#
get: (id: string, options?: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>;Get inventory Get a specific inventory bucket by ID
Parameters#
| Parameter | Type |
|---|---|
id | string |
options? | { accountId: string; } |
options.accountId? | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>
Operation Id#
getInventory
getAuditLog()#
getAuditLog: (id: string, options?: {
accountId: string;
}, requestOptions?: RequestOptions) => Promise<{
action: string;
actorId: string | null;
actorType: string | null;
changes: {
[key: string]: unknown;
};
createdAt: string;
id: number;
inventoryId: string;
referenceId: string | null;
referenceType: string | null;
}[]>;Get inventory audit log Get the audit log for an inventory bucket
Parameters#
| Parameter | Type |
|---|---|
id | string |
options? | { accountId: string; } |
options.accountId? | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
action: string;
actorId: string | null;
actorType: string | null;
changes: {
[key: string]: unknown;
};
createdAt: string;
id: number;
inventoryId: string;
referenceId: string | null;
referenceType: string | null;
}[]>
Operation Id#
getInventoryAuditLog
list()#
list: (options?: {
eventId?: string;
eventOccurrenceId?: string;
isAllocated?: "true" | "false";
productId?: string;
sourceType?: "product" | "event_occurrence_area";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}[]>;List inventory List all inventory buckets for the organisation with optional filtering
Parameters#
| Parameter | Type |
|---|---|
options? | { eventId?: string; eventOccurrenceId?: string; isAllocated?: "true" | "false"; productId?: string; sourceType?: "product" | "event_occurrence_area"; } |
options.eventId? | string |
options.eventOccurrenceId? | string |
options.isAllocated? | "true" | "false" |
options.productId? | string |
options.sourceType? | "product" | "event_occurrence_area" |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}[]>
Operation Id#
listInventory
updateCapacity()#
updateCapacity: (id: string, request: {
accountId: string;
totalCapacity: number;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>;Update inventory capacity Update the total capacity of an inventory bucket
Parameters#
| Parameter | Type |
|---|---|
id | string |
request | { accountId: string; totalCapacity: number; } |
request.accountId | string |
request.totalCapacity? | number |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
available: number;
confirmed: number;
createdAt: string;
eventId: string | null;
eventLayoutAreaId: string | null;
eventOccurrenceId: string | null;
held: number;
id: string;
isAllocated: boolean;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
productId: string | null;
reserved: number;
sourceType: "product" | "event_occurrence_area";
totalCapacity: number;
updatedAt: string;
version: number;
}>
Operation Id#
updateInventoryCapacity