Skip to content
Docs
Reference

BackstageClient.customers

BackstageClient.customers in @ticketlayer/backstage.

@ticketlayer/backstage


@ticketlayer/backstage / BackstageClient / customers

customers: {
  addNote: (customerId: string, request: {
     body: string;
     tier?: "internal" | "restricted";
   }, requestOptions?: RequestOptions) => Promise<{
     author: {
        id: string | null;
        kind: string;
     };
     body: string;
     createdAt: string;
     deletedAt: string | null;
     editedAt: string | null;
     id: string;
     legacyField: string | null;
     objectId: string;
     objectType: string;
     redactedAt: string | null;
     tier: "internal" | "restricted";
  }>;
  block: (customerId: string, request: {
     reason?: string;
   }, requestOptions?: RequestOptions) => 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;
  }>;
  correct: (customerId: string, request: {
     firstName?: string | null;
     lastName?: string | null;
     phone?: string | null;
   }, requestOptions?: RequestOptions) => Promise<{
     firstName: string | null;
     id: string;
     lastInitial: string | null;
     maskedEmail: string;
     phoneLast4: string | null;
  }>;
  create: (request: {
     accountId?: string;
     email: string;
     externalId?: string;
     firstName?: string;
     lastName?: string;
     metadata?: Record<string, any>;
     phone?: string;
   }, requestOptions?: RequestOptions) => 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;
  }>;
  deleteNote: (customerId: string, noteId: string, requestOptions?: RequestOptions) => Promise<{
     author: {
        id: string | null;
        kind: string;
     };
     body: string;
     createdAt: string;
     deletedAt: string | null;
     editedAt: string | null;
     id: string;
     legacyField: string | null;
     objectId: string;
     objectType: string;
     redactedAt: string | null;
     tier: "internal" | "restricted";
  }>;
  deletePhoto: (customerId: string, requestOptions?: RequestOptions) => Promise<boolean>;
  erase: (customerId: string, requestOptions?: RequestOptions) => Promise<{
     alreadyErased: boolean;
     customerId: string;
     erasedAt: string;
     redacted: {
        historyEntries: number;
        notes: number;
        orders: number;
        passes: number;
        payments: number;
     };
  }>;
  get: (customerId: string, requestOptions?: RequestOptions) => 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;
  }>;
  getHistory: (customerId: string, options?: {
     cursor?: string;
     limit?: number;
   }, requestOptions?: RequestOptions) => Promise<{
     history: {
        actor: {
           id: string | null;
           kind: string;
        };
        at: string;
        changes: {
         [key: string]: {
           from?: unknown;
           to?: unknown;
         };
        };
        id: string;
        kind: string;
        objectId: string;
        objectType: string;
        redacted: boolean;
        requestId: string | null;
        version: number | null;
     }[];
     nextCursor: string | null;
  }>;
  getTimeline: (customerId: string, options?: {
     cursor?: string;
     limit?: string;
     tier?: string;
     types?: string;
   }, requestOptions?: RequestOptions) => Promise<{
     entries: (
        | {
        at: string;
        case: {
           assignedAt: string | null;
           assigneeUserId: string | null;
           category: string | null;
           channel:   | "email"
              | "phone"
              | "sms"
              | "in_person"
              | "chat"
              | "concierge"
              | "manage"
              | "box_office"
              | "api";
           closedAt: string | null;
           contact:   | {
              email: ... | ...;
              name: ... | ...;
              phone: ... | ...;
            }
              | null;
           createdAt: string;
           createdBy: string | null;
           customerId: string | null;
           id: string;
           number: number;
           organisationId: string;
           owedReply: {
              breached: boolean;
              dueAt: string | null;
              owed: boolean;
              paused: boolean;
              since: string | null;
              target: "first_response" | "next_response" | null;
           };
           owningAccountId: string | null;
           priority: "low" | "normal" | "high" | "urgent";
           queueKey: string | null;
           reopenUntil: string | null;
           resolutionReason: "answered" | "refunded" | "exchanged" | "no_action" | "duplicate" | null;
           resolvedAt: string | null;
           resolverId: string | null;
           resolverKind: "user" | "ai" | "workflow" | null;
           retainUntil: string | null;
           salesChannelId: string | null;
           sla: {
              breachedAt: string | null;
              dueAt: string | null;
              firstRespondedAt: string | null;
              firstResponseDueAt: string | null;
              nextResponseDueAt: string | null;
              pausedAt: string | null;
              pausedSeconds: number;
              status: "none" | "running" | "paused" | "breached";
              target: "first_response" | "next_response" | null;
           };
           state:   | "new"
              | "open"
              | "waiting_on_customer"
              | "waiting_on_internal"
              | "resolved"
              | "closed"
              | "spam";
           stateCategory: "cancelled" | "open" | "waiting" | "done";
           subject: string;
           tags: string[];
           updatedAt: string;
           version: number;
        };
        id: string;
        type: "case";
      }
        | {
        activity: {
           attachmentAssetIds: string[];
           authorId: string | null;
           authorKind: "user" | "ai" | "system" | "customer" | "party";
           body: string | null;
           caseId: string | null;
           channel:   | "email"
              | "phone"
              | "sms"
              | "in_person"
              | "chat"
              | "concierge"
              | "manage"
              | "box_office"
              | "api"
              | null;
           createdAt: string;
           customerId: string | null;
           direction: "inbound" | "outbound" | null;
           id: string;
           kind:   | "chat"
              | "system"
              | "email_in"
              | "email_out"
              | "call"
              | "visit"
              | "ai_conversation"
              | "action"
              | "note";
           metadata: {
            [key: string]: unknown;
           };
           occurredAt: string;
           owningAccountId: string | null;
           sensitive: boolean;
           tier: "internal" | "restricted" | "self";
        };
        at: string;
        id: string;
        type: "activity";
      }
        | {
        at: string;
        id: string;
        order: {
           accountId: string;
           channelId: string | null;
           createdAt: string;
           currency: string;
           id: string;
           isTest: boolean;
           orderNumber: string;
           paymentStatus: string;
           status: string;
           total: number;
           totalRefunded: number;
        };
        type: "order";
     })[];
     nextCursor: string | null;
  }>;
  grantTag: (customerId: string, request: {
     expiresAt?: any;
     metadata?: Record<string, any>;
     source?: "manual" | "membership" | "import";
     tag: string;
   }, requestOptions?: RequestOptions) => Promise<{
     createdAt: string;
     customerId: string;
     expiresAt: string | null;
     extensions: {
        expiresAt: string | null;
        extendedAt: string;
        extendedBy: string | null;
        metadata:   | {
         [key: string]: unknown;
         }
           | null;
        previousExpiresAt: string | null;
        source: "manual" | "membership" | "import" | "presale";
     }[];
     grantedBy: string | null;
     id: string;
     metadata:   | {
      [key: string]: unknown;
      }
        | null;
     revokedAt: string | null;
     revokedBy: string | null;
     revokeReason: "revoked" | "expired" | null;
     source: "manual" | "membership" | "import" | "presale";
     tag: string;
     tagDefinitionId: string | null;
     updatedAt: string;
  }>;
  list: (options?: {
     accountId?: string;
     cursor?: string;
     email?: string;
     isBlocked?: string;
     limit?: string;
     page?: string;
     search?: string;
     updatedSince?: string;
   }, requestOptions?: RequestOptions) => 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;
     };
  }>;
  listNotes: (customerId: string, options?: {
     cursor?: string;
     limit?: number;
   }, requestOptions?: RequestOptions) => Promise<{
     nextCursor: string | null;
     notes: {
        author: {
           id: string | null;
           kind: string;
        };
        body: string;
        createdAt: string;
        deletedAt: string | null;
        editedAt: string | null;
        id: string;
        legacyField: string | null;
        objectId: string;
        objectType: string;
        redactedAt: string | null;
        tier: "internal" | "restricted";
     }[];
  }>;
  listTags: (customerId: string, options?: {
     includeRevoked?: "true" | "false";
   }, requestOptions?: RequestOptions) => Promise<{
     createdAt: string;
     customerId: string;
     expiresAt: string | null;
     extensions: {
        expiresAt: string | null;
        extendedAt: string;
        extendedBy: string | null;
        metadata:   | {
         [key: string]: unknown;
         }
           | null;
        previousExpiresAt: string | null;
        source: "manual" | "membership" | "import" | "presale";
     }[];
     grantedBy: string | null;
     id: string;
     metadata:   | {
      [key: string]: unknown;
      }
        | null;
     revokedAt: string | null;
     revokedBy: string | null;
     revokeReason: "revoked" | "expired" | null;
     source: "manual" | "membership" | "import" | "presale";
     tag: string;
     tagDefinitionId: string | null;
     updatedAt: string;
  }[]>;
  logActivity: (customerId: string, request: 
     | {
     accountId?: string;
     attachmentAssetIds?: string[];
     body: string;
     caseId?: string;
     kind: "note";
     occurredAt?: string;
     sensitive?: boolean;
     tier?: "internal" | "restricted" | "self";
   }
     | {
     accountId?: string;
     attachmentAssetIds?: string[];
     caseId?: string;
     direction: "inbound" | "outbound";
     durationSeconds?: number;
     kind: "call";
     notes?: string;
     occurredAt?: string;
     outcome?:   | "resolved"
        | "follow_up"
        | "voicemail"
        | "no_answer"
        | "wrong_number"
        | "other";
     phoneNumber?: string;
     sensitive?: boolean;
     tier?: "internal" | "restricted" | "self";
   }
     | {
     accountId?: string;
     asked: string;
     attachmentAssetIds?: string[];
     caseId?: string;
     done: string;
     kind: "visit";
     notes?: string;
     occurredAt?: string;
     sensitive?: boolean;
     tier?: "internal" | "restricted" | "self";
   }, requestOptions?: RequestOptions) => Promise<{
     activity: {
        attachmentAssetIds: string[];
        authorId: string | null;
        authorKind: "user" | "ai" | "system" | "customer" | "party";
        body: string | null;
        caseId: string | null;
        channel:   | "email"
           | "phone"
           | "sms"
           | "in_person"
           | "chat"
           | "concierge"
           | "manage"
           | "box_office"
           | "api"
           | null;
        createdAt: string;
        customerId: string | null;
        direction: "inbound" | "outbound" | null;
        id: string;
        kind:   | "chat"
           | "system"
           | "email_in"
           | "email_out"
           | "call"
           | "visit"
           | "ai_conversation"
           | "action"
           | "note";
        metadata: {
         [key: string]: unknown;
        };
        occurredAt: string;
        owningAccountId: string | null;
        sensitive: boolean;
        tier: "internal" | "restricted" | "self";
     };
     caseReopened: boolean;
  }>;
  match: (request: {
     email?: string;
     phone?: string;
   }, requestOptions?: RequestOptions) => Promise<{
     candidates: {
        firstName: string | null;
        id: string;
        lastInitial: string | null;
        maskedEmail: string;
        phoneLast4: string | null;
     }[];
     match:   | {
        accountId: string | null;
        firstName: string | null;
        id: string;
        isBlocked: boolean;
        lastInitial: string | null;
        maskedEmail: string;
        maskedPhone: string | null;
      }
        | null;
  }>;
  photo: (customerId: string, requestOptions?: RequestOptions) => Promise<
     | {
     assetId: string;
     contentType: string;
     expiresAt: string;
     sizeBytes: number;
     uploadedAt: string;
     uploadedBy: string | null;
     url: string;
   }
    | null>;
  revokeTag: (customerId: string, customerTagId: string, requestOptions?: RequestOptions) => Promise<{
     createdAt: string;
     customerId: string;
     expiresAt: string | null;
     extensions: {
        expiresAt: string | null;
        extendedAt: string;
        extendedBy: string | null;
        metadata:   | {
         [key: string]: unknown;
         }
           | null;
        previousExpiresAt: string | null;
        source: "manual" | "membership" | "import" | "presale";
     }[];
     grantedBy: string | null;
     id: string;
     metadata:   | {
      [key: string]: unknown;
      }
        | null;
     revokedAt: string | null;
     revokedBy: string | null;
     revokeReason: "revoked" | "expired" | null;
     source: "manual" | "membership" | "import" | "presale";
     tag: string;
     tagDefinitionId: string | null;
     updatedAt: string;
  }>;
  setPhoto: (customerId: string, requestOptions?: RequestOptions) => Promise<
     | {
     assetId: string;
     contentType: string;
     expiresAt: string;
     sizeBytes: number;
     uploadedAt: string;
     uploadedBy: string | null;
     url: string;
   }
    | null>;
  unblock: (customerId: string, requestOptions?: RequestOptions) => 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;
   }, requestOptions?: RequestOptions) => 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;
  }>;
  updateNote: (customerId: string, noteId: string, request: {
     body?: string;
     tier?: "internal" | "restricted";
   }, requestOptions?: RequestOptions) => Promise<{
     author: {
        id: string | null;
        kind: string;
     };
     body: string;
     createdAt: string;
     deletedAt: string | null;
     editedAt: string | null;
     id: string;
     legacyField: string | null;
     objectId: string;
     objectType: string;
     redactedAt: string | null;
     tier: "internal" | "restricted";
  }>;
};

Defined in: client.ts:4643

Customers methods

addNote()#

addNote: (customerId: string, request: {
  body: string;
  tier?: "internal" | "restricted";
}, requestOptions?: RequestOptions) => Promise<{
  author: {
     id: string | null;
     kind: string;
  };
  body: string;
  createdAt: string;
  deletedAt: string | null;
  editedAt: string | null;
  id: string;
  legacyField: string | null;
  objectId: string;
  objectType: string;
  redactedAt: string | null;
  tier: "internal" | "restricted";
}>;

Add customer note Add a staff note to a customer, internal by default. Needs the permission to update the customer; a restricted note also needs the restricted update permission (403 NOTE_TIER_FORBIDDEN). The note, and every later change to it, is in the customer's history.

Parameters#

ParameterTypeDescription
customerIdstring-
request{ body: string; tier?: "internal" | "restricted"; }-
request.bodystringDescription Markdown Example Comp for the promoter.
request.tier?"internal" | "restricted"Description Default internal Example internal @enum {string}
requestOptions?RequestOptions-

Returns#

Promise<{ author: { id: string | null; kind: string; }; body: string; createdAt: string; deletedAt: string | null; editedAt: string | null; id: string; legacyField: string | null; objectId: string; objectType: string; redactedAt: string | null; tier: "internal" | "restricted"; }>

Operation Id#

createCustomerNote

block()#

block: (customerId: string, request: {
  reason?: string;
}, requestOptions?: RequestOptions) => 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#

ParameterType
customerIdstring
request{ reason?: string; }
request.reason?string
requestOptions?RequestOptions

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

correct()#

correct: (customerId: string, request: {
  firstName?: string | null;
  lastName?: string | null;
  phone?: string | null;
}, requestOptions?: RequestOptions) => Promise<{
  firstName: string | null;
  id: string;
  lastInitial: string | null;
  maskedEmail: string;
  phoneLast4: string | null;
}>;

Correct a customer Correct the first name, last name or phone of a customer the caller's channel created, or matched by exact email through POST /customers/match. Needs customers.correct, which a channel secret key holds; staff edit customers with PATCH /customers/{customerId}. The email is never accepted: it is the customer's identity, and changing it would hand the record, its orders and its tickets to whoever holds the new address. Any other customer is 404. Every correction is recorded in the customer audit trail with the caller as actor. Answers the redacted view a match gives.

Parameters#

ParameterTypeDescription
customerIdstring-
request{ firstName?: string | null; lastName?: string | null; phone?: string | null; }-
request.firstName?string | nullDescription Corrected first name; null clears it Example Jane
request.lastName?string | nullDescription Corrected last name; null clears it Example Smith
request.phone?string | nullDescription Corrected phone number; null clears it Example +44 7700 900001
requestOptions?RequestOptions-

Returns#

Promise<{ firstName: string | null; id: string; lastInitial: string | null; maskedEmail: string; phoneLast4: string | null; }>

Operation Id#

correctCustomer

create()#

create: (request: {
  accountId?: string;
  email: string;
  externalId?: string;
  firstName?: string;
  lastName?: string;
  metadata?: Record<string, any>;
  phone?: string;
}, requestOptions?: RequestOptions) => 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. A channel named in X-Ticketlayer-Channel is optional and is recorded as the customer's provenance (an access grant for it and its account); it must be one the caller holds.

Parameters#

ParameterType
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
requestOptions?RequestOptions

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

deleteNote()#

deleteNote: (customerId: string, noteId: string, requestOptions?: RequestOptions) => Promise<{
  author: {
     id: string | null;
     kind: string;
  };
  body: string;
  createdAt: string;
  deletedAt: string | null;
  editedAt: string | null;
  id: string;
  legacyField: string | null;
  objectId: string;
  objectType: string;
  redactedAt: string | null;
  tier: "internal" | "restricted";
}>;

Delete customer note Delete a note. Its author only (403 NOTE_AUTHOR_ONLY). It leaves the list; the customer's history keeps what it said.

Parameters#

ParameterType
customerIdstring
noteIdstring
requestOptions?RequestOptions

Returns#

Promise<{ author: { id: string | null; kind: string; }; body: string; createdAt: string; deletedAt: string | null; editedAt: string | null; id: string; legacyField: string | null; objectId: string; objectType: string; redactedAt: string | null; tier: "internal" | "restricted"; }>

Operation Id#

deleteCustomerNote

deletePhoto()#

deletePhoto: (customerId: string, requestOptions?: RequestOptions) => Promise<boolean>;

Delete the customer's photo Delete the photo from storage and the record. The customer's photo is the restricted tier of their record: reading or changing it needs customers.read_restricted on the customer's account, held by Organisation Owner, Platform Admin and Venue Admin, and by any role an organisation grants it to.

Parameters#

ParameterType
customerIdstring
requestOptions?RequestOptions

Returns#

Promise<boolean>

Operation Id#

deleteCustomerPhoto

erase()#

erase: (customerId: string, requestOptions?: RequestOptions) => Promise<{
  alreadyErased: boolean;
  customerId: string;
  erasedAt: string;
  redacted: {
     historyEntries: number;
     notes: number;
     orders: number;
     passes: number;
     payments: number;
  };
}>;

Erase customer Erase one customer record, irreversibly. Its name, email, phone, addresses and external id are cleared (the email becomes erased-<id>@erased.invalid) and the record is deleted. Their orders, payments, tickets and the ledger stay, with the customer's personal data removed from them: an order's IP address, user agent and the buyer's notes; a payment's card fingerprint and expiry; a ticket's holder name and email. Every personal field is redacted in the history of the customer and their orders, and the notes on them have their body redacted, in the list and in history. One transaction. In a shared organisation this is the person's one record; in an isolated one it is one account's record, and the person's records at other accounts are erased separately. Needs customers.erase for the record's account (for a record with no account, for every account), as a person: held by default by Organisation Owner and Platform Admin only, and never by a key, an embed session or a delegated token. Erasing a record already erased changes nothing and answers 200 with alreadyErased true.

Parameters#

ParameterType
customerIdstring
requestOptions?RequestOptions

Returns#

Promise<{ alreadyErased: boolean; customerId: string; erasedAt: string; redacted: { historyEntries: number; notes: number; orders: number; passes: number; payments: number; }; }>

Operation Id#

eraseCustomer

get()#

get: (customerId: string, requestOptions?: RequestOptions) => 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. Account-scoped: readable when the record belongs to an account the caller may read, or provenance has shared it with one. Never channel-scoped.

Parameters#

ParameterType
customerIdstring
requestOptions?RequestOptions

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

getHistory()#

getHistory: (customerId: string, options?: {
  cursor?: string;
  limit?: number;
}, requestOptions?: RequestOptions) => Promise<{
  history: {
     actor: {
        id: string | null;
        kind: string;
     };
     at: string;
     changes: {
      [key: string]: {
        from?: unknown;
        to?: unknown;
      };
     };
     id: string;
     kind: string;
     objectId: string;
     objectType: string;
     redacted: boolean;
     requestId: string | null;
     version: number | null;
  }[];
  nextCursor: string | null;
}>;

Get customer history Every change to a customer record: who made it, when, from which request, and each field from and to. Readable by whoever reads the customer. Newest first. Each change shows only the fields the caller may read: a change to a field above their tier is not shown, and a change made only to such fields is left out. Paged by cursor.

Parameters#

ParameterType
customerIdstring
options?{ cursor?: string; limit?: number; }
options.cursor?string
options.limit?number
requestOptions?RequestOptions

Returns#

Promise<{ history: { actor: { id: string | null; kind: string; }; at: string; changes: { [key: string]: { from?: unknown; to?: unknown; }; }; id: string; kind: string; objectId: string; objectType: string; redacted: boolean; requestId: string | null; version: number | null; }[]; nextCursor: string | null; }>

Operation Id#

getCustomerHistory

getTimeline()#

getTimeline: (customerId: string, options?: {
  cursor?: string;
  limit?: string;
  tier?: string;
  types?: string;
}, requestOptions?: RequestOptions) => Promise<{
  entries: (
     | {
     at: string;
     case: {
        assignedAt: string | null;
        assigneeUserId: string | null;
        category: string | null;
        channel:   | "email"
           | "phone"
           | "sms"
           | "in_person"
           | "chat"
           | "concierge"
           | "manage"
           | "box_office"
           | "api";
        closedAt: string | null;
        contact:   | {
           email: ... | ...;
           name: ... | ...;
           phone: ... | ...;
         }
           | null;
        createdAt: string;
        createdBy: string | null;
        customerId: string | null;
        id: string;
        number: number;
        organisationId: string;
        owedReply: {
           breached: boolean;
           dueAt: string | null;
           owed: boolean;
           paused: boolean;
           since: string | null;
           target: "first_response" | "next_response" | null;
        };
        owningAccountId: string | null;
        priority: "low" | "normal" | "high" | "urgent";
        queueKey: string | null;
        reopenUntil: string | null;
        resolutionReason: "answered" | "refunded" | "exchanged" | "no_action" | "duplicate" | null;
        resolvedAt: string | null;
        resolverId: string | null;
        resolverKind: "user" | "ai" | "workflow" | null;
        retainUntil: string | null;
        salesChannelId: string | null;
        sla: {
           breachedAt: string | null;
           dueAt: string | null;
           firstRespondedAt: string | null;
           firstResponseDueAt: string | null;
           nextResponseDueAt: string | null;
           pausedAt: string | null;
           pausedSeconds: number;
           status: "none" | "running" | "paused" | "breached";
           target: "first_response" | "next_response" | null;
        };
        state:   | "new"
           | "open"
           | "waiting_on_customer"
           | "waiting_on_internal"
           | "resolved"
           | "closed"
           | "spam";
        stateCategory: "cancelled" | "open" | "waiting" | "done";
        subject: string;
        tags: string[];
        updatedAt: string;
        version: number;
     };
     id: string;
     type: "case";
   }
     | {
     activity: {
        attachmentAssetIds: string[];
        authorId: string | null;
        authorKind: "user" | "ai" | "system" | "customer" | "party";
        body: string | null;
        caseId: string | null;
        channel:   | "email"
           | "phone"
           | "sms"
           | "in_person"
           | "chat"
           | "concierge"
           | "manage"
           | "box_office"
           | "api"
           | null;
        createdAt: string;
        customerId: string | null;
        direction: "inbound" | "outbound" | null;
        id: string;
        kind:   | "chat"
           | "system"
           | "email_in"
           | "email_out"
           | "call"
           | "visit"
           | "ai_conversation"
           | "action"
           | "note";
        metadata: {
         [key: string]: unknown;
        };
        occurredAt: string;
        owningAccountId: string | null;
        sensitive: boolean;
        tier: "internal" | "restricted" | "self";
     };
     at: string;
     id: string;
     type: "activity";
   }
     | {
     at: string;
     id: string;
     order: {
        accountId: string;
        channelId: string | null;
        createdAt: string;
        currency: string;
        id: string;
        isTest: boolean;
        orderNumber: string;
        paymentStatus: string;
        status: string;
        total: number;
        totalRefunded: number;
     };
     type: "order";
  })[];
  nextCursor: string | null;
}>;

Get a customer timeline Everything about a customer that you can see, newest first: their cases, the activities on them and on the customer's own log (notes, calls, visits, actions), and their orders. Each is read under your own reach: cases and activities by the account that owns them (restricted ones only with cases.read_restricted), orders by orders.read and, at channel scope, your channels. So in an organisation whose accounts share customers, one venue never sees another's cases. Filter by entry type and activity tier; page with cursor.

Parameters#

ParameterType
customerIdstring
options?{ cursor?: string; limit?: string; tier?: string; types?: string; }
options.cursor?string
options.limit?string
options.tier?string
options.types?string
requestOptions?RequestOptions

Returns#

Promise<{ entries: ( | { at: string; case: { assignedAt: string | null; assigneeUserId: string | null; category: string | null; channel: | "email" | "phone" | "sms" | "in_person" | "chat" | "concierge" | "manage" | "box_office" | "api"; closedAt: string | null; contact: | { email: ... | ...; name: ... | ...; phone: ... | ...; } | null; createdAt: string; createdBy: string | null; customerId: string | null; id: string; number: number; organisationId: string; owedReply: { breached: boolean; dueAt: string | null; owed: boolean; paused: boolean; since: string | null; target: "first_response" | "next_response" | null; }; owningAccountId: string | null; priority: "low" | "normal" | "high" | "urgent"; queueKey: string | null; reopenUntil: string | null; resolutionReason: "answered" | "refunded" | "exchanged" | "no_action" | "duplicate" | null; resolvedAt: string | null; resolverId: string | null; resolverKind: "user" | "ai" | "workflow" | null; retainUntil: string | null; salesChannelId: string | null; sla: { breachedAt: string | null; dueAt: string | null; firstRespondedAt: string | null; firstResponseDueAt: string | null; nextResponseDueAt: string | null; pausedAt: string | null; pausedSeconds: number; status: "none" | "running" | "paused" | "breached"; target: "first_response" | "next_response" | null; }; state: | "new" | "open" | "waiting_on_customer" | "waiting_on_internal" | "resolved" | "closed" | "spam"; stateCategory: "cancelled" | "open" | "waiting" | "done"; subject: string; tags: string[]; updatedAt: string; version: number; }; id: string; type: "case"; } | { activity: { attachmentAssetIds: string[]; authorId: string | null; authorKind: "user" | "ai" | "system" | "customer" | "party"; body: string | null; caseId: string | null; channel: | "email" | "phone" | "sms" | "in_person" | "chat" | "concierge" | "manage" | "box_office" | "api" | null; createdAt: string; customerId: string | null; direction: "inbound" | "outbound" | null; id: string; kind: | "chat" | "system" | "email_in" | "email_out" | "call" | "visit" | "ai_conversation" | "action" | "note"; metadata: { [key: string]: unknown; }; occurredAt: string; owningAccountId: string | null; sensitive: boolean; tier: "internal" | "restricted" | "self"; }; at: string; id: string; type: "activity"; } | { at: string; id: string; order: { accountId: string; channelId: string | null; createdAt: string; currency: string; id: string; isTest: boolean; orderNumber: string; paymentStatus: string; status: string; total: number; totalRefunded: number; }; type: "order"; })[]; nextCursor: string | null; }>

Operation Id#

getCustomerTimeline

grantTag()#

grantTag: (customerId: string, request: {
  expiresAt?: any;
  metadata?: Record<string, any>;
  source?: "manual" | "membership" | "import";
  tag: string;
}, requestOptions?: RequestOptions) => Promise<{
  createdAt: string;
  customerId: string;
  expiresAt: string | null;
  extensions: {
     expiresAt: string | null;
     extendedAt: string;
     extendedBy: string | null;
     metadata:   | {
      [key: string]: unknown;
      }
        | null;
     previousExpiresAt: string | null;
     source: "manual" | "membership" | "import" | "presale";
  }[];
  grantedBy: string | null;
  id: string;
  metadata:   | {
   [key: string]: unknown;
   }
     | null;
  revokedAt: string | null;
  revokedBy: string | null;
  revokeReason: "revoked" | "expired" | null;
  source: "manual" | "membership" | "import" | "presale";
  tag: string;
  tagDefinitionId: string | null;
  updatedAt: string;
}>;

Grant a customer tag Grants a defined tag to a customer, optionally with an expiry and metadata. The slug must name a definition that applies to customers (400 TAG_NOT_DEFINED, TAG_NOT_APPLICABLE, TAG_ARCHIVED) and lists the caller in grantableBy (403 TAG_NOT_GRANTABLE): staff for a person holding customertags.grant, api for an organisation API key or delegated token holding the customertags.write scope.

Renewing: if the customer's previous grant of the tag has expired, it is closed (revokeReason expired) and a new grant is made (201, a new id, customer.tag_granted). If the customer holds the tag and it has not expired, a later expiresAt - or none, for a grant that no longer expires - extends that grant in place (200, the same id, recorded under extensions, customer.tag_extended); the same checks apply as to a grant. A grant that would change nothing - the held grant never expires, or already lasts as long or longer - is 409 CUSTOMER_TAG_ALREADY_GRANTED. A grant never shortens one: revoke it and grant again.

Parameters#

ParameterType
customerIdstring
request{ expiresAt?: any; metadata?: Record<string, any>; source?: "manual" | "membership" | "import"; tag: string; }
request.expiresAt?any
request.metadata?Record<string, any>
request.source?"manual" | "membership" | "import"
request.tag?string
requestOptions?RequestOptions

Returns#

Promise<{ createdAt: string; customerId: string; expiresAt: string | null; extensions: { expiresAt: string | null; extendedAt: string; extendedBy: string | null; metadata: | { [key: string]: unknown; } | null; previousExpiresAt: string | null; source: "manual" | "membership" | "import" | "presale"; }[]; grantedBy: string | null; id: string; metadata: | { [key: string]: unknown; } | null; revokedAt: string | null; revokedBy: string | null; revokeReason: "revoked" | "expired" | null; source: "manual" | "membership" | "import" | "presale"; tag: string; tagDefinitionId: string | null; updatedAt: string; }>

Operation Id#

grantCustomerTag

list()#

list: (options?: {
  accountId?: string;
  cursor?: string;
  email?: string;
  isBlocked?: string;
  limit?: string;
  page?: string;
  search?: string;
  updatedSince?: string;
}, requestOptions?: RequestOptions) => 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 customers with optional filtering and pagination. Account-scoped: the customers of the accounts the caller may list, plus records provenance has shared with them. Never channel-scoped. Each customer carries the fields the caller's access tiers reach: customers.read for an account the record belongs to or is shared with shows every documented field, and customers.list alone shows only public fields, which a customer has none of.

Parameters#

ParameterType
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
requestOptions?RequestOptions

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

listNotes()#

listNotes: (customerId: string, options?: {
  cursor?: string;
  limit?: number;
}, requestOptions?: RequestOptions) => Promise<{
  nextCursor: string | null;
  notes: {
     author: {
        id: string | null;
        kind: string;
     };
     body: string;
     createdAt: string;
     deletedAt: string | null;
     editedAt: string | null;
     id: string;
     legacyField: string | null;
     objectId: string;
     objectType: string;
     redactedAt: string | null;
     tier: "internal" | "restricted";
  }[];
}>;

List customer notes The staff notes on a customer, newest first, at the tiers the caller reads: internal notes to whoever reads the customer, restricted ones only with the restricted permission. Paged by cursor.

Parameters#

ParameterType
customerIdstring
options?{ cursor?: string; limit?: number; }
options.cursor?string
options.limit?number
requestOptions?RequestOptions

Returns#

Promise<{ nextCursor: string | null; notes: { author: { id: string | null; kind: string; }; body: string; createdAt: string; deletedAt: string | null; editedAt: string | null; id: string; legacyField: string | null; objectId: string; objectType: string; redactedAt: string | null; tier: "internal" | "restricted"; }[]; }>

Operation Id#

listCustomerNotes

listTags()#

listTags: (customerId: string, options?: {
  includeRevoked?: "true" | "false";
}, requestOptions?: RequestOptions) => Promise<{
  createdAt: string;
  customerId: string;
  expiresAt: string | null;
  extensions: {
     expiresAt: string | null;
     extendedAt: string;
     extendedBy: string | null;
     metadata:   | {
      [key: string]: unknown;
      }
        | null;
     previousExpiresAt: string | null;
     source: "manual" | "membership" | "import" | "presale";
  }[];
  grantedBy: string | null;
  id: string;
  metadata:   | {
   [key: string]: unknown;
   }
     | null;
  revokedAt: string | null;
  revokedBy: string | null;
  revokeReason: "revoked" | "expired" | null;
  source: "manual" | "membership" | "import" | "presale";
  tag: string;
  tagDefinitionId: string | null;
  updatedAt: string;
}[]>;

List customer tags Lists the tags a customer holds: lasting, channel-independent grants that ticket types and listing windows reference by slug. includeRevoked=true includes revoked grants.

Parameters#

ParameterType
customerIdstring
options?{ includeRevoked?: "true" | "false"; }
options.includeRevoked?"true" | "false"
requestOptions?RequestOptions

Returns#

Promise<{ createdAt: string; customerId: string; expiresAt: string | null; extensions: { expiresAt: string | null; extendedAt: string; extendedBy: string | null; metadata: | { [key: string]: unknown; } | null; previousExpiresAt: string | null; source: "manual" | "membership" | "import" | "presale"; }[]; grantedBy: string | null; id: string; metadata: | { [key: string]: unknown; } | null; revokedAt: string | null; revokedBy: string | null; revokeReason: "revoked" | "expired" | null; source: "manual" | "membership" | "import" | "presale"; tag: string; tagDefinitionId: string | null; updatedAt: string; }[]>

Operation Id#

listCustomerTags

logActivity()#

logActivity: (customerId: string, request: 
  | {
  accountId?: string;
  attachmentAssetIds?: string[];
  body: string;
  caseId?: string;
  kind: "note";
  occurredAt?: string;
  sensitive?: boolean;
  tier?: "internal" | "restricted" | "self";
}
  | {
  accountId?: string;
  attachmentAssetIds?: string[];
  caseId?: string;
  direction: "inbound" | "outbound";
  durationSeconds?: number;
  kind: "call";
  notes?: string;
  occurredAt?: string;
  outcome?:   | "resolved"
     | "follow_up"
     | "voicemail"
     | "no_answer"
     | "wrong_number"
     | "other";
  phoneNumber?: string;
  sensitive?: boolean;
  tier?: "internal" | "restricted" | "self";
}
  | {
  accountId?: string;
  asked: string;
  attachmentAssetIds?: string[];
  caseId?: string;
  done: string;
  kind: "visit";
  notes?: string;
  occurredAt?: string;
  sensitive?: boolean;
  tier?: "internal" | "restricted" | "self";
}, requestOptions?: RequestOptions) => Promise<{
  activity: {
     attachmentAssetIds: string[];
     authorId: string | null;
     authorKind: "user" | "ai" | "system" | "customer" | "party";
     body: string | null;
     caseId: string | null;
     channel:   | "email"
        | "phone"
        | "sms"
        | "in_person"
        | "chat"
        | "concierge"
        | "manage"
        | "box_office"
        | "api"
        | null;
     createdAt: string;
     customerId: string | null;
     direction: "inbound" | "outbound" | null;
     id: string;
     kind:   | "chat"
        | "system"
        | "email_in"
        | "email_out"
        | "call"
        | "visit"
        | "ai_conversation"
        | "action"
        | "note";
     metadata: {
      [key: string]: unknown;
     };
     occurredAt: string;
     owningAccountId: string | null;
     sensitive: boolean;
     tier: "internal" | "restricted" | "self";
  };
  caseReopened: boolean;
}>;

Log a call, visit or note on a customer Log a call (direction, number, duration, outcome, notes), an in-person visit (what was asked, what was done) or a note on a customer: on one of the customer's cases (caseId), or on the customer's own log when it belongs to no case. A log entry belongs to accountId, else your own account when you write cases on one, else the organisation; only that account and the organisation see it. Needs customers.read for the customer and cases.write for the account.

Parameters#

ParameterType
customerIdstring
request| { accountId?: string; attachmentAssetIds?: string[]; body: string; caseId?: string; kind: "note"; occurredAt?: string; sensitive?: boolean; tier?: "internal" | "restricted" | "self"; } | { accountId?: string; attachmentAssetIds?: string[]; caseId?: string; direction: "inbound" | "outbound"; durationSeconds?: number; kind: "call"; notes?: string; occurredAt?: string; outcome?: | "resolved" | "follow_up" | "voicemail" | "no_answer" | "wrong_number" | "other"; phoneNumber?: string; sensitive?: boolean; tier?: "internal" | "restricted" | "self"; } | { accountId?: string; asked: string; attachmentAssetIds?: string[]; caseId?: string; done: string; kind: "visit"; notes?: string; occurredAt?: string; sensitive?: boolean; tier?: "internal" | "restricted" | "self"; }
requestOptions?RequestOptions

Returns#

Promise<{ activity: { attachmentAssetIds: string[]; authorId: string | null; authorKind: "user" | "ai" | "system" | "customer" | "party"; body: string | null; caseId: string | null; channel: | "email" | "phone" | "sms" | "in_person" | "chat" | "concierge" | "manage" | "box_office" | "api" | null; createdAt: string; customerId: string | null; direction: "inbound" | "outbound" | null; id: string; kind: | "chat" | "system" | "email_in" | "email_out" | "call" | "visit" | "ai_conversation" | "action" | "note"; metadata: { [key: string]: unknown; }; occurredAt: string; owningAccountId: string | null; sensitive: boolean; tier: "internal" | "restricted" | "self"; }; caseReopened: boolean; }>

Operation Id#

logCustomerActivity

match()#

match: (request: {
  email?: string;
  phone?: string;
}, requestOptions?: RequestOptions) => Promise<{
  candidates: {
     firstName: string | null;
     id: string;
     lastInitial: string | null;
     maskedEmail: string;
     phoneLast4: string | null;
  }[];
  match:   | {
     accountId: string | null;
     firstName: string | null;
     id: string;
     isBlocked: boolean;
     lastInitial: string | null;
     maskedEmail: string;
     maskedPhone: string | null;
   }
     | null;
}>;

Match a customer Find a customer by exact email or exact phone, for attaching a returning buyer to a cart or an order. Answers candidates redacted to an id, first name, last initial, masked email and the last four digits of the phone, so a detail that is wrong can be seen and corrected; staff also get match, the first candidate with its account and blocked flag. Exact only: a partial address is refused, there is no wildcard, no search and no list. One lookup per call, at most 5 candidates, rate-limited per actor (60 a minute; a channel secret key also 300 an hour) and logged. In a shared organisation the match is organisation-wide; in an isolated one it stays inside the accounts the caller holds. A channel secret key that matches by email may then correct that customer's name and phone (POST /customers/{customerId}/correct).

Parameters#

ParameterType
request{ email?: string; phone?: string; }
request.email?string
request.phone?string
requestOptions?RequestOptions

Returns#

Promise<{ candidates: { firstName: string | null; id: string; lastInitial: string | null; maskedEmail: string; phoneLast4: string | null; }[]; match: | { accountId: string | null; firstName: string | null; id: string; isBlocked: boolean; lastInitial: string | null; maskedEmail: string; maskedPhone: string | null; } | null; }>

Operation Id#

matchCustomer

photo()#

photo: (customerId: string, requestOptions?: RequestOptions) => Promise<
  | {
  assetId: string;
  contentType: string;
  expiresAt: string;
  sizeBytes: number;
  uploadedAt: string;
  uploadedBy: string | null;
  url: string;
}
| null>;

Get the customer's photo The customer's photo for a membership card or a desk check, as a short-lived signed URL; null when there is none. The customer's photo is the restricted tier of their record: reading or changing it needs customers.read_restricted on the customer's account, held by Organisation Owner, Platform Admin and Venue Admin, and by any role an organisation grants it to.

Parameters#

ParameterType
customerIdstring
requestOptions?RequestOptions

Returns#

Promise< | { assetId: string; contentType: string; expiresAt: string; sizeBytes: number; uploadedAt: string; uploadedBy: string | null; url: string; } | null>

Operation Id#

getCustomerPhoto

revokeTag()#

revokeTag: (customerId: string, customerTagId: string, requestOptions?: RequestOptions) => Promise<{
  createdAt: string;
  customerId: string;
  expiresAt: string | null;
  extensions: {
     expiresAt: string | null;
     extendedAt: string;
     extendedBy: string | null;
     metadata:   | {
      [key: string]: unknown;
      }
        | null;
     previousExpiresAt: string | null;
     source: "manual" | "membership" | "import" | "presale";
  }[];
  grantedBy: string | null;
  id: string;
  metadata:   | {
   [key: string]: unknown;
   }
     | null;
  revokedAt: string | null;
  revokedBy: string | null;
  revokeReason: "revoked" | "expired" | null;
  source: "manual" | "membership" | "import" | "presale";
  tag: string;
  tagDefinitionId: string | null;
  updatedAt: string;
}>;

Revoke a customer tag Revokes a tag previously granted to a customer. The grant is kept, marked revoked. A person holding customertags.revoke may revoke any tag; a key may revoke only one whose definition lists api.

Parameters#

ParameterType
customerIdstring
customerTagIdstring
requestOptions?RequestOptions

Returns#

Promise<{ createdAt: string; customerId: string; expiresAt: string | null; extensions: { expiresAt: string | null; extendedAt: string; extendedBy: string | null; metadata: | { [key: string]: unknown; } | null; previousExpiresAt: string | null; source: "manual" | "membership" | "import" | "presale"; }[]; grantedBy: string | null; id: string; metadata: | { [key: string]: unknown; } | null; revokedAt: string | null; revokedBy: string | null; revokeReason: "revoked" | "expired" | null; source: "manual" | "membership" | "import" | "presale"; tag: string; tagDefinitionId: string | null; updatedAt: string; }>

Operation Id#

revokeCustomerTag

setPhoto()#

setPhoto: (customerId: string, requestOptions?: RequestOptions) => Promise<
  | {
  assetId: string;
  contentType: string;
  expiresAt: string;
  sizeBytes: number;
  uploadedAt: string;
  uploadedBy: string | null;
  url: string;
}
| null>;

Upload the customer's photo Upload a photo (multipart/form-data, field "file"; JPEG, PNG or WebP, at most 5 MB) to the customer's record, replacing any photo it had, which is deleted. Stored privately and erased when the customer is deleted. Needs customers.update too. The customer's photo is the restricted tier of their record: reading or changing it needs customers.read_restricted on the customer's account, held by Organisation Owner, Platform Admin and Venue Admin, and by any role an organisation grants it to.

Parameters#

ParameterType
customerIdstring
requestOptions?RequestOptions

Returns#

Promise< | { assetId: string; contentType: string; expiresAt: string; sizeBytes: number; uploadedAt: string; uploadedBy: string | null; url: string; } | null>

Operation Id#

setCustomerPhoto

unblock()#

unblock: (customerId: string, requestOptions?: RequestOptions) => 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#

ParameterType
customerIdstring
requestOptions?RequestOptions

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;
}, requestOptions?: RequestOptions) => 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. Account-scoped, never channel-scoped.

Parameters#

ParameterType
customerIdstring
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
requestOptions?RequestOptions

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

updateNote()#

updateNote: (customerId: string, noteId: string, request: {
  body?: string;
  tier?: "internal" | "restricted";
}, requestOptions?: RequestOptions) => Promise<{
  author: {
     id: string | null;
     kind: string;
  };
  body: string;
  createdAt: string;
  deletedAt: string | null;
  editedAt: string | null;
  id: string;
  legacyField: string | null;
  objectId: string;
  objectType: string;
  redactedAt: string | null;
  tier: "internal" | "restricted";
}>;

Edit customer note Change a note's body or tier. Its author only (403 NOTE_AUTHOR_ONLY), who must still be allowed to update the customer and to write both tiers. The note that stands for a field keeps that field's tier.

Parameters#

ParameterTypeDescription
customerIdstring-
noteIdstring-
request{ body?: string; tier?: "internal" | "restricted"; }-
request.body?stringExample Comp for the promoter, agreed by Sam.
request.tier?"internal" | "restricted"Example restricted @enum {string}
requestOptions?RequestOptions-

Returns#

Promise<{ author: { id: string | null; kind: string; }; body: string; createdAt: string; deletedAt: string | null; editedAt: string | null; id: string; legacyField: string | null; objectId: string; objectType: string; redactedAt: string | null; tier: "internal" | "restricted"; }>

Operation Id#

updateCustomerNote