Add a webhook endpoint. Its signing secret is returned once.
const url = 'https://api.crossmart.io/api/v1/workspaces/example/webhook-endpoints';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com/crossmart/webhooks","description":"example","eventTypes":["order.created"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.crossmart.io/api/v1/workspaces/example/webhook-endpoints \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "url": "https://example.com/crossmart/webhooks", "description": "example", "eventTypes": [ "order.created" ] }'Events are POSTed to the URL as JSON, signed in the Crossmart-Signature header.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Where events are POSTed. https and a public address; plain http only outside production.
Example
https://example.com/crossmart/webhooksThe events to receive. webhook.test cannot be subscribed to.
Responses
Section titled “Responses”object
object
False when turned off by someone or after repeated failures
MANUAL: turned off by someone. FAILING: turned off by Crossmart.
Failed attempts since the last delivery that went through
The latest delivery attempt, whatever event it carried; null before the first
object
SUCCEEDED: the endpoint answered 2xx. FAILED: anything else, or no answer.
Null when no response came: a timeout or a connection error
Why the attempt failed; null on success
Until then deliveries are also signed with the secret the last rotation replaced
The signing secret. Shown once; store it now.
Example
{ "endpoint": { "url": "https://example.com/crossmart/webhooks", "description": "Order notifications to n8n", "eventTypes": [ "order.created" ], "disabledReason": "MANUAL", "lastDelivery": { "outcome": "SUCCEEDED", "responseStatus": 200, "error": "The endpoint answered with HTTP 503" } }, "secret": "whsec_3q2-7wEXAMPLEsecretVALUE0123456789abcdef"}The URL is not https (in production), or not a public address
The organization’s plan does not allow this (ENTITLEMENTS_ENFORCED is on). code and feature say why; upgrading the plan resolves it.
object
The code of the organization’s plan
Null is unlimited
How many more the request asked for
Example
{ "statusCode": 402, "error": "Payment Required", "code": "plan_limit_reached", "message": "The Free plan includes 2 connected channels, and 2 are in use. Upgrade the plan to add more.", "feature": "active_listings", "plan": "free"}The server has no CREDENTIALS_MASTER_KEY to encrypt secrets with