Customer Events
Webhook events for customers
Customer events are triggered when customers are created, updated, or deleted.
TypeScript Interfaces
Copy these interfaces to type your webhook handlers:
/** Base event properties included in all webhook events */
interface BaseEvent {
/** Unique event identifier (UUID) */
id: string;
/** Event type */
kind: string;
/** ISO 8601 timestamp */
time: string;
/** Transaction identifier (UUID) */
transactionId: string;
}
/** Fields that changed, each with from/to values */
type Changes = Record<string, { from: unknown; to: unknown }>;customer.created
Triggered when a customer is created, in the app, through the API, by an integration, or by an import.
{
"id": "3f1c2b9a-8e4d-4f30-92ab-45cd6f1c2b9a",
"kind": "customer.created",
"time": "2026-01-15T10:30:00.000Z",
"transactionId": "9b2e7c1d-4a5f-4e3b-8c6d-2f1a0b9c8d7e",
"customerId": "0f8e6a52-4b1d-4c7e-9a3f-6d2b8c1e5a74",
"companyName": "Acme Foods",
"code": "ACME"
}interface CustomerCreatedEvent extends BaseEvent {
kind: "customer.created";
/** Customer UUID */
customerId: string;
companyName: string;
/** The customer's code, if set */
code?: string;
/** "import" when the customer came from a file you imported */
origin?: "import";
}customer.updated
Triggered when a tracked field on a customer changes: name, contact details, code, currency, default carrier, tax rate, contacts, or addresses.
{
"id": "3f1c2b9a-8e4d-4f30-92ab-45cd6f1c2b9a",
"kind": "customer.updated",
"time": "2026-01-15T10:30:00.000Z",
"transactionId": "9b2e7c1d-4a5f-4e3b-8c6d-2f1a0b9c8d7e",
"customerId": "0f8e6a52-4b1d-4c7e-9a3f-6d2b8c1e5a74",
"companyName": "Acme Foods",
"code": "ACME",
"changes": {
"phoneNumber": {
"from": "555-0100",
"to": "555-0199"
}
}
}interface CustomerUpdatedEvent extends BaseEvent {
kind: "customer.updated";
/** Customer UUID */
customerId: string;
companyName?: string;
code?: string;
changes: Changes;
/** "import" when the change came from a file you imported */
origin?: "import";
}customer.deleted
Triggered when a customer is deleted.
{
"id": "3f1c2b9a-8e4d-4f30-92ab-45cd6f1c2b9a",
"kind": "customer.deleted",
"time": "2026-01-15T10:30:00.000Z",
"transactionId": "9b2e7c1d-4a5f-4e3b-8c6d-2f1a0b9c8d7e",
"customerId": "0f8e6a52-4b1d-4c7e-9a3f-6d2b8c1e5a74",
"companyName": "Acme Foods",
"code": "ACME"
}interface CustomerDeletedEvent extends BaseEvent {
kind: "customer.deleted";
/** Customer UUID */
customerId: string;
companyName?: string;
code?: string;
}All Customer Event Types
Union type for handling any customer event:
type CustomerEvent =
| CustomerCreatedEvent
| CustomerUpdatedEvent
| CustomerDeletedEvent;
// Type guard for customer events
function isCustomerEvent(event: BaseEvent): event is CustomerEvent {
return event.kind.startsWith("customer.");
}