Orders
Webhooks
Instead of asking us for updates, give us a URL. Selligate sends it a signed POST every time one of your orders changes status, including orders from your order form.
Submit your webhook URL
Your webhook URL is the endpoint on your server where Selligate sends webhooks, for example https://yourshop.com/selligate/webhook. Build that endpoint first (see Verify signatures for a ready-made example), then submit it:
- Log in to your dashboard and open Developers: test or live.
- Under Webhooks, paste your endpoint into Webhook URL and click Save. It must be a public
https://address. - Copy the signing secret (
whsec_…). You’ll use it to check each webhook is genuine. You can reveal or rotate it later. - Click Send test webhook. We send a
pingevent, and the result appears under Recent webhooks.
What we send
A POST with a JSON body. Answer with any 2xx status within 10 seconds. Do slow work after you respond. Anything else counts as a failure and is retried.
| Header | Value |
|---|---|
Selligate-Event | The event type, e.g. order.delivered. |
Selligate-Event-Id | Unique for each event. Use it to skip events you’ve already handled. |
Selligate-Signature | t=<unix time>,v1=<signature>. See Verify signatures. |
User-Agent | Selligate-Webhooks/1.0 |
{
"id": "evt_8H2kQ0aZ5mN1xYp3LrT7wVb4",
"type": "order.delivered",
"created_at": "2026-11-24T14:02:11+00:00",
"data": {
"order": {
"id": 482913,
"order_no": "ORD583014",
"external_id": "SHOP-1001",
"source": "api",
"status": "delivered",
"total_amount": 30000,
"amount_to_collect": 30000,
"agent": { "name": "Lekki Hub" },
"delivered_at": "2026-11-24T14:01:58+01:00",
...
}
}
}data.order is the full order object, the same as the API returns.
Events
| Event | Sent when |
|---|---|
order.assigned | The order is created and given to an agent, or moved to a different agent. |
order.out_for_delivery | The agent has taken it out. |
order.delivered | The agent has delivered it. |
order.failed | Delivery failed. failure_reason says why. |
order.cancelled | The order was cancelled. |
order.returned | The goods came back after delivery. |
ping | You clicked Send test webhook. |
Verify signatures
Anyone can post to your URL, so check every webhook really came from Selligate before acting on it:
- Read
tandv1from theSelligate-Signatureheader. - Compute HMAC-SHA256 of
t + "." + raw request body, using your signing secret as the key, as lowercase hex. - Compare it with
v1using a constant-time comparison, and reject timestamps more than 5 minutes old.
Use the raw request body, exactly as received. If your framework parses the JSON first, the signature won’t match.
// Express: use express.raw() so you get the exact bytes we signed
const crypto = require("crypto");
app.post("/selligate/webhook", express.raw({ type: "application/json" }), (req, res) => {
const header = req.get("Selligate-Signature") || "";
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = crypto
.createHmac("sha256", process.env.SELLIGATE_SIGNING_SECRET)
.update(`${t}.${req.body}`)
.digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
const valid = v1 && v1.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
if (!fresh || !valid) return res.status(400).send("bad signature");
const event = JSON.parse(req.body);
if (event.type === "order.delivered") {
markDelivered(event.data.order.external_id); // your code
}
res.sendStatus(200);
});<?php
$body = file_get_contents('php://input');
$header = $_SERVER['HTTP_SELLIGATE_SIGNATURE'] ?? '';
parse_str(str_replace(',', '&', $header), $sig); // ['t' => …, 'v1' => …]
$expected = hash_hmac('sha256', ($sig['t'] ?? '') . '.' . $body, getenv('SELLIGATE_SIGNING_SECRET'));
$fresh = abs(time() - (int) ($sig['t'] ?? 0)) < 300;
if (! $fresh || ! hash_equals($expected, $sig['v1'] ?? '')) {
http_response_code(400);
exit('bad signature');
}
$event = json_decode($body, true);
if ($event['type'] === 'order.delivered') {
markDelivered($event['data']['order']['external_id']); // your code
}
http_response_code(200);# Flask
import hashlib, hmac, json, os, time
from flask import Flask, request, abort
app = Flask(__name__)
@app.post("/selligate/webhook")
def selligate_webhook():
body = request.get_data() # raw bytes
parts = dict(p.split("=", 1) for p in request.headers.get("Selligate-Signature", "").split(",") if "=" in p)
expected = hmac.new(
os.environ["SELLIGATE_SIGNING_SECRET"].encode(),
f"{parts.get('t', '')}.".encode() + body,
hashlib.sha256,
).hexdigest()
fresh = abs(time.time() - int(parts.get("t", 0))) < 300
if not fresh or not hmac.compare_digest(expected, parts.get("v1", "")):
abort(400)
event = json.loads(body)
if event["type"] == "order.delivered":
mark_delivered(event["data"]["order"]["external_id"]) # your code
return "", 200Duplicates and order
A webhook can arrive more than once, or out of order (for example after a retry). Keep the Selligate-Event-Id values you’ve handled and ignore repeats. When in doubt, trust data.order.status, or call GET /orders/{id} for the current state.
Retries
If your endpoint doesn’t answer with 2xx in time, we try again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours, then mark the webhook as failed.
Every attempt is listed under Recent webhooks on the Developers page, with the status code your server returned. Once your endpoint is fixed you can Resend any webhook from there.
URL rules
- It must use
https://and be reachable from the internet. Local and private network addresses are refused. - Redirects aren’t followed. Give us the final URL.
- One webhook URL per account. To pause webhooks, turn them off on the Developers page.