Polling a list every minute to notice a new invoice is wasteful and slow. A webhook tells you instead.
Setting one up
- Go to Settings → API keys & webhooks and open the Webhooks tab.
- Add the URL we should post to. It must be HTTPS.
- Choose the events you want.
- Save. A secret is generated — you will use it to verify that a delivery came from us.
- Use Test to send a sample delivery immediately.
What a delivery looks like
POST https://your-server.example/hooks/jai
Content-Type: application/json
X-JAI-Event: invoice.created
X-JAI-Signature: sha256=…
{
"event": "invoice.created",
"at": "2026-09-03T09:14:22.000Z",
"data": { "id": "…", "number": "INV-2042", … }
}
Verifying it
Compute an HMAC-SHA256 of the raw request body using your endpoint’s secret and compare it with the signature header. Compare the two in constant time, and reject anything that does not match — an unverified webhook endpoint is an open door.
Answering
- Reply
2xxquickly. Do the work afterwards, not before replying. - A non-2xx is retried; a slow endpoint will time out and be retried too.
- Deliveries can arrive more than once, so make your handler idempotent — key it on the event id.
Something missing or wrong here? Tell us — a question that needed asking usually means a page that needed writing.