BackstageClient.tags
BackstageClient.tags in @ticketlayer/backstage.
@ticketlayer/backstage / BackstageClient / tags
tags: {
archive: (id: string, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>;
create: (request: {
appliesTo?: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
description?: string | null;
grantableBy?: ("api" | "code" | "staff" | "product")[];
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
}, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>;
get: (id: string, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>;
list: (options?: {
appliesTo?: "prices" | "customers" | "events" | "venues" | "ticket_types";
includeArchived?: "true" | "false";
kind?: "venue" | "ticket_type" | "customer" | "event" | "price";
}, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}[]>;
update: (id: string, request: {
appliesTo?: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archived?: boolean;
description?: string | null;
grantableBy?: ("api" | "code" | "staff" | "product")[];
label?: string;
}, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>;
};Defined in: client.ts:8414
Tags methods
archive()#
archive: (id: string, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>;Archive a tag definition Archive a definition. Nothing is deleted: the slug stays reserved, every reference keeps working and customers keep the tag, but it can no longer be granted. Idempotent. PATCH archived: false restores it.
Parameters#
| Parameter | Type |
|---|---|
id | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>
Operation Id#
archiveTagDefinition
create()#
create: (request: {
appliesTo?: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
description?: string | null;
grantableBy?: ("api" | "code" | "staff" | "product")[];
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
}, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>;Define a tag
Define a tag: its slug, label, kind, what it applies to and who may grant it. A slug in use (archived or not) is 409 TAG_SLUG_TAKEN. Needs tags.write over every account, and adding api to grantableBy needs a person rather than a key (403 TAG_API_GRANTING_NEEDS_STAFF).
Parameters#
| Parameter | Type | Description |
|---|---|---|
request | { appliesTo?: ("prices" | "customers" | "events" | "venues" | "ticket_types")[]; description?: string | null; grantableBy?: ("api" | "code" | "staff" | "product")[]; kind: "venue" | "ticket_type" | "customer" | "event" | "price"; label: string; slug: string; } | - |
request.appliesTo? | ("prices" | "customers" | "events" | "venues" | "ticket_types")[] | Description What the tag may be applied to; must include the kind's own target. Defaults to it Example [ "customers" ] |
request.description? | string | null | Example Current club members, renewed each season |
request.grantableBy? | ("api" | "code" | "staff" | "product")[] | Description Who may grant the tag to a customer. Empty on a tag that does not apply to customers. Defaults to ['staff'] for a customer tag. Adding api needs a person, not a key Example [ "staff" ] |
request.kind? | "venue" | "ticket_type" | "customer" | "event" | "price" | - |
request.label? | string | Description What a buyer reads. Renaming it changes no reference Example Members |
request.slug? | string | Description The stable key every reference stores (a ticket type, a listing window, a code, a customer). Unique in the organisation and fixed once created Example member |
requestOptions? | RequestOptions | - |
Returns#
Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>
Operation Id#
createTagDefinition
get()#
get: (id: string, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>;Get a tag definition
Parameters#
| Parameter | Type |
|---|---|
id | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>
Operation Id#
getTagDefinition
list()#
list: (options?: {
appliesTo?: "prices" | "customers" | "events" | "venues" | "ticket_types";
includeArchived?: "true" | "false";
kind?: "venue" | "ticket_type" | "customer" | "event" | "price";
}, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}[]>;List tag definitions The organisation's tag definitions, by slug. Archived ones are left out unless includeArchived=true.
Parameters#
| Parameter | Type |
|---|---|
options? | { appliesTo?: "prices" | "customers" | "events" | "venues" | "ticket_types"; includeArchived?: "true" | "false"; kind?: "venue" | "ticket_type" | "customer" | "event" | "price"; } |
options.appliesTo? | "prices" | "customers" | "events" | "venues" | "ticket_types" |
options.includeArchived? | "true" | "false" |
options.kind? | "venue" | "ticket_type" | "customer" | "event" | "price" |
requestOptions? | RequestOptions |
Returns#
Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}[]>
Operation Id#
listTagDefinitions
update()#
update: (id: string, request: {
appliesTo?: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archived?: boolean;
description?: string | null;
grantableBy?: ("api" | "code" | "staff" | "product")[];
label?: string;
}, requestOptions?: RequestOptions) => Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>;Update a tag definition Change the label, description, appliesTo or grantableBy, or archive (archived: true) and restore (archived: false). The slug and kind are fixed. Renaming the label changes what buyers read and no reference.
Parameters#
| Parameter | Type | Description |
|---|---|---|
id | string | - |
request | { appliesTo?: ("prices" | "customers" | "events" | "venues" | "ticket_types")[]; archived?: boolean; description?: string | null; grantableBy?: ("api" | "code" | "staff" | "product")[]; label?: string; } | - |
request.appliesTo? | ("prices" | "customers" | "events" | "venues" | "ticket_types")[] | Description What the tag may be applied to; must include the kind's own target. Defaults to it Example [ "customers" ] |
request.archived? | boolean | Description true archives the definition; false restores it Example false |
request.description? | string | null | Example Current club members, renewed each season |
request.grantableBy? | ("api" | "code" | "staff" | "product")[] | Description Who may grant the tag to a customer. Empty on a tag that does not apply to customers. Defaults to ['staff'] for a customer tag. Adding api needs a person, not a key Example [ "staff" ] |
request.label? | string | Description What a buyer reads. Renaming it changes no reference Example Members |
requestOptions? | RequestOptions | - |
Returns#
Promise<{
appliesTo: ("prices" | "customers" | "events" | "venues" | "ticket_types")[];
archivedAt: string | null;
autoDefined: boolean;
createdAt: string;
description: string | null;
grantableBy: ("api" | "code" | "staff" | "product")[];
id: string;
kind: "venue" | "ticket_type" | "customer" | "event" | "price";
label: string;
slug: string;
updatedAt: string;
}>
Operation Id#
updateTagDefinition