03API reference
Webhooks
Rollmark calls your server when something happens: an order is made, matched, cancelled, marked ready, shipped or delivered, or a distributor order changes status. Register an endpoint here; the events themselves are described under webhooks in this document. Every delivery is signed; see the guide on signatures.
/webhooksList webhook endpointsPOST/webhooksRegister a webhook endpointGET/webhooks/{id}One webhook endpointPATCH/webhooks/{id}Change a webhook endpointDELETE/webhooks/{id}Remove a webhook endpointPOST/webhooks/{id}/testSend a test eventPOST/webhooks/{id}/rotate-secretRotate the signing secretGET/webhooks/{id}/deliveriesThe delivery logPOST/webhooks/{id}/deliveries/{delivery_id}/resendSend a delivery againList webhook endpoints
/webhooksEvery endpoint of the store, without secrets. Needs the webhooks:manage permission.
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object[] | |
data[].idrequired | string | |
data[].urlrequired | string (uri) | https only, port 443, a public host. Checked when it is registered and again at every delivery. |
data[].eventsrequired | ("order.created" | "order.matched" | "order.cancelled" | "order.ready" | "order.shipped" | "order.delivered" | "distributor_order.status_changed")[] | |
data[].description | string | Up to 200 characters. |
data[].staterequired | "enabled" | "disabled" | "disabled_failing" | "disabled_key" |
|
data[].disabled_reason | string | null | |
data[].consecutive_failures | integer | |
data[].last_success_at | string (date-time) | null | |
data[].last_failure_at | string (date-time) | null | |
data[].created_atrequired | string (date-time) |
Example
Register a webhook endpoint
/webhooks{ url, events, description? }. A store has at most 10 endpoints. The URL is checked now (https, port 443, a name that resolves only to public addresses) and at every delivery. You can subscribe only to events your key could read: order.* needs orders:read, distributor_order.* needs distributor_orders:read. The signing secret is in this answer and nowhere else. Needs the webhooks:manage permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Request body
| Field | Type | Description |
|---|---|---|
urlrequired | string | |
eventsrequired | ("order.created" | "order.matched" | "order.cancelled" | "order.ready" | "order.shipped" | "order.delivered" | "distributor_order.status_changed")[] | At least 1 item. |
description | string | Up to 200 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | |
data.urlrequired | string (uri) | https only, port 443, a public host. Checked when it is registered and again at every delivery. |
data.eventsrequired | ("order.created" | "order.matched" | "order.cancelled" | "order.ready" | "order.shipped" | "order.delivered" | "distributor_order.status_changed")[] | |
data.description | string | Up to 200 characters. |
data.staterequired | "enabled" | "disabled" | "disabled_failing" | "disabled_key" |
|
data.disabled_reason | string | null | |
data.consecutive_failures | integer | |
data.last_success_at | string (date-time) | null | |
data.last_failure_at | string (date-time) | null | |
data.created_atrequired | string (date-time) | |
data.secretrequired | string | The signing secret ( |
Example
One webhook endpoint
/webhooks/{id}Needs the webhooks:manage permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | |
data.urlrequired | string (uri) | https only, port 443, a public host. Checked when it is registered and again at every delivery. |
data.eventsrequired | ("order.created" | "order.matched" | "order.cancelled" | "order.ready" | "order.shipped" | "order.delivered" | "distributor_order.status_changed")[] | |
data.description | string | Up to 200 characters. |
data.staterequired | "enabled" | "disabled" | "disabled_failing" | "disabled_key" |
|
data.disabled_reason | string | null | |
data.consecutive_failures | integer | |
data.last_success_at | string (date-time) | null | |
data.last_failure_at | string (date-time) | null | |
data.created_atrequired | string (date-time) |
Example
Change a webhook endpoint
/webhooks/{id}{ url?, events?, description?, state? }. state is enabled or disabled; enabling an endpoint that was switched off for failing clears its failure count. An endpoint switched off because its key was revoked cannot be enabled (409): make a new one. Needs the webhooks:manage permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Request body
| Field | Type | Description |
|---|---|---|
url | string | |
events | ("order.created" | "order.matched" | "order.cancelled" | "order.ready" | "order.shipped" | "order.delivered" | "distributor_order.status_changed")[] | At least 1 item. |
description | string | Up to 200 characters. |
state | "enabled" | "disabled" |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | |
data.urlrequired | string (uri) | https only, port 443, a public host. Checked when it is registered and again at every delivery. |
data.eventsrequired | ("order.created" | "order.matched" | "order.cancelled" | "order.ready" | "order.shipped" | "order.delivered" | "distributor_order.status_changed")[] | |
data.description | string | Up to 200 characters. |
data.staterequired | "enabled" | "disabled" | "disabled_failing" | "disabled_key" |
|
data.disabled_reason | string | null | |
data.consecutive_failures | integer | |
data.last_success_at | string (date-time) | null | |
data.last_failure_at | string (date-time) | null | |
data.created_atrequired | string (date-time) |
Example
Remove a webhook endpoint
/webhooks/{id}With its log. Needs the webhooks:manage permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | |
data.deletedrequired | true |
Example
Send a test event
/webhooks/{id}/testQueues a ping event; Rollmark delivers it within a few seconds. See the result in the deliveries. The endpoint must be enabled (409 otherwise). Needs the webhooks:manage permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | |
data.endpoint_idrequired | string | |
data.event_idrequired | string | The event's id ( |
data.event_typerequired | string | |
data.staterequired | "pending" | "retrying" | "delivered" | "dead" | |
data.attemptsrequired | integer | |
data.last_status | integer | null | |
data.last_error | string | null | A short reason; never the receiver's reply. |
data.created_atrequired | string (date-time) | |
data.delivered_at | string (date-time) | null | |
data.next_attempt_at | string (date-time) | null | |
data.resent_from | string | null |
Example
Rotate the signing secret
/webhooks/{id}/rotate-secretA new secret, shown once. For 24 hours each delivery is signed with both (Rollmark-Signature: v1=<new>,v1=<old>), so a receiver can switch without a gap. Needs the webhooks:manage permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | |
data.secretrequired | string | The new signing secret |
Example
The delivery log
/webhooks/{id}/deliveriesNewest first, with a cursor. Ids, states and short reasons only: the payload is not shown. A delivery is delivered (a 2xx), retrying (failed, due again), or dead (failed 8 times over about two days, or waited more than 72 hours). Needs the webhooks:manage permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
limit | query | integer | Default 50. 1 to 100. |
cursor | query | string | The Up to 2048 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object[] | |
data[].idrequired | string | |
data[].endpoint_idrequired | string | |
data[].event_idrequired | string | The event's id ( |
data[].event_typerequired | string | |
data[].staterequired | "pending" | "retrying" | "delivered" | "dead" | |
data[].attemptsrequired | integer | |
data[].last_status | integer | null | |
data[].last_error | string | null | A short reason; never the receiver's reply. |
data[].created_atrequired | string (date-time) | |
data[].delivered_at | string (date-time) | null | |
data[].next_attempt_at | string (date-time) | null | |
data[].resent_from | string | null | |
next_cursorrequired | string | null |
Example
Send a delivery again
/webhooks/{id}/deliveries/{delivery_id}/resendSends the same event (the same id, so a receiver that has it can drop it) as a new delivery. The endpoint must be enabled (409 otherwise). Needs the webhooks:manage permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
delivery_idrequired | path | string | |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | |
data.endpoint_idrequired | string | |
data.event_idrequired | string | The event's id ( |
data.event_typerequired | string | |
data.staterequired | "pending" | "retrying" | "delivered" | "dead" | |
data.attemptsrequired | integer | |
data.last_status | integer | null | |
data.last_error | string | null | A short reason; never the receiver's reply. |
data.created_atrequired | string (date-time) | |
data.delivered_at | string (date-time) | null | |
data.next_attempt_at | string (date-time) | null | |
data.resent_from | string | null |