Skip to content

Postman docs › Webhooks › Webhooks to Odoo

Webhooks to Odoo ​

QBO Connect informs the Odoo module of changes by sending signed POST requests to the instance's callback_url. It sends one in each of these cases:

  • records changed in a connected QuickBooks company;
  • a connection must be resynchronised;
  • a connection needs reauthorisation or was disconnected.

A webhook only says what changed. It never carries accounting data, tokens or secrets. Odoo reads the data itself, through the QuickBooks API proxy.

Webhooks are not Postman requests: QBO Connect sends them and Odoo receives them. The collection has one related request, Confirm resync.

How a QuickBooks change reaches Odoo

  1. A record changes in QuickBooks. Intuit notifies QBO Connect. One Intuit notification can hold events of several companies.
  2. QBO Connect checks Intuit's signature and stores each event once, by Intuit's event id, so Intuit's retries are dropped. It then answers Intuit at once.
  3. A queue worker takes every connection to the company (realm_id). It skips connections that are disconnected or belong to the other QuickBooks environment.
    • If the customer may receive changes, it creates one qbo.entities_changed webhook for the connection.
    • If a restriction applies, it creates no webhook and marks the connection for a resync.
  4. QBO Connect checks the restrictions again before every attempt, including retries.
  5. Odoo checks the signature, stores the webhook and answers 2xx. Later it reads the changed records through the proxy.

Business rules

  • Webhooks go only to the callback_url given in Register an instance.
    • It must have the same scheme, host and port as base_url.
    • QBO Connect checks it again before every attempt.
  • An instance without a callback_url gets no webhooks, and QBO Connect records nothing for it.
  • Redirects are not followed. A 3xx answer counts as a failure.
  • One webhook can carry several changes. Their order is not guaranteed, and neither is Intuit's: sort by occurred_at.

The webhook request ​

Every webhook is a POST with a JSON body, signed with the instance secret.

Headers

HeaderValue
X-QBO-EventThe event type, the same as event in the body.
X-QBO-DeliveryThe webhook id: whd_ + 26 characters, the same as id in the body. Retries of a webhook keep its id.
X-QBO-TimestampUnix time in seconds when this attempt was sent. Each attempt has a new one.
X-QBO-Signaturev1= + hex HMAC-SHA256 of X-QBO-Timestamp + . + the raw body, keyed with the instance secret.
Content-Typeapplication/json
User-AgentQBO-Connect/ + QBO Connect's version

Body

Every body is a JSON object. It starts with three attributes that all events share, followed by the event's own attributes.

AttributeTypeDescription
idStringThe webhook id, as in X-QBO-Delivery.
eventStringThe event type, as in X-QBO-Event.
occurred_atString (ISO 8601)When QBO Connect created the webhook. Retries keep it. When a QuickBooks record changed is in events[].occurred_at.

Event types

eventSent when
qbo.entities_changedRecords changed in the QuickBooks company.
qbo.sync_requiredChanges could not be forwarded and Odoo must resynchronise the connection.
connection.reauth_requiredQuickBooks no longer accepts the connection's tokens.
connection.disconnectedThe connection was disconnected without the instance asking for it.

Answer 2xx to event types you do not handle, and ignore them. New types may be added.

The bodies below are formatted for reading. QBO Connect sends compact JSON, and the signature covers those exact bytes.

The attribute order is not fixed. The samples show the order QBO Connect sends today: MySQL stores each payload as JSON and reorders its keys. Read attributes by name, never by position.

Request
Request URLPOST{callback_url}
Sent byQBO Connect
Content typeapplication/json
AuthenticationX-QBO-Signature, keyed with the instance secret (see Verify the signature)
Timeout10 seconds

Verify the signature ​

Check every webhook before you use it:

  1. Read the raw body bytes before parsing the JSON.
    • Do not parse and serialise the JSON again before checking: the result can differ from the bytes that were signed. For example, QBO Connect writes / as \/.
  2. Reject the request if X-QBO-Timestamp is more than 300 seconds from your clock. This also stops replays.
  3. Compute "v1=" + hex(HMAC_SHA256(key = instance secret, message = X-QBO-Timestamp + "." + raw body)).
  4. Compare it with X-QBO-Signature in constant time.

If the check fails, answer 401 and do nothing else. A wrong instance secret makes every webhook fail. After a rotation, store the new secret before the next webhook arrives.

Python

The function needs only the standard library and works with any Python 3 used by Odoo:

python
import hashlib
import hmac
import time

MAX_SKEW_SECONDS = 300


def verify_qbo_connect_webhook(secret, headers, raw_body, now=None):
    """True when QBO Connect signed this request with the instance secret.

    headers:  the request headers (a case-insensitive mapping, such as Odoo's request.httprequest.headers)
    raw_body: the exact bytes received (bytes); never parse and re-serialise the JSON before checking
    """
    timestamp = headers.get("X-QBO-Timestamp", "")
    signature = headers.get("X-QBO-Signature", "")
    try:
        sent_at = int(timestamp)
    except ValueError:
        return False
    current = time.time() if now is None else now
    if abs(current - sent_at) > MAX_SKEW_SECONDS:
        return False  # too old or too far in the future: a replay, or the server clock is wrong
    message = timestamp.encode() + b"." + raw_body
    expected = "v1=" + hmac.new(secret.encode(), message, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected.encode(), signature.encode())

The function compares bytes, not str, because hmac.compare_digest raises TypeError on a str that contains non-ASCII characters. A crafted header could then turn the check into a server error.

In an Odoo controller, the route is the path of the callback_url the module registered. The Odoo module uses /quickbook_online_connector/webhook. The sketch below shows the order of the steps; storing and processing the webhooks is up to the module:

python
from odoo import http
from odoo.http import Response, request


class QboConnectWebhookController(http.Controller):

    @http.route("/quickbook_online_connector/webhook", type="http", auth="public", methods=["POST"], csrf=False)
    def qbo_connect_webhook(self, **kwargs):
        raw_body = request.httprequest.get_data()  # the exact bytes; parse the JSON only after the check
        headers = request.httprequest.headers
        secret = load_instance_secret(request.env)  # wherever the module keeps it; never log it
        if not verify_qbo_connect_webhook(secret, headers, raw_body):
            return Response(status=401)
        # Store X-QBO-Delivery, X-QBO-Event and the body, unless that delivery id is already stored
        # (for qbo.sync_required, keep the newest body instead). A scheduled action processes them later.
        return Response(status=204)

A standalone receiver can read the secret from the environment, for example os.environ["QBO_CONNECT_INSTANCE_SECRET"]. Never put the secret in code or logs.

Test values

Your verification should accept this request when now is the timestamp:

InputValue
Instance secretdocs-example-secret
X-QBO-Timestamp1796205605
Raw bodyThe line below: 245 bytes, no line break at the end
X-QBO-Signaturev1=80b9956da50815e670c76b4eb99a919cfd30af7ef0af99dfb0923ac6a1642256
json
{"id":"whd_01kbx9q3m5n7p9r1s3t5v7w9y1","event":"connection.reauth_required","occurred_at":"2026-12-02T10:00:00Z","reason":"invalid_grant","status":"reauth_required","realm_id":"9341455012345678","connection_id":"conn_01kbx7a2c9d4e6f8g0h1j3k5m7"}

Respond and retries ​

  • Answer 2xx within 10 seconds. Store the webhook and process it later. Any other status, a redirect, or no answer within 10 seconds counts as a failure.
  • Deduplicate. A webhook is retried after a failure, including when Odoo processed it but answered too late. A repeated X-QBO-Delivery is a webhook you already have: answer 2xx and skip it. The exception is qbo.sync_required, where a retry carries the latest count (see below).
  • Retries. After a failure QBO Connect tries again, at most 8 attempts in all:
AttemptSent
1When the webhook is created (within seconds, from the queue)
210 seconds after attempt 1 failed
330 seconds after attempt 2 failed
42 minutes after attempt 3 failed
55 minutes after attempt 4 failed
615 minutes after attempt 5 failed
730 minutes after attempt 6 failed
860 minutes after attempt 7 failed
  • Checked again before each attempt. QBO Connect checks the restrictions, the connection and the callback_url again before every attempt, including retries. A webhook that may no longer be sent is cancelled, and no further attempt is made.
  • When all attempts fail. The webhook is marked failed. Changes in a failed qbo.entities_changed are not lost: the connection is marked for a resync (reason delivery_failed), and Odoo later gets qbo.sync_required.
  • Lost queue jobs. If a queue job is lost, for example because a worker crashed, QBO Connect queues the webhook again within about 15 minutes. The webhook keeps its id.

Restrictions ​

Before it forwards changes, and again before every attempt, QBO Connect checks that the customer may still receive them. Each restriction has the same error code that the QuickBooks API proxy returns in that situation. There is no point telling Odoo about changes it is not allowed to read.

ReasonWhen
instance_suspendedWebkul suspended the instance.
license_inactiveThe licence is not active: expired, cancelled, suspended or revoked, or its end date has passed.
connection_reauth_requiredThe connection needs reauthorisation.
quota_exceededThe licence has used its monthly QuickBooks API quota.

While a restriction applies:

  • Odoo gets no qbo.entities_changed for the connection.
  • QBO Connect marks the connection for a resync. It counts the missed changes and keeps the time of the earliest one.
  • connection.* webhooks are still sent. They concern the connection itself, not QuickBooks data.

Forwarding a webhook uses no API quota. Under quota_exceeded, changes are held back only because Odoo could not read the changed records anyway.

qbo.entities_changed ​

Records changed in the QuickBooks company of the connection.

AttributeTypeDescription
connection_idStringThe connection the changes belong to (conn_…).
realm_idStringThe QuickBooks company id.
eventsArrayThe changes, in no particular order.
events[].event_idStringIntuit's event id. Events in Intuit's older format have no id, so QBO Connect makes one: legacy- + 40 hex characters.
events[].entityStringThe entity name from Intuit, in lower case: invoice, customer, item, payment, salesreceipt, …
events[].entity_idStringThe record's QuickBooks id. Keep it as a string: Intuit ids can have leading zeros.
events[].operationStringThe operation from Intuit, in lower case. See below.
events[].occurred_atString (ISO 8601) or nullWhen the change happened, as Intuit reports it. The precision varies from seconds to nanoseconds.
events[].deleted_idString or nullMerges only: the id of the record that was merged into entity_id and no longer exists.

Operations

  • Intuit's webhooks can report Create, Update, Delete, Merge, Void and Emailed. Not every operation exists for every entity.
  • Intuit's documentation confirms the names created, updated and merged. It does not yet confirm the names for delete, void and emailed (likely deleted, voided and emailed).
  • Intuit's older format sends create, update, merge, and so on.

QBO Connect passes the operation on unchanged, in lower case. Treat it as a hint, and do not fail on a name you do not know. Which entities arrive depends on the webhook subscriptions of Webkul's Intuit app.

Example

The body below shows an invoice update, a customer merge, a new item and a new payment:

json
{
  "id": "whd_01kbx9t5v7w9y1a3c5e7g9j1m3",
  "event": "qbo.entities_changed",
  "occurred_at": "2026-12-02T10:00:03Z",
  "events": [
    {
      "entity": "invoice",
      "event_id": "5c0a8f3e-2d41-4b7a-9e6f-1a2b3c4d5e6f",
      "entity_id": "145",
      "operation": "updated",
      "deleted_id": null,
      "occurred_at": "2026-12-02T09:59:41Z"
    },
    {
      "entity": "customer",
      "event_id": "0e4f6a8c-1b3d-4e5f-8a9b-2c4d6e8f0a1b",
      "entity_id": "123",
      "operation": "merged",
      "deleted_id": "27",
      "occurred_at": "2026-12-02T09:59:44Z"
    },
    {
      "entity": "item",
      "event_id": "7a9c1e3f-5b7d-4f9a-8c2e-4a6c8e0b2d4f",
      "entity_id": "38",
      "operation": "created",
      "deleted_id": null,
      "occurred_at": "2026-12-02T09:59:50.512Z"
    },
    {
      "entity": "payment",
      "event_id": "3d5f7b9e-1a2c-4b6d-9e8f-0a1c3e5b7d9f",
      "entity_id": "212",
      "operation": "created",
      "deleted_id": null,
      "occurred_at": "2026-12-02T09:59:58Z"
    }
  ],
  "realm_id": "9341455012345678",
  "connection_id": "conn_01kbx7a2c9d4e6f8g0h1j3k5m7"
}

What Odoo does

  1. Check the signature, store the webhook and answer 2xx.
  2. Skip any event_id you have already processed. Reading a record twice is harmless.
  3. Read each changed record through the proxy, for example Read an invoice for invoice 145. Take the data from QuickBooks: the webhook only says that something changed. If several changes concern one record, sort them by occurred_at.
  4. For merged, move Odoo's links from the record deleted_id to entity_id, then read entity_id.
  5. To find deleted records, use CDC. It returns them with "status": "Deleted".
  6. Keep the time of your last successful sync for each connection. A resync starts from it.

qbo.sync_required ​

QBO Connect could not forward some changes of a connection. Odoo must resynchronise the connection from since.

When the connection is marked

  • Changes arrived while a restriction applied.
  • A qbo.entities_changed webhook failed all its attempts, or could not be sent at all, for example because the callback_url is no longer allowed. The reason is delivery_failed.

When the notice is sent

  • QBO Connect sends the notice once the connection is active and no restriction applies. It checks every 5 minutes.
  • Each connection has at most one notice on its way at a time.
  • If a notice fails all its attempts, the next one is sent 6 hours later.
  • If more changes are missed after a notice was delivered, Odoo gets a new notice with the higher count.
AttributeTypeDescription
connection_idStringThe connection to resynchronise (conn_…).
realm_idStringThe QuickBooks company id.
sinceString (ISO 8601)When the earliest missed change happened, in whole seconds. If Intuit sent no time, it is when QBO Connect recorded the change.
reasonStringWhy the most recent changes were missed: one of the restriction reasons, or delivery_failed.
missed_eventsIntegerHow many changes were missed since since. Send it back with Confirm resync.

Each attempt carries the current values, so a retry can show a higher missed_events than the first attempt.

Example

json
{
  "id": "whd_01kbxb2d4f6h8k0m2p4r6t8v0w",
  "event": "qbo.sync_required",
  "occurred_at": "2026-12-02T11:05:00Z",
  "since": "2026-12-01T08:14:09Z",
  "reason": "quota_exceeded",
  "realm_id": "9341455012345678",
  "connection_id": "conn_01kbx7a2c9d4e6f8g0h1j3k5m7",
  "missed_events": 17
}

What Odoo does

  1. Check the signature, store the notice and answer 2xx. Schedule one resync for the connection. If a resync is already scheduled, update it with the newest notice. Do not skip a notice because you have seen its X-QBO-Delivery.
  2. Resynchronise from the earlier of since and your own last successful sync for this connection:
    • If that time is within the last 30 days, use CDC.
      • CDC returns at most 1,000 objects per request, so use shorter windows when needed.
      • CDC does not cover JournalCode, TimeActivity, TaxAgency, TaxCode and TaxRate.
    • If it is older than 30 days, CDC cannot reach it: do a full reconciliation.
  3. When the resync is complete, send Confirm resync with the missed_events of the notice you acted on.
  4. If the response still contains sync_required, more changes were missed in the meantime. Resynchronise again and confirm the new count.

Answering the notice with 2xx does not clear anything. Only Confirm resync with the current count does.

Until then, the connection shows sync_required in List connections and Read a connection. Odoo can therefore also find a pending resync by reading its connections, for example when it starts or once a day.

connection.reauth_required and connection.disconnected ​

The connection's status changed. These webhooks are sent even while a restriction applies.

AttributeTypeDescription
connection_idStringThe connection (conn_…).
realm_idStringThe QuickBooks company id.
statusStringThe new status: reauth_required or disconnected.
reasonString or nullWhy it changed, as in the connection's status_reason. Examples: invalid_grant; revoked_by_support, purged_by_support, license_inactive, retention.
  • connection.reauth_required: QuickBooks no longer accepts the connection's tokens, for example after invalid_grant. Show Reconnect, which runs Start a reconnection.

  • connection.disconnected: the connection was disconnected without the instance asking for it:

    • Webkul support disconnected or purged it (revoked_by_support, purged_by_support);
    • it ended with the licence (license_inactive);
    • it needed reauthorisation for longer than the retention period (retention).

    QBO Connect sends none for the instance's own Disconnect.

Example

json
{
  "id": "whd_01kbx9q3m5n7p9r1s3t5v7w9y1",
  "event": "connection.reauth_required",
  "occurred_at": "2026-12-02T10:00:00Z",
  "reason": "invalid_grant",
  "status": "reauth_required",
  "realm_id": "9341455012345678",
  "connection_id": "conn_01kbx7a2c9d4e6f8g0h1j3k5m7"
}

Delivery status ​

Webkul staff see every webhook in the admin panel under Webhook deliveries, with its status and reason. Connections waiting for a resync are listed under Connections, with the filter Odoo must resync.

StatusMeaning
PendingWaiting for its next attempt.
DeliveredOdoo answered 2xx.
FailedAll attempts failed (http_<status>, connection_failed), or the webhook could not be sent (callback_url_not_allowed, secret_unavailable).
CancelledNot sent, on purpose. The reason is a restriction; connection_disconnected, connection_deleted or environment_mismatch; or, for a resync notice, sync_not_required, because the resync was already confirmed.

Responsibilities ​

QBO ConnectOdoo module
Receives Intuit's webhooks, checks Intuit's signature, stores each event once and answers Intuit.Registers a callback_url on the instance's own origin and answers 2xx within 10 seconds.
Checks the instance, licence, connection and quota before every attempt; holds back changes for restricted customers.Checks X-QBO-Signature and X-QBO-Timestamp; never logs the instance secret.
Signs each webhook; retries up to 8 attempts; requeues lost jobs.Deduplicates on X-QBO-Delivery and event_id; answers 2xx to unknown event types.
Sends references only: entity, id, operation, time.Reads the records through the proxy and maps them to Odoo; handles merges and deletions.
Marks a connection for a resync and sends qbo.sync_required once access is restored.Keeps its last successful sync time per connection; runs CDC or a full reconciliation.
Keeps the resync marker until Odoo confirms the current count.Sends Confirm resync after a complete resync, and resyncs again if sync_required remains.

Verification

  • Feature tests cover the behaviour on this page, with Intuit and Odoo MOCKED: tests/Feature/Webhooks and tests/Feature/Api/ConnectionsApiTest.php.
  • The headers and bodies on this page were compared on 2026-12-02 with requests captured from QBO Connect's own delivery code on MySQL (Odoo MOCKED). The Python function above verified each of them.
  • Duplicate notifications, parallel delivery workers and the queue order were tested with real parallel processes on MySQL and Redis: tests/Feature/Concurrency.
  • No Intuit sandbox webhook has been delivered end to end yet.
  • For local tests, mock Odoo checks and logs every webhook it receives.