Supplier Events
Webhook events for suppliers
Supplier events are triggered when suppliers 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 }>;supplier.created
Triggered when a supplier is created.
{
"id": "3f1c2b9a-8e4d-4f30-92ab-45cd6f1c2b9a",
"kind": "supplier.created",
"time": "2026-01-15T10:30:00.000Z",
"transactionId": "9b2e7c1d-4a5f-4e3b-8c6d-2f1a0b9c8d7e",
"supplierId": "b3d5f7a9-c1e3-4b5d-8f7a-9c1e3b5d7f9a",
"supplierName": "Prairie Grain Co.",
"supplierCode": "PGC"
}interface SupplierCreatedEvent extends BaseEvent {
kind: "supplier.created";
/** Supplier UUID */
supplierId: string;
supplierName?: string;
supplierCode?: string;
}supplier.updated
Triggered when a tracked field on a supplier changes: name, code, contact details, address, currency, or contacts.
{
"id": "3f1c2b9a-8e4d-4f30-92ab-45cd6f1c2b9a",
"kind": "supplier.updated",
"time": "2026-01-15T10:30:00.000Z",
"transactionId": "9b2e7c1d-4a5f-4e3b-8c6d-2f1a0b9c8d7e",
"supplierId": "b3d5f7a9-c1e3-4b5d-8f7a-9c1e3b5d7f9a",
"supplierName": "Prairie Grain Co.",
"supplierCode": "PGC",
"changes": {
"email": {
"from": "orders@pgc.example",
"to": "sales@pgc.example"
}
}
}interface SupplierUpdatedEvent extends BaseEvent {
kind: "supplier.updated";
/** Supplier UUID */
supplierId: string;
supplierName?: string;
supplierCode?: string;
changes: Changes;
}supplier.deleted
Triggered when a supplier is deleted.
{
"id": "3f1c2b9a-8e4d-4f30-92ab-45cd6f1c2b9a",
"kind": "supplier.deleted",
"time": "2026-01-15T10:30:00.000Z",
"transactionId": "9b2e7c1d-4a5f-4e3b-8c6d-2f1a0b9c8d7e",
"supplierId": "b3d5f7a9-c1e3-4b5d-8f7a-9c1e3b5d7f9a",
"supplierName": "Prairie Grain Co.",
"supplierCode": "PGC"
}interface SupplierDeletedEvent extends BaseEvent {
kind: "supplier.deleted";
/** Supplier UUID */
supplierId: string;
supplierName?: string;
supplierCode?: string;
}All Supplier Event Types
Union type for handling any supplier event:
type SupplierEvent =
| SupplierCreatedEvent
| SupplierUpdatedEvent
| SupplierDeletedEvent;
// Type guard for supplier events
function isSupplierEvent(event: BaseEvent): event is SupplierEvent {
return event.kind.startsWith("supplier.");
}