Skip to content

Webhooks ​

At every step we POST to the https URL you gave Hızlıyo.

http
POST https://your-site.example/hizliyo-webhook
Content-Type: application/json
X-Hizliyo-Event: order.accepted
X-Hizliyo-Signature: t=1762707731,v1=4f7c1e9a2b8d0356f1a4c7e93b2d5087...
json
{
  "event": "order.accepted",
  "occurredAt": "2026-11-09T17:02:11Z",
  "test": false,
  "data": {
    "orderId": "e5a9f0d3-7c21-4b88-a06e-3f9182bd4471",
    "externalOrderId": "SITE-10023",
    "orderNumber": "WB-261109-14",
    "courierName": null,
    "reason": null
  }
}

Events ​

EventWhen
order.acceptedThe restaurant accepted (or it was auto-accepted)
order.rejectedClosed before acceptance: the restaurant rejected it or you cancelled it
order.preparingPreparation started
order.readyReady
order.picked_upThe courier picked it up
order.on_the_wayOn the way
order.deliveredDelivered
order.cancelledCancelled after acceptance
test.pingTest notification sent from the Hızlıyo dashboard

Ignore event names you do not recognise — new ones may be added.

Verifying signatures ​

X-Hizliyo-Signature is t=<unix seconds>,v1=<signature>, where the signature is the lowercase hex of HMAC-SHA256(webhook secret, "<t>.<raw body>"). The webhook secret (whsec_...) is separate from the API secret and is handed to you with your credentials.

  • Verify against the raw body before parsing JSON.
  • Reject timestamps older than 5 minutes (replay protection).
  • Compare in constant time.
js
import crypto from 'node:crypto';

export function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map(p => p.split('=', 2)));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 ?? ''));
}
php
function hizliyo_verify(string $rawBody, string $header, string $secret): bool {
    parse_str(str_replace(',', '&', $header), $p);
    $t = (int)($p['t'] ?? 0);
    if ($t === 0 || abs(time() - $t) > 300) return false;
    $expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
    return hash_equals($expected, $p['v1'] ?? '');
}

Responses and retries ​

  • A 2xx response marks the webhook delivered. If your processing is slow, return 200 first and process after.
  • No answer within 10 seconds, a network error, 5xx or 429 is retried after 5 s, 15 s, 1 min, 5 min, 15 min, 1 h, 3 h — in practice roughly 1 min, 1 min, 1 min, 5 min, 15 min, 1 h, 3 h since the sender runs every minute — at most 8 attempts, abandoned 24 hours after the first send. Webhooks usually arrive within a minute of the event.
  • Other 4xx responses (e.g. 400, 404, 410) are not retried.
  • Redirects (3xx) are not followed; give us the final URL.
  • The same event may arrive more than once — deduplicate on orderId + event. Order is not guaranteed; sort by occurredAt and poll the status when in doubt.

Hızlıyo Vendor API v1