BackstageClient
@ticketlayer/backstage / BackstageClient
Class: BackstageClient
Defined in: client.ts:385
Constructors
Constructor
new BackstageClient(config: BackstageClientConfig): BackstageClient;
Defined in: client.ts:398
Parameters
| Parameter | Type |
|---|---|
config | BackstageClientConfig |
Returns
BackstageClient
Methods
clearAccessToken()
clearAccessToken(): void;
Defined in: client.ts:453
Clear the access token
Returns
void
getAccessToken()
getAccessToken(): string | undefined;
Defined in: client.ts:460
Get the current access token
Returns
string | undefined
getRefreshToken()
getRefreshToken(): string | undefined;
Defined in: client.ts:474
Get the current refresh token
Returns
string | undefined
setAccessToken()
setAccessToken(token: string): void;
Defined in: client.ts:446
Set the access token for authenticated requests
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
void
setRefreshToken()
setRefreshToken(token: string): void;
Defined in: client.ts:467
Set the refresh token
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
void
Properties
accounts
accounts: {
create: (request: {
name: string;
status?: "active" | "inactive";
}) => Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>;
delete: (id: string) => Promise<{
id: string;
success: boolean;
}>;
get: (id: string) => Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>;
list: (options?: {
search?: string;
status?: "active" | "inactive";
}) => Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}[]>;
update: (id: string, request: {
name?: string;
status?: "active" | "inactive";
}) => Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>;
};
Defined in: client.ts:948
Accounts methods
create()
create: (request: {
name: string;
status?: "active" | "inactive";
}) => Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>;
Create account Create a new account in the organisation
Parameters
| Parameter | Type |
|---|---|
request | { name: string; status?: "active" | "inactive"; } |
request.name | string |
request.status? | "active" | "inactive" |
Returns
Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>
Operation Id
createAccount
delete()
delete: (id: string) => Promise<{
id: string;
success: boolean;
}>;
Delete account Delete an account (soft delete)
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
id: string;
success: boolean;
}>
Operation Id
deleteAccount
get()
get: (id: string) => Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>;
Get account Get a specific account by ID
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>
Operation Id
getAccount
list()
list: (options?: {
search?: string;
status?: "active" | "inactive";
}) => Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}[]>;
List accounts List all accounts for the organisation with optional filtering
Parameters
| Parameter | Type |
|---|---|
options? | { search?: string; status?: "active" | "inactive"; } |
options.search? | string |
options.status? | "active" | "inactive" |
Returns
Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}[]>
Operation Id
listAccounts
update()
update: (id: string, request: {
name?: string;
status?: "active" | "inactive";
}) => Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>;
Update account Update an existing account
Parameters
| Parameter | Type |
|---|---|
id | string |
request | { name?: string; status?: "active" | "inactive"; } |
request.name? | string |
request.status? | "active" | "inactive" |
Returns
Promise<{
createdAt: string;
id: string;
isDeleted: boolean;
name: string;
organisationId: string;
status: "active" | "inactive";
updatedAt: string;
}>
Operation Id
updateAccount
apiKeys
apiKeys: {
create: (request: {
accountId?: string;
expiresAt?: any;
name: string;
scopes: string[];
}) => Promise<{
apiKey: {
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
};
key: string;
}>;
list: () => Promise<{
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
}[]>;
revoke: (id: string) => Promise<{
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
}>;
};
Defined in: client.ts:1329
API Keys methods
create()
create: (request: {
accountId?: string;
expiresAt?: any;
name: string;
scopes: string[];
}) => Promise<{
apiKey: {
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
};
key: string;
}>;
Create an organisation API key Creates a long-lived key a partner server uses to call this API and to mint embed sessions. The key material is in this response once. Users only (requires apikeys.create).
Parameters
| Parameter | Type |
|---|---|
request | { accountId?: string; expiresAt?: any; name: string; scopes: string[]; } |
request.accountId? | string |
request.expiresAt? | any |
request.name | string |
request.scopes | string[] |
Returns
Promise<{
apiKey: {
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
};
key: string;
}>
Operation Id
createApiKey
list()
list: () => Promise<{
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
}[]>;
List organisation API keys Lists every key of the organisation, revoked ones included. Key material is never returned. Users only (requires apikeys.read).
Returns
Promise<{
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
}[]>
Operation Id
listApiKeys
revoke()
revoke: (id: string) => Promise<{
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
}>;
Revoke an organisation API key Revokes the key immediately; embed sessions it already minted run to their expiry. Users only (requires apikeys.revoke).
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
accountId: string | null;
createdAt: string;
createdBy: string | null;
expiresAt: string | null;
id: string;
keyPrefix: string;
lastUsedAt: string | null;
name: string;
organisationId: string;
revokedAt: string | null;
scopes: string[];
}>
Operation Id
revokeApiKey
assets()
assets: (assetId: string) => {
assets: {
delete: (id: string) => Promise<boolean>;
get: (id: string) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>;
list: (options?: {
accountId?: string;
ownerId?: string;
ownerType?: string;
purpose?: string;
q?: string;
}) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}[]>;
upload: (request: {
accountId?: string;
cdn?: any;
name?: string;
ownerId?: string;
ownerType?: string;
purpose?: | "event_image"
| "organisation_logo"
| "account_logo"
| "user_avatar"
| "ticket_template_asset"
| "rendered_pass"
| "rendered_receipt"
| "export"
| "other";
visibility?: "public" | "private";
}) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>;
};
};
Defined in: client.ts:4355
assets methods Use assets() to access nested resources: assets(id).assets
Parameters
| Parameter | Type |
|---|---|
assetId | string |
Returns
{
assets: {
delete: (id: string) => Promise<boolean>;
get: (id: string) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>;
list: (options?: {
accountId?: string;
ownerId?: string;
ownerType?: string;
purpose?: string;
q?: string;
}) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}[]>;
upload: (request: {
accountId?: string;
cdn?: any;
name?: string;
ownerId?: string;
ownerType?: string;
purpose?: | "event_image"
| "organisation_logo"
| "account_logo"
| "user_avatar"
| "ticket_template_asset"
| "rendered_pass"
| "rendered_receipt"
| "export"
| "other";
visibility?: "public" | "private";
}) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>;
};
}
assets
assets: {
delete: (id: string) => Promise<boolean>;
get: (id: string) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>;
list: (options?: {
accountId?: string;
ownerId?: string;
ownerType?: string;
purpose?: string;
q?: string;
}) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}[]>;
upload: (request: {
accountId?: string;
cdn?: any;
name?: string;
ownerId?: string;
ownerType?: string;
purpose?: | "event_image"
| "organisation_logo"
| "account_logo"
| "user_avatar"
| "ticket_template_asset"
| "rendered_pass"
| "rendered_receipt"
| "export"
| "other";
visibility?: "public" | "private";
}) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>;
};
assets.delete()
delete: (id: string) => Promise<boolean>;
Delete an asset Soft-delete a tracked asset (bytes are left in storage for later GC).
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<boolean>
Operation Id
deleteAsset
assets.get()
get: (id: string) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>;
Get an asset Get a tracked asset by id.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>
Operation Id
getAsset
assets.list()
list: (options?: {
accountId?: string;
ownerId?: string;
ownerType?: string;
purpose?: string;
q?: string;
}) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}[]>;
List assets List the organisation's tracked assets (uploads + renders). Filter by purpose/owner.
Parameters
| Parameter | Type |
|---|---|
options? | { accountId?: string; ownerId?: string; ownerType?: string; purpose?: string; q?: string; } |
options.accountId? | string |
options.ownerId? | string |
options.ownerType? | string |
options.purpose? | string |
options.q? | string |
Returns
Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}[]>
Operation Id
listAssets
assets.upload()
upload: (request: {
accountId?: string;
cdn?: any;
name?: string;
ownerId?: string;
ownerType?: string;
purpose?: | "event_image"
| "organisation_logo"
| "account_logo"
| "user_avatar"
| "ticket_template_asset"
| "rendered_pass"
| "rendered_receipt"
| "export"
| "other";
visibility?: "public" | "private";
}) => Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>;
Upload an asset Upload a file (multipart/form-data; field "file") to central storage and track it. Metadata fields (purpose, ownerType, ownerId, accountId, visibility, cdn) accompany the file.
Parameters
| Parameter | Type |
|---|---|
request | { accountId?: string; cdn?: any; name?: string; ownerId?: string; ownerType?: string; purpose?: | "event_image" | "organisation_logo" | "account_logo" | "user_avatar" | "ticket_template_asset" | "rendered_pass" | "rendered_receipt" | "export" | "other"; visibility?: "public" | "private"; } |
request.accountId? | string |
request.cdn? | any |
request.name? | string |
request.ownerId? | string |
request.ownerType? | string |
request.purpose? | | "event_image" | "organisation_logo" | "account_logo" | "user_avatar" | "ticket_template_asset" | "rendered_pass" | "rendered_receipt" | "export" | "other" |
request.visibility? | "public" | "private" |
Returns
Promise<{
accountId: string | null;
cdn: boolean;
cdnUrl: string | null;
contentType: string;
createdAt: string;
filename: string | null;
id: string;
metadata: {
[key: string]: unknown;
};
name: string | null;
organisationId: string;
ownerId: string | null;
ownerType: string | null;
purpose: string;
sizeBytes: number;
storageBucket: string | null;
storageDriver: string;
storageKey: string;
updatedAt: string;
uploadedBy: string | null;
url: string;
visibility: string;
}>
Operation Id
uploadAsset
authentication
authentication: {
federate: (request: {
token: string;
}) => Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>;
login: (request: {
email: string;
password: string;
}) => Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>;
redeem: (request: {
code: string;
password: string;
}) => Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>;
refresh: (request: {
refreshToken: string;
}) => Promise<{
accessToken: string;
refreshToken: string;
}>;
};
Defined in: client.ts:776
Authentication methods
federate()
federate: (request: {
token: string;
}) => Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>;
Federate user to organisation Exchange a Stagedoor JWT token for API access and refresh tokens
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { token: string; } | - |
request.token | string | Description Stagedoor JWT token to federate Example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
Returns
Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>
Operation Id
federate
login()
login: (request: {
email: string;
password: string;
}) => Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>;
User login Authenticate a user with email and password, returns access and refresh tokens
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { email: string; password: string; } | - |
request.email | string | Format: email Description User email address Example user@example.com |
request.password | string | Description User password Example password123 |
Returns
Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>
Operation Id
login
redeem()
redeem: (request: {
code: string;
password: string;
}) => Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>;
Redeem invitation Redeem an invitation code and set up a new user account
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { code: string; password: string; } | - |
request.code | string | Description Invitation code received via email Example INV-1234567890 |
request.password | string | Description New password for the account (minimum 8 characters) Example securePassword123 |
Returns
Promise<{
accessToken: string;
refreshToken: string;
user: {
email: string;
firstName?: string;
id: string;
lastName?: string;
};
}>
Operation Id
redeem
refresh()
refresh: (request: {
refreshToken: string;
}) => Promise<{
accessToken: string;
refreshToken: string;
}>;
Refresh access token Exchange a refresh token for a new access token and refresh token
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { refreshToken: string; } | - |
request.refreshToken | string | Description Refresh token from previous login Example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
Returns
Promise<{
accessToken: string;
refreshToken: string;
}>
Operation Id
refresh
billing
billing: {
cancelSubscription: (subscriptionId: string) => Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}>;
canSell: (organisationId: string) => Promise<{
canSell: boolean;
currentBalance: number;
reason: string | null;
}>;
createAiTopup: (request: {
aiPackageId: string;
billingAddress?: {
city: string;
country: string;
line1: string;
line2?: string;
name?: string;
postal_code: string;
state?: string;
};
currency?: string;
email?: string;
paymentMethodId: string;
}) => Promise<{
creditsAdded: number;
invoice: {
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
};
newBalance: number;
payment: {
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
};
}>;
createPurchase: (request: {
billingAddress?: {
city: string;
country: string;
line1: string;
line2?: string;
name?: string;
postal_code: string;
state?: string;
};
currency?: string;
email?: string;
packageId: string;
paymentMethodId: string;
}) => Promise<{
invoice: {
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
};
newBalance: number;
payment: {
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
};
success: boolean;
transaction: {
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
};
}>;
createSetupIntent: () => Promise<string>;
createSubscription: (request: {
currency?: string;
email?: string;
interval: "month" | "year";
packageId: string;
paymentMethodId: string;
}) => Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}>;
deletePaymentMethod: (paymentMethodId: string) => Promise<boolean>;
getAiBalance: () => Promise<{
balance: number;
isDepleted: boolean;
isLow: boolean;
lifetimeCredits: number;
lifetimeUsed: number;
}>;
getAutoTopup: () => Promise<
| {
attemptsToday: number;
createdAt: string;
enabled: boolean;
id: string;
lastAttemptAt: string | null;
maxAttemptsPerDay: number;
organisationId: string;
thresholdCredits: number;
topupPackageId: string;
updatedAt: string;
}
| null>;
getBalance: () => Promise<{
balance: number;
createdAt: string;
id: string;
isSuspended: boolean;
lifetimeCredits: number;
lifetimeUsed: number;
organisationId: string;
status: "healthy" | "low" | "depleted" | "negative" | "suspended";
suspendedAt: string | null;
suspendedReason: string | null;
updatedAt: string;
}>;
getInvoice: (invoiceId: string) => Promise<{
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
}>;
listAiPackages: () => Promise<{
baseCurrency: string;
basePrice: number;
credits: number;
discountPercent: number;
displayOrder: number;
finalPrice: number;
id: string;
isActive: boolean;
name: string;
}[]>;
listAiTransactions: (options?: {
limit?: string;
page?: string;
}) => Promise<{
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
}[]>;
listInvoices: (options?: {
limit?: string;
page?: string;
status?: string;
}) => Promise<{
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
}[]>;
listPackages: () => Promise<{
baseCurrency: string;
basePrice: number;
credits: number;
discountPercent: string;
displayOrder: number;
finalPrice: number;
id: string;
isActive: boolean;
name: string;
}[]>;
listPaymentMethods: () => Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}[]>;
listPayments: (options?: {
limit?: string;
page?: string;
status?: string;
}) => Promise<{
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
}[]>;
listSubscriptions: () => Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}[]>;
listTransactions: (options?: {
limit?: string;
page?: string;
type?: string;
}) => Promise<{
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
}[]>;
savePaymentMethod: (request: {
paymentMethodId: string;
setAsDefault?: boolean;
}) => Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}>;
setDefaultPaymentMethod: (paymentMethodId: string) => Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}>;
updateAutoTopup: (request: {
enabled: boolean;
thresholdCredits: number;
topupPackageId: string;
}) => Promise<
| {
attemptsToday: number;
createdAt: string;
enabled: boolean;
id: string;
lastAttemptAt: string | null;
maxAttemptsPerDay: number;
organisationId: string;
thresholdCredits: number;
topupPackageId: string;
updatedAt: string;
}
| null>;
};
Defined in: client.ts:1976
Billing methods
cancelSubscription()
cancelSubscription: (subscriptionId: string) => Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}>;
Cancel subscription Cancel an active subscription
Parameters
| Parameter | Type |
|---|---|
subscriptionId | string |
Returns
Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}>
Operation Id
cancelSubscription
canSell()
canSell: (organisationId: string) => Promise<{
canSell: boolean;
currentBalance: number;
reason: string | null;
}>;
Check if organisation can sell Check if an organisation has sufficient credits to process sales
Parameters
| Parameter | Type |
|---|---|
organisationId | string |
Returns
Promise<{
canSell: boolean;
currentBalance: number;
reason: string | null;
}>
Operation Id
checkCanSell
createAiTopup()
createAiTopup: (request: {
aiPackageId: string;
billingAddress?: {
city: string;
country: string;
line1: string;
line2?: string;
name?: string;
postal_code: string;
state?: string;
};
currency?: string;
email?: string;
paymentMethodId: string;
}) => Promise<{
creditsAdded: number;
invoice: {
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
};
newBalance: number;
payment: {
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
};
}>;
Top up AI credits Purchase AI credits directly (separate from the bundle included with ticket-credit purchases)
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { aiPackageId: string; billingAddress?: { city: string; country: string; line1: string; line2?: string; name?: string; postal_code: string; state?: string; }; currency?: string; email?: string; paymentMethodId: string; } | - |
request.aiPackageId | string | - |
request.billingAddress? | { city: string; country: string; line1: string; line2?: string; name?: string; postal_code: string; state?: string; } | - |
request.billingAddress.city | string | - |
request.billingAddress.country | string | - |
request.billingAddress.line1 | string | - |
request.billingAddress.line2? | string | - |
request.billingAddress.name? | string | - |
request.billingAddress.postal_code | string | - |
request.billingAddress.state? | string | - |
request.currency? | string | - |
request.email? | string | Format: email |
request.paymentMethodId | string | - |
Returns
Promise<{
creditsAdded: number;
invoice: {
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
};
newBalance: number;
payment: {
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
};
}>
Operation Id
createAiTopup
createPurchase()
createPurchase: (request: {
billingAddress?: {
city: string;
country: string;
line1: string;
line2?: string;
name?: string;
postal_code: string;
state?: string;
};
currency?: string;
email?: string;
packageId: string;
paymentMethodId: string;
}) => Promise<{
invoice: {
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
};
newBalance: number;
payment: {
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
};
success: boolean;
transaction: {
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
};
}>;
Purchase credits Purchase a credit package for an organisation
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { billingAddress?: { city: string; country: string; line1: string; line2?: string; name?: string; postal_code: string; state?: string; }; currency?: string; email?: string; packageId: string; paymentMethodId: string; } | - |
request.billingAddress? | { city: string; country: string; line1: string; line2?: string; name?: string; postal_code: string; state?: string; } | - |
request.billingAddress.city | string | - |
request.billingAddress.country | string | - |
request.billingAddress.line1 | string | - |
request.billingAddress.line2? | string | - |
request.billingAddress.name? | string | - |
request.billingAddress.postal_code | string | - |
request.billingAddress.state? | string | - |
request.currency? | string | - |
request.email? | string | Format: email |
request.packageId | string | - |
request.paymentMethodId | string | - |
Returns
Promise<{
invoice: {
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
};
newBalance: number;
payment: {
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
};
success: boolean;
transaction: {
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
};
}>
Operation Id
createCreditPurchase
createSetupIntent()
createSetupIntent: () => Promise<string>;
Create setup intent Create a Stripe setup intent for saving a new payment method
Returns
Promise<string>
Operation Id
createSetupIntent
createSubscription()
createSubscription: (request: {
currency?: string;
email?: string;
interval: "month" | "year";
packageId: string;
paymentMethodId: string;
}) => Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}>;
Create subscription Create a new credit subscription for an organisation
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { currency?: string; email?: string; interval: "month" | "year"; packageId: string; paymentMethodId: string; } | - |
request.currency? | string | - |
request.email? | string | Format: email |
request.interval | "month" | "year" | |
request.packageId | string | - |
request.paymentMethodId | string | - |
Returns
Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}>
Operation Id
createSubscription
deletePaymentMethod()
deletePaymentMethod: (paymentMethodId: string) => Promise<boolean>;
Delete payment method Delete a saved payment method
Parameters
| Parameter | Type |
|---|---|
paymentMethodId | string |
Returns
Promise<boolean>
Operation Id
deletePaymentMethod
getAiBalance()
getAiBalance: () => Promise<{
balance: number;
isDepleted: boolean;
isLow: boolean;
lifetimeCredits: number;
lifetimeUsed: number;
}>;
Get AI credit balance Get the organisation's AI-credit (Cue) wallet balance
Returns
Promise<{
balance: number;
isDepleted: boolean;
isLow: boolean;
lifetimeCredits: number;
lifetimeUsed: number;
}>
Operation Id
getAiBalance
getAutoTopup()
getAutoTopup: () => Promise<
| {
attemptsToday: number;
createdAt: string;
enabled: boolean;
id: string;
lastAttemptAt: string | null;
maxAttemptsPerDay: number;
organisationId: string;
thresholdCredits: number;
topupPackageId: string;
updatedAt: string;
}
| null>;
Get auto top-up configuration Get the auto top-up configuration for an organisation
Returns
Promise<
| {
attemptsToday: number;
createdAt: string;
enabled: boolean;
id: string;
lastAttemptAt: string | null;
maxAttemptsPerDay: number;
organisationId: string;
thresholdCredits: number;
topupPackageId: string;
updatedAt: string;
}
| null>
Operation Id
getAutoTopup
getBalance()
getBalance: () => Promise<{
balance: number;
createdAt: string;
id: string;
isSuspended: boolean;
lifetimeCredits: number;
lifetimeUsed: number;
organisationId: string;
status: "healthy" | "low" | "depleted" | "negative" | "suspended";
suspendedAt: string | null;
suspendedReason: string | null;
updatedAt: string;
}>;
Get credit balance Get the current credit balance for an organisation
Returns
Promise<{
balance: number;
createdAt: string;
id: string;
isSuspended: boolean;
lifetimeCredits: number;
lifetimeUsed: number;
organisationId: string;
status: "healthy" | "low" | "depleted" | "negative" | "suspended";
suspendedAt: string | null;
suspendedReason: string | null;
updatedAt: string;
}>
Operation Id
getCreditBalance
getInvoice()
getInvoice: (invoiceId: string) => Promise<{
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
}>;
Get invoice Get a specific invoice by ID
Parameters
| Parameter | Type |
|---|---|
invoiceId | string |
Returns
Promise<{
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
}>
Operation Id
getInvoice
listAiPackages()
listAiPackages: () => Promise<{
baseCurrency: string;
basePrice: number;
credits: number;
discountPercent: number;
displayOrder: number;
finalPrice: number;
id: string;
isActive: boolean;
name: string;
}[]>;
List AI credit packages List the AI-credit top-up packages available for purchase
Returns
Promise<{
baseCurrency: string;
basePrice: number;
credits: number;
discountPercent: number;
displayOrder: number;
finalPrice: number;
id: string;
isActive: boolean;
name: string;
}[]>
Operation Id
listAiCreditPackages
listAiTransactions()
listAiTransactions: (options?: {
limit?: string;
page?: string;
}) => Promise<{
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
}[]>;
List AI credit transactions List the AI-credit wallet transaction history
Parameters
| Parameter | Type |
|---|---|
options? | { limit?: string; page?: string; } |
options.limit? | string |
options.page? | string |
Returns
Promise<{
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
}[]>
Operation Id
listAiCreditTransactions
listInvoices()
listInvoices: (options?: {
limit?: string;
page?: string;
status?: string;
}) => Promise<{
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
}[]>;
List invoices List all invoices for an organisation
Parameters
| Parameter | Type |
|---|---|
options? | { limit?: string; page?: string; status?: string; } |
options.limit? | string |
options.page? | string |
options.status? | string |
Returns
Promise<{
amountDue: number;
amountPaid: number;
createdAt: string;
currency: string;
dueDate: string | null;
id: string;
invoiceNumber: string;
issueDate: string;
organisationId: string;
paidAt: string | null;
pdfUrl: string | null;
status: "draft" | "open" | "paid" | "void" | "uncollectible";
subtotal: number;
tax: number;
total: number;
type: "purchase" | "subscription" | "payg";
updatedAt: string;
}[]>
Operation Id
listInvoices
listPackages()
listPackages: () => Promise<{
baseCurrency: string;
basePrice: number;
credits: number;
discountPercent: string;
displayOrder: number;
finalPrice: number;
id: string;
isActive: boolean;
name: string;
}[]>;
List credit packages List all available credit packages for purchase
Returns
Promise<{
baseCurrency: string;
basePrice: number;
credits: number;
discountPercent: string;
displayOrder: number;
finalPrice: number;
id: string;
isActive: boolean;
name: string;
}[]>
Operation Id
listCreditPackages
listPaymentMethods()
listPaymentMethods: () => Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}[]>;
List payment methods List all saved payment methods for the organisation
Returns
Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}[]>
Operation Id
listPaymentMethods
listPayments()
listPayments: (options?: {
limit?: string;
page?: string;
status?: string;
}) => Promise<{
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
}[]>;
List billing payments List all billing payments for an organisation
Parameters
| Parameter | Type |
|---|---|
options? | { limit?: string; page?: string; status?: string; } |
options.limit? | string |
options.page? | string |
options.status? | string |
Returns
Promise<{
amount: number;
createdAt: string;
currency: string;
failedAt: string | null;
failureCode: string | null;
failureMessage: string | null;
id: string;
invoiceId: string | null;
method: string | null;
organisationId: string;
paidAt: string | null;
status: "cancelled" | "pending" | "succeeded" | "failed" | "refunded";
updatedAt: string;
}[]>
Operation Id
listBillingPayments
listSubscriptions()
listSubscriptions: () => Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}[]>;
List subscriptions List all subscriptions for an organisation
Returns
Promise<{
cancelledAt: string | null;
createdAt: string;
credits: number;
currency: string;
currentPeriodEnd: string | null;
currentPeriodStart: string | null;
endedAt: string | null;
id: string;
interval: "month" | "year";
organisationId: string;
packageId: string;
price: number;
status: "active" | "cancelled" | "paused" | "past_due" | "ended";
updatedAt: string;
}[]>
Operation Id
listSubscriptions
listTransactions()
listTransactions: (options?: {
limit?: string;
page?: string;
type?: string;
}) => Promise<{
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
}[]>;
List credit transactions List all credit transactions for an organisation
Parameters
| Parameter | Type |
|---|---|
options? | { limit?: string; page?: string; type?: string; } |
options.limit? | string |
options.page? | string |
options.type? | string |
Returns
Promise<{
amount: number;
balanceAfter: number;
balanceBefore: number;
createdAt: string;
description: string | null;
id: string;
invoiceId: string | null;
orderId: string | null;
organisationId: string;
subscriptionId: string | null;
type: | "initial"
| "purchase"
| "subscription"
| "ticket_sale"
| "adjustment"
| "refund";
}[]>
Operation Id
listCreditTransactions
savePaymentMethod()
savePaymentMethod: (request: {
paymentMethodId: string;
setAsDefault?: boolean;
}) => Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}>;
Save payment method Save a payment method after Stripe confirms the setup intent
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { paymentMethodId: string; setAsDefault?: boolean; } | - |
request.paymentMethodId | string | Example pm_1234567890 |
request.setAsDefault? | boolean | Example true |
Returns
Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}>
Operation Id
savePaymentMethod
setDefaultPaymentMethod()
setDefaultPaymentMethod: (paymentMethodId: string) => Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}>;
Set default payment method Set a payment method as the default for the organisation
Parameters
| Parameter | Type |
|---|---|
paymentMethodId | string |
Returns
Promise<{
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
createdAt: string;
id: string;
isDefault: boolean;
type: "card";
}>
Operation Id
setDefaultPaymentMethod
updateAutoTopup()
updateAutoTopup: (request: {
enabled: boolean;
thresholdCredits: number;
topupPackageId: string;
}) => Promise<
| {
attemptsToday: number;
createdAt: string;
enabled: boolean;
id: string;
lastAttemptAt: string | null;
maxAttemptsPerDay: number;
organisationId: string;
thresholdCredits: number;
topupPackageId: string;
updatedAt: string;
}
| null>;
Update auto top-up configuration Update the auto top-up configuration for an organisation
Parameters
| Parameter | Type |
|---|---|
request | { enabled: boolean; thresholdCredits: number; topupPackageId: string; } |
request.enabled | boolean |
request.thresholdCredits | number |
request.topupPackageId | string |
Returns
Promise<
| {
attemptsToday: number;
createdAt: string;
enabled: boolean;
id: string;
lastAttemptAt: string | null;
maxAttemptsPerDay: number;
organisationId: string;
thresholdCredits: number;
topupPackageId: string;
updatedAt: string;
}
| null>
Operation Id
updateAutoTopup
customers
customers: {
block: (customerId: string, request: {
reason?: string;
}) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
create: (request: {
accountId?: string;
email: string;
externalId?: string;
firstName?: string;
lastName?: string;
metadata?: Record<string, any>;
phone?: string;
}) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
get: (customerId: string) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
list: (options?: {
accountId?: string;
cursor?: string;
email?: string;
isBlocked?: string;
limit?: string;
page?: string;
search?: string;
updatedSince?: string;
}) => Promise<{
customers: {
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}[];
pagination: {
limit: number;
page: number;
total: number;
totalPages: number;
};
}>;
unblock: (customerId: string) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
update: (customerId: string, request: {
email?: string;
externalId?: any;
firstName?: any;
lastName?: any;
metadata?: any;
phone?: any;
}) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
};
Defined in: client.ts:2596
Customers methods
block()
block: (customerId: string, request: {
reason?: string;
}) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
Block customer Block a customer from making purchases
Parameters
| Parameter | Type |
|---|---|
customerId | string |
request | { reason?: string; } |
request.reason? | string |
Returns
Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>
Operation Id
blockCustomer
create()
create: (request: {
accountId?: string;
email: string;
externalId?: string;
firstName?: string;
lastName?: string;
metadata?: Record<string, any>;
phone?: string;
}) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
Create customer Create a new customer in the organisation
Parameters
| Parameter | Type |
|---|---|
request | { accountId?: string; email: string; externalId?: string; firstName?: string; lastName?: string; metadata?: Record<string, any>; phone?: string; } |
request.accountId? | string |
request.email | string |
request.externalId? | string |
request.firstName? | string |
request.lastName? | string |
request.metadata? | Record<string, any> |
request.phone? | string |
Returns
Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>
Operation Id
createCustomer
get()
get: (customerId: string) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
Get customer Get a specific customer by ID
Parameters
| Parameter | Type |
|---|---|
customerId | string |
Returns
Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>
Operation Id
getCustomer
list()
list: (options?: {
accountId?: string;
cursor?: string;
email?: string;
isBlocked?: string;
limit?: string;
page?: string;
search?: string;
updatedSince?: string;
}) => Promise<{
customers: {
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}[];
pagination: {
limit: number;
page: number;
total: number;
totalPages: number;
};
}>;
List customers List all customers with optional filtering and pagination
Parameters
| Parameter | Type |
|---|---|
options? | { accountId?: string; cursor?: string; email?: string; isBlocked?: string; limit?: string; page?: string; search?: string; updatedSince?: string; } |
options.accountId? | string |
options.cursor? | string |
options.email? | string |
options.isBlocked? | string |
options.limit? | string |
options.page? | string |
options.search? | string |
options.updatedSince? | string |
Returns
Promise<{
customers: {
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}[];
pagination: {
limit: number;
page: number;
total: number;
totalPages: number;
};
}>
Operation Id
listCustomers
unblock()
unblock: (customerId: string) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
Unblock customer Unblock a previously blocked customer
Parameters
| Parameter | Type |
|---|---|
customerId | string |
Returns
Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>
Operation Id
unblockCustomer
update()
update: (customerId: string, request: {
email?: string;
externalId?: any;
firstName?: any;
lastName?: any;
metadata?: any;
phone?: any;
}) => Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>;
Update customer Update an existing customer
Parameters
| Parameter | Type |
|---|---|
customerId | string |
request | { email?: string; externalId?: any; firstName?: any; lastName?: any; metadata?: any; phone?: any; } |
request.email? | string |
request.externalId? | any |
request.firstName? | any |
request.lastName? | any |
request.metadata? | any |
request.phone? | any |
Returns
Promise<{
accountId: string | null;
blockedAt: string | null;
blockedReason: string | null;
createdAt: string;
email: string;
externalId: string | null;
firstName: string | null;
id: string;
isBlocked: boolean;
lastName: string | null;
metadata: | {
[key: string]: unknown;
}
| null;
organisationId: string;
phone: string | null;
updatedAt: string;
}>
Operation Id
updateCustomer
deviceAuth
deviceAuth: {
issueToken: (request: {
deviceId: string;
deviceSecret: string;
}) => Promise<any>;
jwks: () => Promise<any>;
};
Defined in: client.ts:4503
Device Auth methods
issueToken()
issueToken: (request: {
deviceId: string;
deviceSecret: string;
}) => Promise<any>;
Mint a device token Exchange (deviceId, deviceSecret) for a short-lived device JWT.
Parameters
| Parameter | Type |
|---|---|
request | { deviceId: string; deviceSecret: string; } |
request.deviceId | string |
request.deviceSecret | string |
Returns
Promise<any>
Operation Id
issueDeviceToken
jwks()
jwks: () => Promise<any>;
Device JWKS Public keys for offline Local Command Token verification by relays.
Returns
Promise<any>
Operation Id
getDeviceJwks
devicePairing
devicePairing: {
claim: (request: {
accountId: string;
accountRoles: {
accountId: string;
roleId: string;
}[];
locationId?: string;
name: string;
userCode: string;
}) => Promise<any>;
confirm: (pairingId: string, request: {
deviceCode: string;
}) => Promise<any>;
getStatus: (pairingId: string) => Promise<any>;
reject: (pairingId: string, request: {
deviceCode: string;
}) => Promise<any>;
start: (request: {
name?: string;
platform?: {
appVersion?: string;
arch?: string;
hostname?: string;
os?: string;
osVersion?: string;
};
type: "kiosk" | "relay" | "scanner" | "signage";
}) => Promise<any>;
};
Defined in: client.ts:4429
Device Pairing methods
claim()
claim: (request: {
accountId: string;
accountRoles: {
accountId: string;
roleId: string;
}[];
locationId?: string;
name: string;
userCode: string;
}) => Promise<any>;
Claim a device pairing Staff claim a pending pairing for their organisation, naming the device and granting roles.
Parameters
| Parameter | Type |
|---|---|
request | { accountId: string; accountRoles: { accountId: string; roleId: string; }[]; locationId?: string; name: string; userCode: string; } |
request.accountId | string |
request.accountRoles | { accountId: string; roleId: string; }[] |
request.locationId? | string |
request.name | string |
request.userCode | string |
Returns
Promise<any>
Operation Id
claimDevicePairing
confirm()
confirm: (pairingId: string, request: {
deviceCode: string;
}) => Promise<any>;
Confirm device adoption The device confirms adoption and receives its id + one-time secret (device-code auth).
Parameters
| Parameter | Type |
|---|---|
pairingId | string |
request | { deviceCode: string; } |
request.deviceCode | string |
Returns
Promise<any>
Operation Id
confirmDevicePairing
getStatus()
getStatus: (pairingId: string) => Promise<any>;
Poll device pairing status The device polls pairing status, authenticated by its device code (query or X-Device-Code header).
Parameters
| Parameter | Type |
|---|---|
pairingId | string |
Returns
Promise<any>
Operation Id
getDevicePairing
reject()
reject: (pairingId: string, request: {
deviceCode: string;
}) => Promise<any>;
Reject device adoption The device rejects adoption; the pairing is invalidated (device-code auth).
Parameters
| Parameter | Type |
|---|---|
pairingId | string |
request | { deviceCode: string; } |
request.deviceCode | string |
Returns
Promise<any>
Operation Id
rejectDevicePairing
start()
start: (request: {
name?: string;
platform?: {
appVersion?: string;
arch?: string;
hostname?: string;
os?: string;
osVersion?: string;
};
type: "kiosk" | "relay" | "scanner" | "signage";
}) => Promise<any>;
Start device pairing A device begins pairing and receives a user code + device code (unauthenticated).
Parameters
| Parameter | Type |
|---|---|
request | { name?: string; platform?: { appVersion?: string; arch?: string; hostname?: string; os?: string; osVersion?: string; }; type: "kiosk" | "relay" | "scanner" | "signage"; } |
request.name? | string |
request.platform? | { appVersion?: string; arch?: string; hostname?: string; os?: string; osVersion?: string; } |
request.platform.appVersion? | string |
request.platform.arch? | string |
request.platform.hostname? | string |
request.platform.os? | string |
request.platform.osVersion? | string |
request.type | "kiosk" | "relay" | "scanner" | "signage" |
Returns
Promise<any>
Operation Id
startDevicePairing
devices
devices: {
assignRoles: (deviceId: string, request: {
accountRoles: {
accountId: string;
roleId: string;
}[];
}) => Promise<any>;
delete: (deviceId: string) => Promise<any>;
dispatchCommand: (deviceId: string, request: {
idempotencyKey?: string;
payload?: Record<string, any>;
peripheralId?: string;
type: string;
}) => Promise<any>;
get: (deviceId: string) => Promise<any>;
getCommand: (commandId: string) => Promise<any>;
list: (options?: {
accountId?: string;
connectivity?: "unknown" | "online" | "offline";
locationId?: string;
status?: "active" | "revoked";
type?: string;
}) => Promise<any>;
listCommands: (deviceId: string) => Promise<any>;
listEvents: (deviceId: string) => Promise<any>;
mediaCatalog: () => Promise<any>;
mintLocalToken: (deviceId: string, request: {
accountIds?: string[];
allowedCommandTypes?: string[];
ttlSeconds?: number;
}) => Promise<any>;
printers: () => Promise<any>;
revoke: (deviceId: string) => Promise<any>;
rotateCredential: (deviceId: string, request: {
graceSeconds?: number;
}) => Promise<any>;
update: (deviceId: string, request: {
locationId?: any;
name?: string;
}) => Promise<any>;
};
Defined in: client.ts:4654
Devices methods
assignRoles()
assignRoles: (deviceId: string, request: {
accountRoles: {
accountId: string;
roleId: string;
}[];
}) => Promise<any>;
Assign device roles Replace a device’s account-role assignments.
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
request | { accountRoles: { accountId: string; roleId: string; }[]; } |
request.accountRoles | { accountId: string; roleId: string; }[] |
Returns
Promise<any>
Operation Id
assignDeviceRoles
delete()
delete: (deviceId: string) => Promise<any>;
Delete device Soft-delete a revoked device.
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
Returns
Promise<any>
Operation Id
deleteDevice
dispatchCommand()
dispatchCommand: (deviceId: string, request: {
idempotencyKey?: string;
payload?: Record<string, any>;
peripheralId?: string;
type: string;
}) => Promise<any>;
Dispatch a command Queue a command for a device or one of its peripherals. Idempotent on Idempotency-Key.
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
request | { idempotencyKey?: string; payload?: Record<string, any>; peripheralId?: string; type: string; } |
request.idempotencyKey? | string |
request.payload? | Record<string, any> |
request.peripheralId? | string |
request.type | string |
Returns
Promise<any>
Operation Id
dispatchDeviceCommand
get()
get: (deviceId: string) => Promise<any>;
Get device Get a device with its peripherals and live status.
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
Returns
Promise<any>
Operation Id
getDevice
getCommand()
getCommand: (commandId: string) => Promise<any>;
Get a command Get a single command’s status/result by id (poll for completion).
Parameters
| Parameter | Type |
|---|---|
commandId | string |
Returns
Promise<any>
Operation Id
getDeviceCommand