Skip to content
Docs
Reference

BackstageClient.exchange

BackstageClient.exchange in @ticketlayer/backstage.

@ticketlayer/backstage


@ticketlayer/backstage / BackstageClient / exchange

exchange: {
  list: (options?: {
     after?: string;
     eventId?: string;
     limit?: number;
     orderId?: string;
   }, requestOptions?: RequestOptions) => Promise<{
     exchanges: {
        chipType: string | null;
        deviceId: string | null;
        eventId: string | null;
        exchangedAt: string;
        exchangedBy: string | null;
        holderLabel: string | null;
        holderName: string | null;
        id: string;
        idChecked: boolean;
        identifierId: string;
        orderId: string;
        orderNumber: string | null;
        passId: string;
        presented: "booking_pass" | "e_ticket";
        presentedPassId: string;
        slotId: string;
        uid: string;
        unitId: string | null;
     }[];
     nextCursor: string | null;
  }>;
  lookup: (request: {
     code: string;
   }, requestOptions?: RequestOptions) => Promise<{
     eventId: string | null;
     holders: {
        entitlements: {
           id: string;
           name: string;
           redemptionLimit: number | null;
           status: string;
           type: string;
        }[];
        exchanged:   | {
           at: string;
           passId: string;
           uid: string;
         }
           | null;
        idCheck: boolean;
        kind: "person" | "vehicle" | "group";
        label: string;
        mediaType: string | null;
        name: string | null;
        slotId: string;
     }[];
     orderId: string;
     orderNumber: string | null;
     passId: string;
     presented: "booking_pass" | "e_ticket";
     remaining: number;
  }>;
  swap: (slotId: string, request: {
     chipType?: string | null;
     code: string;
     commandId?: string;
     deviceId?: string | null;
     idChecked?: boolean;
     uid?: string;
   }, requestOptions?: RequestOptions) => Promise<{
     exchange: {
        chipType: string | null;
        deviceId: string | null;
        eventId: string | null;
        exchangedAt: string;
        exchangedBy: string | null;
        holderLabel: string | null;
        holderName: string | null;
        id: string;
        idChecked: boolean;
        identifierId: string;
        orderId: string;
        orderNumber: string | null;
        passId: string;
        presented: "booking_pass" | "e_ticket";
        presentedPassId: string;
        slotId: string;
        uid: string;
        unitId: string | null;
     };
     lookup: {
        eventId: string | null;
        holders: {
           entitlements: {
              id: string;
              name: string;
              redemptionLimit: number | null;
              status: string;
              type: string;
           }[];
           exchanged:   | {
              at: string;
              passId: string;
              uid: string;
            }
              | null;
           idCheck: boolean;
           kind: "person" | "vehicle" | "group";
           label: string;
           mediaType: string | null;
           name: string | null;
           slotId: string;
        }[];
        orderId: string;
        orderNumber: string | null;
        passId: string;
        presented: "booking_pass" | "e_ticket";
        remaining: number;
     };
     passLink: string | null;
  }>;
};

Defined in: client.ts:7188

Exchange methods

list()#

list: (options?: {
  after?: string;
  eventId?: string;
  limit?: number;
  orderId?: string;
}, requestOptions?: RequestOptions) => Promise<{
  exchanges: {
     chipType: string | null;
     deviceId: string | null;
     eventId: string | null;
     exchangedAt: string;
     exchangedBy: string | null;
     holderLabel: string | null;
     holderName: string | null;
     id: string;
     idChecked: boolean;
     identifierId: string;
     orderId: string;
     orderNumber: string | null;
     passId: string;
     presented: "booking_pass" | "e_ticket";
     presentedPassId: string;
     slotId: string;
     uid: string;
     unitId: string | null;
  }[];
  nextCursor: string | null;
}>;

Exchanges made The exchange station's history, newest first, a page at a time: by order, by event, or by the channel X-Ticketlayer-Channel names. Lists only the accounts where the caller holds entitlements.manage. Each row names the holder (label and name), the order's number and the event; the order's number and the holder's name only where the caller can read the order (orders.read on its account and, at channel scope, its channel).

Parameters#

ParameterType
options?{ after?: string; eventId?: string; limit?: number; orderId?: string; }
options.after?string
options.eventId?string
options.limit?number
options.orderId?string
requestOptions?RequestOptions

Returns#

Promise<{ exchanges: { chipType: string | null; deviceId: string | null; eventId: string | null; exchangedAt: string; exchangedBy: string | null; holderLabel: string | null; holderName: string | null; id: string; idChecked: boolean; identifierId: string; orderId: string; orderNumber: string | null; passId: string; presented: "booking_pass" | "e_ticket"; presentedPassId: string; slotId: string; uid: string; unitId: string | null; }[]; nextCursor: string | null; }>

Operation Id#

listExchanges

lookup()#

lookup: (request: {
  code: string;
}, requestOptions?: RequestOptions) => Promise<{
  eventId: string | null;
  holders: {
     entitlements: {
        id: string;
        name: string;
        redemptionLimit: number | null;
        status: string;
        type: string;
     }[];
     exchanged:   | {
        at: string;
        passId: string;
        uid: string;
      }
        | null;
     idCheck: boolean;
     kind: "person" | "vehicle" | "group";
     label: string;
     mediaType: string | null;
     name: string | null;
     slotId: string;
  }[];
  orderId: string;
  orderNumber: string | null;
  passId: string;
  presented: "booking_pass" | "e_ticket";
  remaining: number;
}>;

Look up what is being exchanged Scan what the buyer shows at the exchange station: the order's booking pass lists every holder on it, a holder's e-ticket that holder alone. Each holder with their name, whether ID must be checked, what they will get, and whether they have already swapped. 404 PASS_NOT_FOUND for an unknown code; 409 EXCHANGE_CODE_ENDED for one already exchanged or revoked, EXCHANGE_NOT_A_HOLDER for a ticket that is for no holder. Needs entitlements.manage on the order's account.

Parameters#

ParameterType
request{ code: string; }
request.codestring
requestOptions?RequestOptions

Returns#

Promise<{ eventId: string | null; holders: { entitlements: { id: string; name: string; redemptionLimit: number | null; status: string; type: string; }[]; exchanged: | { at: string; passId: string; uid: string; } | null; idCheck: boolean; kind: "person" | "vehicle" | "group"; label: string; mediaType: string | null; name: string | null; slotId: string; }[]; orderId: string; orderNumber: string | null; passId: string; presented: "booking_pass" | "e_ticket"; remaining: number; }>

Operation Id#

lookupExchange

swap()#

swap: (slotId: string, request: {
  chipType?: string | null;
  code: string;
  commandId?: string;
  deviceId?: string | null;
  idChecked?: boolean;
  uid?: string;
}, requestOptions?: RequestOptions) => Promise<{
  exchange: {
     chipType: string | null;
     deviceId: string | null;
     eventId: string | null;
     exchangedAt: string;
     exchangedBy: string | null;
     holderLabel: string | null;
     holderName: string | null;
     id: string;
     idChecked: boolean;
     identifierId: string;
     orderId: string;
     orderNumber: string | null;
     passId: string;
     presented: "booking_pass" | "e_ticket";
     presentedPassId: string;
     slotId: string;
     uid: string;
     unitId: string | null;
  };
  lookup: {
     eventId: string | null;
     holders: {
        entitlements: {
           id: string;
           name: string;
           redemptionLimit: number | null;
           status: string;
           type: string;
        }[];
        exchanged:   | {
           at: string;
           passId: string;
           uid: string;
         }
           | null;
        idCheck: boolean;
        kind: "person" | "vehicle" | "group";
        label: string;
        mediaType: string | null;
        name: string | null;
        slotId: string;
     }[];
     orderId: string;
     orderNumber: string | null;
     passId: string;
     presented: "booking_pass" | "e_ticket";
     remaining: number;
  };
  passLink: string | null;
}>;

Swap one holder for a wristband Tap a wristband for one holder: its chip UID is bound to the holder's pass, the holder's entitlements (entry, camping, meals) move onto it, and their items on the exchange unit are fulfilled. A presented e-ticket is superseded at once; a booking pass once every holder on it has swapped. 409 EXCHANGE_ALREADY_DONE for a second exchange, PASS_IDENTIFIER_TAKEN for a chip bound to another pass, EXCHANGE_ID_CHECK_REQUIRED where the event checks ID and idChecked is not set, EXCHANGE_CODE_MISMATCH when the holder is not on the pass shown, ORDER_NOT_PAID, FULFILMENT_UNIT_ON_HOLD, EXCHANGE_NOTHING_TO_EXCHANGE. Needs entitlements.manage on the order's account.

Parameters#

ParameterTypeDescription
slotIdstring-
request{ chipType?: string | null; code: string; commandId?: string; deviceId?: string | null; idChecked?: boolean; uid?: string; }-
request.chipType?string | nullDescription With a typed uid; taken from the command with commandId Example NTAG213
request.code?stringDescription What the buyer shows, scanned: the booking pass or a holder's e-ticket (its barcode or signed code)
request.commandId?stringDescription The station reader's completed nfc.read or nfc.encode (a relay command): the UID is taken from its checked result. 409 NFC_READ_UNUSABLE when it is not complete, older than 15 minutes or not an NFC command
request.deviceId?string | nullDescription The reader that read a typed uid; taken from the command with commandId
request.idChecked?booleanDescription Staff checked the holder's ID
request.uid?stringDescription The chip's UID, hex (4, 7 or 10 bytes; colons and spaces are ignored), from a reader in keyboard mode. Or give commandId Example 04A224B2C35E80
requestOptions?RequestOptions-

Returns#

Promise<{ exchange: { chipType: string | null; deviceId: string | null; eventId: string | null; exchangedAt: string; exchangedBy: string | null; holderLabel: string | null; holderName: string | null; id: string; idChecked: boolean; identifierId: string; orderId: string; orderNumber: string | null; passId: string; presented: "booking_pass" | "e_ticket"; presentedPassId: string; slotId: string; uid: string; unitId: string | null; }; lookup: { eventId: string | null; holders: { entitlements: { id: string; name: string; redemptionLimit: number | null; status: string; type: string; }[]; exchanged: | { at: string; passId: string; uid: string; } | null; idCheck: boolean; kind: "person" | "vehicle" | "group"; label: string; mediaType: string | null; name: string | null; slotId: string; }[]; orderId: string; orderNumber: string | null; passId: string; presented: "booking_pass" | "e_ticket"; remaining: number; }; passLink: string | null; }>

Operation Id#

exchangeHolder