Skip to content

Webhooks

Ordenly can notify your system when something happens, instead of your system having to ask.

Creating a destination

  1. In the back office, go to Settings → Integrations → Webhooks.
  2. Under URL, enter your system’s URL. It must be https and reachable from the internet: internal network addresses are rejected.
  3. Under When to notify, tick the events.
  4. Tap Add destination and save the secret: it’s shown only once and it’s what you’ll use to verify the signature.

Events

Event When
ticket.created A work order is created
ticket.closed A work order is closed

What you receive

A POST with this body:

{
"type": "ticket.created",
"created_at": "2026-09-24T09:12:03.221Z",
"data": {
"ticket": {
"id": "…", "number": 1043, "title": "AC in 204",
"status": "new", "priority": "high", "site_id": "…",
"category_id": "…", "location_id": "…", "created_at": "…"
}
}
}

And these headers:

Header What it is
X-Ordenly-Event The event
X-Ordenly-Delivery This delivery’s id: if it reaches you twice, it’s the same one
X-Ordenly-Signature t=<unix>,v1=<hmac>

Verifying the signature

The signature is an HMAC-SHA256, with the destination’s secret, over "<t>.<exact body>". Always verify it, using the raw body (as it arrives, before parsing it), and reject a t older than five minutes: that way a captured notification can’t be replayed tomorrow.

Node.js

import { createHmac, timingSafeEqual } from 'node:crypto';
export function isValidSignature(secret, rawBody, header) {
const t = /t=(\d+)/.exec(header)?.[1];
const v1 = /v1=([a-f0-9]{64})/.exec(header)?.[1];
if (!t || !v1) return false;
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
return timingSafeEqual(Buffer.from(v1, 'hex'), Buffer.from(expected, 'hex'));
}

Python

import hashlib, hmac, re, time
def is_valid_signature(secret: str, raw_body: bytes, header: str) -> bool:
t = re.search(r"t=(\d+)", header)
v1 = re.search(r"v1=([a-f0-9]{64})", header)
if not t or not v1 or abs(time.time() - int(t.group(1))) > 300:
return False
expected = hmac.new(secret.encode(), f"{t.group(1)}.".encode() + raw_body,
hashlib.sha256).hexdigest()
return hmac.compare_digest(v1.group(1), expected)

Responding and retries

  • Respond with a 2xx as soon as you receive it; do the work afterward.
  • If you don’t respond 2xx (or don’t respond), it’s retried six times: at 1 minute, 5, 15, 1 hour, 3 hours and 6 hours. After that the delivery is marked as failed, and in Deliveries you can see the code your system responded with.
  • Redirects (3xx) aren’t followed.
  • A notification isn’t lost even if Ordenly restarts: it’s stored in the same transaction as the work order.
  • It may arrive twice; use X-Ordenly-Delivery to avoid processing it twice.