Receive webhooks
Declare a receiving endpoint, verify the signature, respond, deduplicate, catch up.
Rather than polling the API in a loop, let QuoSuite notify you: on every validated invoice, recorded payment or updated article, a signed JSON POST goes to the address of your choice — whether the change comes from the application, the API, the POS or the store.
QuoSuite your system
──────── ───────────
invoice validated, payment recorded…
│
▼ signed delivery (HMAC-SHA256)
POST https://you/webhooks/quosuite ────────► 1. verify the signature
▲ 2. ignore an evt_… already processed
│ no 2xx within 10 s? 3. answer 2xx, then process
└─ new attempt (1 min … 24 h)- Signed: each delivery carries
X-QuoSuite-Signature, the HMAC-SHA256 of the raw body with the receiving endpoint’s secret. - Timestamped: the signature covers the sending instant; a captured delivery cannot be replayed later.
- At least once: an event may arrive twice; its
evt_…identifier is used to ignore the duplicate. - Retried for almost two days, logged, redeliverable.
- Bounded by permissions: you only receive what the key can read through the API.
1. Declare a receiving endpoint
A receiving endpoint is a public https address and the list of wanted events. Two ways to declare it:
- through the API — the integration configures itself with its key (scope
webhooks:write); the endpoint belongs to the key and disappears with it. 10 per key; - from the application — Settings › API & Integrations › Webhooks, for the whole workspace, without writing code (automation tool, accounting software). The screen also shows those declared by integrations.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/webhooks/endpoints' \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"url": "https://accounting.example.com/webhooks/quosuite",
"events": [
"invoice.created",
"invoice.status_changed",
"invoice.paid",
"payment.created"
],
"description": "Accounting sync"
}'The 201 response contains the signing secret (secret, whsec_…):
Address rules: https:// only; refused: localhost, internal names, private or loopback IPs, credentials in the address. Redirects are not followed — declare the final address. events: ["*"] subscribes to every event the key can read, including those added later. An event outside the key’s scopes is refused (403 API_INSUFFICIENT_SCOPE).
2. Events
| Event | When | Scope |
|---|---|---|
quote.created | Quote created — by the application, the API, the POS or the shop. | sales:read |
quote.status_changed | Quote: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left. | sales:read |
sales_order.created | Customer order created — by the application, the API, the POS or the shop. | sales:read |
sales_order.status_changed | Customer order: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left. | sales:read |
delivery_note.created | Delivery note created — by the application, the API, the POS or the shop. | sales:read |
delivery_note.status_changed | Delivery note: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left. | sales:read |
invoice.created | Invoice created — by the application, the API, the POS or the shop. | sales:read |
invoice.status_changed | Invoice: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left. | sales:read |
invoice.paid | Invoice fully paid (balanceDue at 0). | sales:read |
credit_note.created | Customer credit note created — by the application, the API, the POS or the shop. | sales:read |
credit_note.status_changed | Customer credit note: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left. | sales:read |
purchase_order.created | Supplier purchase order created — by the application, the API, the POS or the shop. | purchases:read |
purchase_order.status_changed | Supplier purchase order: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left. | purchases:read |
goods_receipt.created | Goods receipt created — by the application, the API, the POS or the shop. | purchases:read |
goods_receipt.status_changed | Goods receipt: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left. | purchases:read |
purchase_invoice.created | Supplier invoice created — by the application, the API, the POS or the shop. | purchases:read |
purchase_invoice.status_changed | Supplier invoice: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left. | purchases:read |
purchase_invoice.paid | Supplier invoice fully paid (balanceDue at 0). | purchases:read |
payment.created | Payment recorded (receipt or disbursement), with its allocation to documents. | payments:read |
partner.created | New partner (customer, supplier, or both). | partners:read |
partner.updated | Partner record updated. | partners:read |
article.created | New article in the ERP catalogue. | articles:read |
article.updated | Article updated (name, price, VAT, archiving…). | articles:read |
rental_booking.created | New rental booking — placed on the rental website or created through the API (source). The vehicle is already held in the planning. | rental_bookings:read |
rental_booking.status_changed | Change of a booking’s displayed status (PENDING_PAYMENT, REQUESTED, CONFIRMED, IN_PROGRESS, RETURNED, CANCELLED, EXPIRED) — whether it comes from the API, the website, the payment, the agency or the expiry of the hold. previous.status gives the status left. | rental_bookings:read |
rental_availability.updated | Planning of a vehicle changed (reservation created, moved, cancelled; agreement opened, closed, extended; block). Close changes are grouped: data is always the availability at the time of sending (next 90 days). | rental:read |
crm_lead.created | New lead — entered in the application, imported from a file or created through the API (a website form…). The “new lead” automations run separately: the assignment may follow a few moments later. | crm_leads:read |
crm_lead.converted | Lead converted: data.conversion gives the account, contact, ERP customer record and deal created or reused (the deal also triggers crm_deal.created). | crm_leads:read |
crm_deal.created | New deal — entered, from a lead conversion, or created through the API. | crm:read |
crm_deal.stage_changed | Deal entered a stage: moved (pipeline board, deal page, API) or reopened. previous.stageId gives the stage left (null on reopening). | crm:read |
crm_deal.won | Deal won (status: WON, closedAt set, probability 100%). | crm:read |
crm_deal.lost | Deal lost (status: LOST, lostReason filled in). | crm:read |
project_task.created | New task (or sub-task) — in the application or through the API. | projects:read |
project_task.completed | Task completed: entered a column of category DONE (board, task page, API). previous.category gives the category left. | projects:read |
project_timesheet.approved | Timesheet fully approved (all its entries approved or invoiced): the time is ready to bill or to carry into payroll. A partial approval sends nothing. | project_time:read |
One family per document kind (quote, sales_order, delivery_note, invoice, credit_note, purchase_order, goods_receipt, purchase_invoice): <kind>.created and <kind>.status_changed (with previous.status), plus invoice.paid and purchase_invoice.paid when the document becomes PAID — settled by money actually received: a cheque or bill only counts once it is paid, and the event is sent at that moment. Schema details: Webhook events.
3. Shape of a delivery
POST /webhooks/quosuite HTTP/1.1
Host: accounting.example.com
Content-Type: application/json; charset=utf-8
X-QuoSuite-Event: invoice.status_changed
X-QuoSuite-Delivery: evt_2b7f3c9d4e5a6b7c8d9e0f1a
X-QuoSuite-Attempt: 1
X-QuoSuite-Signature: t=1759482900,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
{"id":"evt_2b7f3c9d4e5a6b7c8d9e0f1a","type":"invoice.status_changed","apiVersion":"v1",
"perimeter":"QUOSUITE","createdAt":"2026-10-02T09:15:00.000Z",
"previous":{"status":"DRAFT"},
"data":{"id":"5b0e7c1a-…","kind":"invoice","number":"FAC-2026-0042","status":"VALIDATED", … }}| Field | Meaning |
|---|---|
id | event identifier — the same on every attempt and every redelivery: your deduplication key (also in X-QuoSuite-Delivery) |
type | event type (also in X-QuoSuite-Event, to route without reading the body) |
apiVersion | version whose shape data follows (v1) |
createdAt | instant of the fact, not of the delivery |
previous | values before the change (status…) |
data | the resource in its API form — exactly what GET on it would return |
Arrival order is not guaranteed: an invoice.status_changed may precede the invoice.created that an attempt delayed. Rely on createdAt and data.updatedAt, or read the resource again.
4. Verify the signature
X-QuoSuite-Signature: t=<unix timestamp>,v1=<hex>[,v1=<hex>]
v1 = HEX( HMAC-SHA256( receiving endpoint secret, "<t>.<raw body>" ) )- Read the raw body, byte for byte, before any
JSON.parse/json_decode: re-encoded JSON does not verify. - Extract
tand thev1values. - Refuse if
|now − t| > 300seconds — protection against replay. - Compute HMAC-SHA256(secret,
t + "." + raw body) in hexadecimal. - Compare in constant time against each
v1: one match is enough. - Ignore unknown schemes (a future
v2=) rather than refusing.
import crypto from 'node:crypto';
import express from 'express';
function verifySignature(rawBody, header, secret, toleranceSec = 300) {
let t = null;
const signatures = [];
for (const part of (header ?? '').split(',')) {
const [key, value] = part.trim().split('=');
if (key === 't' && /^\d+$/.test(value)) t = Number(value);
else if (key === 'v1') signatures.push(value);
}
if (t === null || !signatures.length) return false;
if (Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
const expected = crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest();
return signatures.some((s) => {
const got = Buffer.from(s, 'hex');
return got.length === expected.length && crypto.timingSafeEqual(got, expected);
});
}
const app = express();
// express.raw: the body stays a Buffer, exactly as it was signed.
app.post('/webhooks/quosuite', express.raw({ type: 'application/json' }), (req, res) => {
if (!verifySignature(req.body, req.get('X-QuoSuite-Signature'), process.env.QUOSUITE_WEBHOOK_SECRET)) {
return res.sendStatus(401);
}
const event = JSON.parse(req.body.toString('utf8'));
res.sendStatus(200); // answer first…
queue.add(event.id, event); // …then process, deduplicated by event.id
});During the grace period of a secret rotation, the header carries two v1 values (old and new secret): your receiver switches to the new one whenever it wants, without losing a delivery.
5. Responding
- Answer
2xxwithin 10 seconds, before any long processing: store the event, answer, process later. - Deduplicate by
id: keep processed identifiers for a few days, ideally in a table with a unique index. - Any other status (
3xxincluded), a refused connection, an invalid certificate or a timeout is a failure: new attempt. 410 Gonemeans “this address no longer exists”: the receiving endpoint is disabled at once.429or503withRetry-After: the next attempt waits at least that long.
6. Retries
| Attempt | Delay after the previous one (±10 %) |
|---|---|
| 1 | immediate |
| 2 | 1 min |
| 3 | 5 min |
| 4 | 30 min |
| 5 | 2 h |
| 6 | 6 h |
| 7 | 12 h |
| 8 | 24 h — last |
That is almost 45 hours of coverage. Each attempt is signed at its own instant (t changes), with the same body and the same id. After 20 consecutive permanently failed deliveries, the receiving endpoint is disabled (status: DISABLED); reactivating it (active: true) resets its failures.
7. Test, monitor, redeliver
Send a webhook.ping event, signed like a real one, to test your receiver — its response is returned to you:
POST/webhooks/endpoints/{id}/test
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/webhooks/endpoints/0f1e2d3c-4b5a-4968-8776-655443322110/test' \
-H "Authorization: Bearer $QUOSUITE_API_KEY"The delivery log keeps 30 days of every delivery: status (PENDING, RETRYING, SUCCEEDED, FAILED, CANCELLED), attempts, beginning of your receiver’s response. Current failures:
curl 'https://quosuite.com/api/public/v1/quosuite/webhooks/deliveries?status=FAILED,RETRYING&limit=50' \
-H "Authorization: Bearer $QUOSUITE_API_KEY"Once your receiver is fixed, redeliver an event (same id, same body):
POST/webhooks/deliveries/{id}/redeliver
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/webhooks/deliveries/7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d/redeliver' \
-H "Authorization: Bearer $QUOSUITE_API_KEY"8. Lose nothing
“At least once” delivery does not cover everything: a receiver down for more than two days, or a disabled endpoint, misses events. Catch up through the API: walk the resource with updatedSince (the instant of the last safe sync) and the cursor — see Pagination. Webhooks for freshness, updatedSince as the safety net: together they lose nothing.
- GET
/webhooks/eventsEvent catalogue - GET
/webhooksWebhook configuration of the key - POST
/webhooks/endpointsDeclare a receiving endpoint - POST
/webhooks/endpoints/{id}/secretRotate the signing secret - POST
/webhooks/endpoints/{id}/testSend a test event - GET
/webhooks/deliveriesDelivery log - POST
/webhooks/deliveries/{id}/redeliverRedeliver an event