Webhooks

Events, payloads, signatures and retries.

Events

Inventory API
inventory.item.createdinventory.item.updatedinventory.stock.changedinventory.stock.lowinventory.transfer.shippedinventory.transfer.received
CRM API
crm.lead.createdcrm.lead.convertedcrm.contact.createdcrm.account.createdcrm.account.updatedcrm.opportunity.createdcrm.opportunity.stage_changedcrm.opportunity.woncrm.opportunity.lostcrm.activity.completed
HR API
hr.employee.createdhr.employee.updatedhr.leave.approvedhr.punch.recordedhr.payrun.finalisedhr.settlement.paid
Point of Sale API
customer.createdsale.completedsale.refundedsale.voidedshift.openedshift.closed

What you receive

A JSON POST to your URL with these headers:

X-Cargonio-Event: inventory.stock.low X-Cargonio-Event-Id: 9c1e… X-Cargonio-Delivery: 41203 X-Cargonio-Timestamp: 1763640000 X-Cargonio-Signature: t=1763640000,v1=<hmac>

Header names keep their current prefix; any change will be announced in advance.

Verify the signature

The signature is HMAC-SHA256 of "timestamp.body" with the webhook secret. Reject requests older than five minutes.

import crypto from 'node:crypto'; // header: "t=1763640000,v1=5f2c…" export function verify(rawBody, header, secret) { const parts = Object.fromEntries(header.split(',').map((p) => p.split('='))); const expected = crypto.createHmac('sha256', secret) .update(`${parts.t}.${rawBody}`).digest('hex'); const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300; return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1)); }$parts = []; foreach (explode(',', $header) as $p) { [$k, $v] = explode('=', $p, 2); $parts[$k] = $v; } $expected = hash_hmac('sha256', $parts['t'].'.'.$rawBody, $secret); $ok = hash_equals($expected, $parts['v1']) && abs(time() - (int) $parts['t']) < 300;

Retries

Answer with any 2xx within a few seconds. If a delivery fails we retry after:

  1. 1 min
  2. 5 min
  3. 30 min
  4. 2 h
  5. 12 h

Use X-Cargonio-Event-Id to ignore duplicates.