React to committed changes.
Signed, restaurant-scoped events delivered to your backend.
Configure a receiver#
Create an active webhook in API Management, choose the subscribed events, and store its one-time signing secret securely. Receivers must be public HTTPS on port 443 with a valid certificate. Private/reserved IPs and redirects are rejected.
Events and payload#
Event names are {entity}.{action}. Supported entities: orders, restaurants, branches, notification_campaigns, subscriptions. Mutation actions are insert, update, delete. Examples: orders.insert and orders.update.
The payload contains committed change metadata, not a complete resource. Fetch available resources with your scoped API key. A delete may make a later GET return 404.
{
"event_id": "123",
"type": "orders.update",
"record_id": 42,
"version": 2,
"occurred_at": "2026-11-02T09:00:00Z"
}Verify the signature#
Read X-Rinili-Timestamp, X-Rinili-Signature, X-Rinili-Delivery and X-Rinili-Event. Compute HMAC-SHA256 over the exact bytes of timestamp + "." + raw_request_body using your webhook secret. The signature header is sha256= plus lowercase hex.
Use constant-time comparison. Reject timestamps more than five minutes away from your server clock. Verify the original raw body before JSON parsing or transformation.
import { createHmac, timingSafeEqual } from "node:crypto";
// rawBody must be the original Buffer from your HTTP server.
function verifyWebhook(headers, rawBody, secret) {
const timestamp = headers["x-rinili-timestamp"];
const signature = headers["x-rinili-signature"];
if (!/^\d{10}$/.test(timestamp ?? "")) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
if (!/^sha256=[a-f0-9]{64}$/.test(signature ?? "")) return false;
const expected = createHmac("sha256", secret)
.update(timestamp + ".").update(rawBody).digest();
const actual = Buffer.from(signature.slice(7), "hex");
return actual.length === expected.length && timingSafeEqual(actual, expected);
}Acknowledge and deduplicate#
After verification, persist the delivery ID and enqueue processing atomically. Acknowledge with a 2xx response promptly. Deduplicate on X-Rinili-Delivery, which is distinct from the payload’s event_id. Duplicate deliveries should return 2xx without applying the event twice.
Delivery behavior#
Events originate from committed changes. Delivery is at least once; never assume global ordering or immediate arrival. The sender allows four job attempts with retry backoff of 15, 60 and 300 seconds between attempts. Non-2xx responses and network failures cause retries. After exhaustion, inspect delivery logs in the dashboard and reconcile using the API.