Skip to content
Docs
Reference

Interface: RequestOptions

Interface: RequestOptions in @ticketlayer/backstage.

@ticketlayer/backstage


@ticketlayer/backstage / RequestOptions

Defined in: client.ts:812

Per-call options: the last argument of every generated method.

  • headers are sent on this call only, over the client's own headers. The credential headers the client sets itself (Authorization, and X-Ticketlayer-Org or the session header when it has one) are set after them, so a per-call header does not replace them.
  • idempotencyKey is sent as Idempotency-Key. A write that honours it (its description says so) is then safe to retry with the same key: a double click or a network retry returns the first result instead of doing the work twice. Keep one key per intended write, and mint a new one when the request changes.
  • signal aborts the request.

Example#

await client.ledger.createSettlement(input, { idempotencyKey: crypto.randomUUID() });

Properties#

headers?#

optional headers: Record<string, string>;

Defined in: client.ts:813


idempotencyKey?#

optional idempotencyKey: string;

Defined in: client.ts:814


signal?#

optional signal: AbortSignal;

Defined in: client.ts:815