Skip to content

Webhooks overview

For developers

A webhook is an HTTPS endpoint of yours that CardOffice calls when something happens: a photo is approved, an order ships, a card is revoked. Your system hears about it in seconds, without polling.

  1. Sign in as an administrator and open Settings → Integrations.
  2. Under Webhooks choose New webhook.
  3. Enter your endpoint URL and the events you want, separated by commas. The URL must be https:// and reachable from the internet.
  4. Copy the signing secret. It is shown once, and you need it to verify signatures. Keep it in your secret store, as you would an API key.

Each delivery is an HTTP POST with a JSON body:

{
"event": "order.status_changed",
"createdAt": "2027-02-01T03:00:00.412Z",
"companyId": "7e0d9c3a-2d8b-4e57-8f43-5c3a1b2d9e10",
"data": {
"orderId": "a3e8e6f0-1c7f-4a52-8f0e-3d4f6b1d5c77",
"orderNumber": "ACME-2027-0412",
"from": "draft",
"to": "cancelled"
}
}

and these headers:

Header Value
Content-Type application/json
User-Agent ID-Portal-Webhooks/2.0
X-IDPortal-Event The event name, for routing before you parse the body
X-IDPortal-Delivery A unique ID for this delivery. Use it to de-duplicate
X-IDPortal-Signature t=<unix seconds>,v1=<hmac>. See Verifying signatures

Reply with any 2xx status within 10 seconds to acknowledge the delivery. Queue the real work and respond first. Any other status, or no response in time, counts as a failure. Redirects are not followed.

Failed deliveries are retried with exponential backoff, starting at one minute and doubling to a ceiling of 30 minutes, for up to 8 attempts.

If an endpoint fails 20 times in a row, CardOffice switches the webhook off so it stops calling a broken receiver. Fix the endpoint, then switch the webhook back on in Settings → Integrations. Each delivery is recorded there with the status your endpoint returned and the start of its response body, so do not put anything sensitive in your responses.

Design your receiver for at-least-once delivery

Section titled “Design your receiver for at-least-once delivery”
  • De-duplicate on X-IDPortal-Delivery. A retry after a slow response can deliver the same event twice.
  • Do not rely on ordering. Two events close together can arrive out of order. Use createdAt, or fetch the current state from the API when it matters.
  • Treat the payload as a notification. Fetch the current object from the API when you need more than the fields supplied, or before acting on something that matters, such as door access.
  • Verify every delivery. See Verifying signatures.

CardOffice delivers only to public internet addresses. It checks the address your hostname points to at the moment of each delivery, and refuses private, loopback and link-local addresses, so a webhook cannot be used to reach internal systems. If your receiver sits on a private network, put a public HTTPS endpoint in front of it.

© 2026 Secure ID Ltd. All rights reserved.Documentation licence and terms