Skip to content
Docs

03API reference

Version 1.0.0Made from openapi.yaml

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.

List webhook endpoints

GET/webhooks
Scoped private key (rm_prv_), from a server
webhooks:manage

Every endpoint of the store, without secrets. Needs the webhooks:manage permission.

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject[]
data[].idrequiredstring
data[].urlrequiredstring (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[].descriptionstring

Up to 200 characters.

data[].staterequired"enabled" | "disabled" | "disabled_failing" | "disabled_key"

disabled_failing: switched off after 20 failed deliveries in a row. disabled_key: the API key that made it was revoked.

data[].disabled_reasonstring | null
data[].consecutive_failuresinteger
data[].last_success_atstring (date-time) | null
data[].last_failure_atstring (date-time) | null
data[].created_atrequiredstring (date-time)
Errors401403429503in the error envelope.

Example

Shell
curl "https://app.getrollmark.com/api/v1/webhooks" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

Register a webhook endpoint

POST/webhooks
Scoped private key (rm_prv_), from a server
webhooks:manage

{ 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

NameInTypeDescription
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Request body

FieldTypeDescription
urlrequiredstring
eventsrequired("order.created" | "order.matched" | "order.cancelled" | "order.ready" | "order.shipped" | "order.delivered" | "distributor_order.status_changed")[]

At least 1 item.

descriptionstring

Up to 200 characters.

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.urlrequiredstring (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.descriptionstring

Up to 200 characters.

data.staterequired"enabled" | "disabled" | "disabled_failing" | "disabled_key"

disabled_failing: switched off after 20 failed deliveries in a row. disabled_key: the API key that made it was revoked.

data.disabled_reasonstring | null
data.consecutive_failuresinteger
data.last_success_atstring (date-time) | null
data.last_failure_atstring (date-time) | null
data.created_atrequiredstring (date-time)
data.secretrequiredstring

The signing secret (whsec_...). Shown here once and never again; store it now. If it is lost, rotate it.

Errors400401403429503in the error envelope.

Example

Shell
curl -X POST "https://app.getrollmark.com/api/v1/webhooks" \
  -H "Authorization: Bearer $ROLLMARK_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"…","events":["order.created"]}'

One webhook endpoint

GET/webhooks/{id}
Scoped private key (rm_prv_), from a server
webhooks:manage

Needs the webhooks:manage permission.

Parameters

NameInTypeDescription
idrequiredpathstring

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.urlrequiredstring (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.descriptionstring

Up to 200 characters.

data.staterequired"enabled" | "disabled" | "disabled_failing" | "disabled_key"

disabled_failing: switched off after 20 failed deliveries in a row. disabled_key: the API key that made it was revoked.

data.disabled_reasonstring | null
data.consecutive_failuresinteger
data.last_success_atstring (date-time) | null
data.last_failure_atstring (date-time) | null
data.created_atrequiredstring (date-time)
Errors401403404429503in the error envelope.

Example

Shell
curl "https://app.getrollmark.com/api/v1/webhooks/<id>" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

Change a webhook endpoint

PATCH/webhooks/{id}
Scoped private key (rm_prv_), from a server
webhooks:manage

{ 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

NameInTypeDescription
idrequiredpathstring
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Request body

FieldTypeDescription
urlstring
events("order.created" | "order.matched" | "order.cancelled" | "order.ready" | "order.shipped" | "order.delivered" | "distributor_order.status_changed")[]

At least 1 item.

descriptionstring

Up to 200 characters.

state"enabled" | "disabled"

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.urlrequiredstring (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.descriptionstring

Up to 200 characters.

data.staterequired"enabled" | "disabled" | "disabled_failing" | "disabled_key"

disabled_failing: switched off after 20 failed deliveries in a row. disabled_key: the API key that made it was revoked.

data.disabled_reasonstring | null
data.consecutive_failuresinteger
data.last_success_atstring (date-time) | null
data.last_failure_atstring (date-time) | null
data.created_atrequiredstring (date-time)
Errors400401403404409429503in the error envelope.

Example

Shell
curl -X PATCH "https://app.getrollmark.com/api/v1/webhooks/<id>" \
  -H "Authorization: Bearer $ROLLMARK_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Remove a webhook endpoint

DELETE/webhooks/{id}
Scoped private key (rm_prv_), from a server
webhooks:manage

With its log. Needs the webhooks:manage permission.

Parameters

NameInTypeDescription
idrequiredpathstring
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.deletedrequiredtrue
Errors401403404429503in the error envelope.

Example

Shell
curl -X DELETE "https://app.getrollmark.com/api/v1/webhooks/<id>" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

Send a test event

POST/webhooks/{id}/test
Scoped private key (rm_prv_), from a server
webhooks:manage

Queues 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

NameInTypeDescription
idrequiredpathstring
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.endpoint_idrequiredstring
data.event_idrequiredstring

The event's id (evt_...), the same on every retry and resend.

data.event_typerequiredstring
data.staterequired"pending" | "retrying" | "delivered" | "dead"
data.attemptsrequiredinteger
data.last_statusinteger | null
data.last_errorstring | null

A short reason; never the receiver's reply.

data.created_atrequiredstring (date-time)
data.delivered_atstring (date-time) | null
data.next_attempt_atstring (date-time) | null
data.resent_fromstring | null
Errors401403404409429503in the error envelope.

Example

Shell
curl -X POST "https://app.getrollmark.com/api/v1/webhooks/<id>/test" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

Rotate the signing secret

POST/webhooks/{id}/rotate-secret
Scoped private key (rm_prv_), from a server
webhooks:manage

A 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

NameInTypeDescription
idrequiredpathstring
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.secretrequiredstring

The new signing secret

Errors401403404429503in the error envelope.

Example

Shell
curl -X POST "https://app.getrollmark.com/api/v1/webhooks/<id>/rotate-secret" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

The delivery log

GET/webhooks/{id}/deliveries
Scoped private key (rm_prv_), from a server
webhooks:manage

Newest 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

NameInTypeDescription
idrequiredpathstring
limitqueryinteger

Default 50. 1 to 100.

cursorquerystring

The next_cursor of the previous page. Opaque; do not build or change one. A cursor belongs to the request that produced it; with other parameters it is bad_cursor.

Up to 2048 characters.

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject[]
data[].idrequiredstring
data[].endpoint_idrequiredstring
data[].event_idrequiredstring

The event's id (evt_...), the same on every retry and resend.

data[].event_typerequiredstring
data[].staterequired"pending" | "retrying" | "delivered" | "dead"
data[].attemptsrequiredinteger
data[].last_statusinteger | null
data[].last_errorstring | null

A short reason; never the receiver's reply.

data[].created_atrequiredstring (date-time)
data[].delivered_atstring (date-time) | null
data[].next_attempt_atstring (date-time) | null
data[].resent_fromstring | null
next_cursorrequiredstring | null
Errors400401403404429503in the error envelope.

Example

Shell
curl "https://app.getrollmark.com/api/v1/webhooks/<id>/deliveries" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

Send a delivery again

POST/webhooks/{id}/deliveries/{delivery_id}/resend
Scoped private key (rm_prv_), from a server
webhooks:manage

Sends 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

NameInTypeDescription
idrequiredpathstring
delivery_idrequiredpathstring
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Responses

Headers: X-Request-Id

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.endpoint_idrequiredstring
data.event_idrequiredstring

The event's id (evt_...), the same on every retry and resend.

data.event_typerequiredstring
data.staterequired"pending" | "retrying" | "delivered" | "dead"
data.attemptsrequiredinteger
data.last_statusinteger | null
data.last_errorstring | null

A short reason; never the receiver's reply.

data.created_atrequiredstring (date-time)
data.delivered_atstring (date-time) | null
data.next_attempt_atstring (date-time) | null
data.resent_fromstring | null
Errors401403404409429503in the error envelope.

Example

Shell
curl -X POST "https://app.getrollmark.com/api/v1/webhooks/<id>/deliveries/<delivery_id>/resend" \
  -H "Authorization: Bearer $ROLLMARK_KEY"
Rollmark is made by Illumina Studios LLC. It was built at Ironcrest Arms LLC. Sample dealers, license numbers and costs in these docs are made up. Questions: [email protected].