Skip to Content
AccountingKitDocs

Webhooks

Receive signed AccountingKit events for connections, syncs, invoices, and automations, verify their signatures, and configure inbound Xero, QuickBooks Online, FreshBooks, and Wave callbacks.

Customer webhooks

Register an HTTPS destination through POST /v1/webhook-endpoints with one or more event types:

  • connection.created
  • connection.updated
  • connection.disconnected
  • sync.completed
  • invoice.updated
  • invoice.payment_changed
  • invoice.paid
  • invoice.due_soon
  • invoice.overdue
  • quote.updated
  • quote.status_changed
  • automation.succeeded
  • automation.failed

The response includes a signing secret once. Store it in your secret manager.

invoice.due_soon fires once when an unpaid invoice is within 3 days of its due date, and invoice.overdue fires once after its due date passes. quote.updated and quote.status_changed are emitted during quote reconciliation ({"scope": "quotes"}, {"scope": "all"}, and scheduled reconciliation) whenever a quote changes or transitions status (for example sent → accepted or declined).

Deliveries include the event ID, event type, creation time, environment, and data. Verify the HMAC signature against the exact raw request body before parsing JSON. Deduplicate on event ID and return a successful response quickly; webhook delivery is retried as a durable operation.

The signature is sent in AccountingKit-Signature as t=<unix-seconds>,v1=<hex-hmac>. The signed message is <timestamp>.<exact-raw-body>. AccountingKit-Event carries the event ID. The Node SDK provides constructWebhookEvent(rawBody, signature, signingSecret), which performs constant-time signature comparison, rejects payloads outside a five-minute replay window, and validates the event envelope before returning it.

Xero webhooks

For a customer-owned Xero app, configure the callback URL shown in the console:

POST /webhooks/xero/{provider_app_id}

The opaque path identifies the registered app, allowing AccountingKit to load its encrypted webhook key before parsing or trusting the request body. The hosted AccountingKit app retains POST /webhooks/xero. Both routes validate X-Xero-Signature before persisting any event. The receiver stores the minimal parsed event and its operation/outbox record in one transaction; it never stores the raw webhook body and acknowledges without waiting for a Xero API call.

Invoice events enqueue a targeted live invoice read and emit invoice.updated with a constrained, provider-neutral payment snapshot. When the live amount paid, amount due, or status differs from the previously cached invoice, AccountingKit also emits invoice.payment_changed. A transition from any non-paid state to paid emits invoice.paid. Consumers can therefore update operational paid fields and alerts without guessing from the original Xero notification. Other supported Xero categories currently enqueue a full connection sync. The webhook payload is a change notification; the subsequent Xero read remains the source of truth. Event IDs, sequence cursors, and gaps are scoped to the Xero app. A gap queues reconciliation only for active connections created with that app.

The same invoice pipeline runs on an hourly safety-net schedule and through POST /v1/connections/:connection_id/sync. This catches provider events that never arrived while preserving the same event identity, payment state comparison, signed delivery, and PDF refresh contract.

Every invoice event includes document.refresh_required, the invoice.download_pdf provider action, both AccountingKit and Xero invoice IDs, and a provider revision. Consumers that cache a rendered invoice must replace that snapshot before presenting or sending it; the original PDF is not a timeless representation of a mutable Xero invoice.

QuickBooks Online webhooks

For a customer-owned Intuit app, configure the webhook URL shown in the console on the Intuit webhooks page for the matching key set: Development for a test provider app, Production for a live one. Intuit keeps the two configurations separate.

POST /webhooks/quickbooks-online/{provider_app_id}

Enable the Invoice, Payment, Customer, Vendor, Account, and PurchaseOrder entities. Intuit sends a JSON array of CloudEvents and signs the exact body with intuit-signature, a Base64 HMAC-SHA256 keyed with the app's verifier token. AccountingKit checks that signature against the raw bytes before parsing, persists the parsed events with their operations, and answers within Intuit's 3-second limit without calling the QuickBooks API inline.

One delivery can carry events for several companies; each is routed by the provider app and the company's realmId, and an event for a company with no active connection is recorded and ignored. Invoice events and the invoices paid by a Payment event go through the same invoice pipeline as Xero, so they reach you as invoice.updated, invoice.payment_changed, and invoice.paid. Intuit guarantees neither order nor delivery, and has no sequence number to detect gaps, so the hourly invoice reconciliation and explicit syncs recover anything missed through incremental reads.

The payload format, signature check, retry schedule, and event mapping are documented in full on the QuickBooks Online integration page.

FreshBooks webhooks

For a customer-owned FreshBooks app, register callbacks through the FreshBooks Events Callbacks API pointing to the app-specific URL shown in the console:

POST /webhooks/freshbooks/{provider_app_id}

FreshBooks delivers form-urlencoded notifications signed in X-FreshBooks-Hmac-SHA256 using Base64 HMAC-SHA256 over the Python json.dumps(request.form) serialization keyed by the callback's verifier. AccountingKit rejects duplicate form keys, checks the signature in constant time before decoding, deduplicates per (provider_app_id, event_id), and routes each event by provider app and account_id. invoice.* events queue sync:invoice and payment.* events queue sync:payment, reconciling invoices through the same pipeline as Xero and QuickBooks Online. See the FreshBooks integration page for full callback verification details.

Wave webhooks

For a customer-owned Wave app, configure the webhook URL shown in the console in your Wave application's webhook settings:

POST /webhooks/wave/{provider_app_id}

Wave signs every delivery with x-wave-signature (t=<unix>,v1=<hex>) and x-wave-timestamp, computing HMAC-SHA256(secret, timestamp + '.' + rawBody) over the exact raw request bytes. AccountingKit verifies the signature in constant time, enforces Wave's five-minute replay window, persists the deduplicated event in wave_webhook_events, and acknowledges immediately without calling Wave inline.

Active invoice events (invoice.created, invoice.updated, invoice.sent, invoice.paid, invoice.payment.*) encode Wave's raw business and invoice IDs into GraphQL global IDs and queue the same live invoice pipeline used by Xero and QuickBooks Online, emitting invoice.updated, invoice.payment_changed, and invoice.paid. invoice.deleted marks the cached invoice deleted atomically in the same transaction; estimate.*, checkout.*, and events for unknown or inactive businesses are recorded and ignored; hourly reconciliation catches any missed changes.

See the Wave integration page for signature verification and event handling details.

Delivery operations

Each outbound delivery has persisted attempts, response status, response body excerpt, next attempt, and terminal state. Operators can correlate a delivery with its operation and request ID without exposing signing secrets or accounting payloads in logs.

After correcting the destination, requeue a terminal delivery with POST /v1/webhook-deliveries/:delivery_id/replay, an Idempotency-Key, and a non-empty reason. The original delivery and attempt history remain intact.

On this page