Developers
Guides

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.

Texte
 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.

POST/webhooks/endpoints

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

EventWhenScope
quote.createdQuote created — by the application, the API, the POS or the shop.sales:read
quote.status_changedQuote: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left.sales:read
sales_order.createdCustomer order created — by the application, the API, the POS or the shop.sales:read
sales_order.status_changedCustomer order: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left.sales:read
delivery_note.createdDelivery note created — by the application, the API, the POS or the shop.sales:read
delivery_note.status_changedDelivery note: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left.sales:read
invoice.createdInvoice created — by the application, the API, the POS or the shop.sales:read
invoice.status_changedInvoice: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left.sales:read
invoice.paidInvoice fully paid (balanceDue at 0).sales:read
credit_note.createdCustomer credit note created — by the application, the API, the POS or the shop.sales:read
credit_note.status_changedCustomer credit note: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left.sales:read
purchase_order.createdSupplier purchase order created — by the application, the API, the POS or the shop.purchases:read
purchase_order.status_changedSupplier purchase order: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left.purchases:read
goods_receipt.createdGoods receipt created — by the application, the API, the POS or the shop.purchases:read
goods_receipt.status_changedGoods receipt: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left.purchases:read
purchase_invoice.createdSupplier invoice created — by the application, the API, the POS or the shop.purchases:read
purchase_invoice.status_changedSupplier invoice: status change (validation, sending, delivery, invoicing, payment, cancellation). previous.status gives the status left.purchases:read
purchase_invoice.paidSupplier invoice fully paid (balanceDue at 0).purchases:read
payment.createdPayment recorded (receipt or disbursement), with its allocation to documents.payments:read
partner.createdNew partner (customer, supplier, or both).partners:read
partner.updatedPartner record updated.partners:read
article.createdNew article in the ERP catalogue.articles:read
article.updatedArticle updated (name, price, VAT, archiving…).articles:read
rental_booking.createdNew 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_changedChange 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.updatedPlanning 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.createdNew 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.convertedLead 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.createdNew deal — entered, from a lead conversion, or created through the API.crm:read
crm_deal.stage_changedDeal entered a stage: moved (pipeline board, deal page, API) or reopened. previous.stageId gives the stage left (null on reopening).crm:read
crm_deal.wonDeal won (status: WON, closedAt set, probability 100%).crm:read
crm_deal.lostDeal lost (status: LOST, lostReason filled in).crm:read
project_task.createdNew task (or sub-task) — in the application or through the API.projects:read
project_task.completedTask completed: entered a column of category DONE (board, task page, API). previous.category gives the category left.projects:read
project_timesheet.approvedTimesheet 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

HTTP
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", … }}
FieldMeaning
idevent identifier — the same on every attempt and every redelivery: your deduplication key (also in X-QuoSuite-Delivery)
typeevent type (also in X-QuoSuite-Event, to route without reading the body)
apiVersionversion whose shape data follows (v1)
createdAtinstant of the fact, not of the delivery
previousvalues before the change (status…)
datathe 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

Texte
X-QuoSuite-Signature: t=<unix timestamp>,v1=<hex>[,v1=<hex>]
v1 = HEX( HMAC-SHA256( receiving endpoint secret, "<t>.<raw body>" ) )
  1. Read the raw body, byte for byte, before any JSON.parse / json_decode: re-encoded JSON does not verify.
  2. Extract t and the v1 values.
  3. Refuse if |now − t| > 300 seconds — protection against replay.
  4. Compute HMAC-SHA256(secret, t + "." + raw body) in hexadecimal.
  5. Compare in constant time against each v1: one match is enough.
  6. 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 2xx within 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 (3xx included), a refused connection, an invalid certificate or a timeout is a failure: new attempt.
  • 410 Gone means “this address no longer exists”: the receiving endpoint is disabled at once.
  • 429 or 503 with Retry-After: the next attempt waits at least that long.

6. Retries

AttemptDelay after the previous one (±10 %)
1immediate
21 min
35 min
430 min
52 h
66 h
712 h
824 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:

GET/webhooks/deliveries

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.