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:

  1. Log in to your dashboard and open Developers: test or live.
  2. Under Webhooks, paste your endpoint into Webhook URL and click Save. It must be a public https:// address.
  3. Copy the signing secret (whsec_…). You’ll use it to check each webhook is genuine. You can reveal or rotate it later.
  4. Click Send test webhook. We send a ping event, 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.

HeaderValue
Selligate-EventThe event type, e.g. order.delivered.
Selligate-Event-IdUnique for each event. Use it to skip events you’ve already handled.
Selligate-Signaturet=<unix time>,v1=<signature>. See Verify signatures.
User-AgentSelligate-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

EventSent when
order.assignedThe order is created and given to an agent, or moved to a different agent.
order.out_for_deliveryThe agent has taken it out.
order.deliveredThe agent has delivered it.
order.failedDelivery failed. failure_reason says why.
order.cancelledThe order was cancelled.
order.returnedThe goods came back after delivery.
pingYou clicked Send test webhook.

Verify signatures

Anyone can post to your URL, so check every webhook really came from Selligate before acting on it:

  1. Read t and v1 from the Selligate-Signature header.
  2. Compute HMAC-SHA256 of t + "." + raw request body, using your signing secret as the key, as lowercase hex.
  3. Compare it with v1 using a constant-time comparison, and reject timestamps more than 5 minutes old.
i

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 "", 200

Duplicates 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