Webhooks
Events, signatures and retries.
You receive a POST with a JSON body for every event you subscribed to. OAuth apps pick their events on the app page; business API keys create subscriptions through /webhooks with webhooks:manage.
| Event | Scope | When |
|---|---|---|
pos.order.paid | orders:read + customers:read | A point-of-sale sale was paid |
pos.order.refunded | orders:read + customers:read | A point-of-sale refund |
growth.invoice.paid | invoices:read + customers:read | An invoice was paid |
growth.contact.created | customers:read | A new customer |
growth.loyalty.stamp / .points / .reward_ready | loyalty:read + customers:read | Loyalty stamp, points, reward ready |
growth.ecommerce.order | sales_orders:read + customers:read | An online store order |
reservation.created / .cancelled / .seated | reservations:read | A table booking created, cancelled or seated |
review.submitted | reviews:read | A customer submitted a review after a visit |
invoice.posted | invoices:read | A customer invoice was posted |
bill.posted | vendor_bills:read | A vendor bill was posted |
installment.due | invoices:read | An instalment fell due |
manufacturing.done | manufacturing:read | A manufacturing order was completed |
delivery.assigned / .picked_up / .arrived / .delivered / .failed | deliveries:read | A delivery trip assigned, picked up, arrived, delivered or failed |
growth.package.sold / .renewed / .low / .expiring | customers:read | A package sold, renewed, running low or expiring |
app.uninstalled | — | Your app was uninstalled or suspended (apps only) |
POST /your/endpoint
x-pos-event: reservation.created
x-pos-delivery: evt_reservation_created_2c41d0a9f3_118.wh_…
x-pos-timestamp: 1763372400
x-pos-signature-256: sha256=5d1c…
{
"id": "evt_reservation_created_2c41d0a9f3_118",
"event": "reservation.created",
"createdAt": "2026-11-17T10:00:00.000Z",
"data": { "reservation_id": 118, "state": "confirmed", "start": "2026-11-20T17:00:00Z", "party_size": 4, "source": "website", "branch_id": 1 }
}Verify the signature first
The signature is HMAC-SHA256 with the subscription secret over the timestamp, a dot, then the body exactly as received. Refuse anything more than 300 seconds old and compare in constant time.
import { createHmac, timingSafeEqual } from "node:crypto";
// rawBody: the request body as received (a Buffer or string), BEFORE JSON.parse.
export function verifyCortexWebhook(rawBody, headers, secret) {
const timestamp = headers["x-pos-timestamp"];
const signature = headers["x-pos-signature-256"] ?? "";
const age = Math.abs(Date.now() / 1000 - Number(timestamp));
if (!timestamp || !Number.isFinite(age) || age > 300) return false;
const expected = "sha256=" + createHmac("sha256", secret)
.update(`${timestamp}.${rawBody}`)
.digest("hex");
const a = Buffer.from(signature);
const b = Buffer.from(expected);
return a.length === b.length && timingSafeEqual(a, b);
}import hashlib, hmac, time
def verify_cortex_webhook(raw_body: bytes, headers: dict, secret: str) -> bool:
timestamp = headers.get("x-pos-timestamp", "")
signature = headers.get("x-pos-signature-256", "")
try:
if abs(time.time() - int(timestamp)) > 300:
return False
except ValueError:
return False
signed = timestamp.encode() + b"." + raw_body
expected = "sha256=" + hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(signature, expected)Delivery and retries
- Any 2xx acknowledges. Anything else is retried after 1 minute, 5 minutes, 25 minutes, 2 hours, then 10 hours.
- The same event may arrive twice. The id in the body is stable for an event: drop the ones you have seen.
- Answer fast, then process in the background.
- Booking and review events arrive within about two minutes and carry no customer name or phone: read the details from /reservations/{id} or /reviews/{id} with the matching scope.