Use case 03 · Payment sync

Record payments and keep paid status in sync

When your product captures a payment, AccountingKit records it against the open invoice in your customer’s accounting system. When a payment happens somewhere else, such as a bank transfer the bookkeeper records, you get a signed event. Your product and the ledger stay in agreement about what has been paid.

How it works

  1. Trigger

    A payment is captured in your product

    You know the invoice it belongs to, the amount, and the date the money arrived.

  2. Write

    Record the payment

    Send the invoice ID, the account the money landed in, the amount, and the date, with an Idempotency-Key.

    POST /v1/connections/{id}/payments
  3. Sync

    Hear about payments made elsewhere

    When a payment is recorded directly in the accounting system, AccountingKit reads the live invoice and sends you the change.

    invoice.payment_changed
  4. Act

    Drive reminders from due dates

    Due-date events fire once each, so your reminder logic does not need to poll or keep its own schedule.

    invoice.due_soon · invoice.overdue

Who builds this

  • Payment and checkout products that collect money against invoices.
  • Accounts receivable and collections tools that chase unpaid invoices.
  • Any platform that shows an invoice status and needs it to match the customer’s books.

The request

This records a payment against an invoice in the ledger. It does not move money. FreshBooks and Wave accept a payment method under provider_options.

curl --request POST "https://api.accountingkit.dev/v1/connections/$CONNECTION_ID/payments" \
  --header "Authorization: Bearer $ACCOUNTINGKIT_API_KEY" \
  --header "Idempotency-Key: payment-charge-7731" \
  --header "Content-Type: application/json" \
  --data '{
    "external_reference": "charge_7731",
    "invoice_id": "8b1d2a4e-6f3c-4d2a-9b7e-0c5f1a2d3e4f",
    "account_id": "bank-account-id",
    "amount": 1200,
    "date": "2026-11-27"
  }'

Events you receive

Events are signed. Verify the AccountingKit-Signature header against the raw body before you parse it, and deduplicate on the event ID.

EventWhen it is sent
invoice.payment_changedThe amount paid, amount due, or status differs from the last known state.
invoice.paidThe invoice moved from any unpaid state to paid.
invoice.due_soonSent once when an unpaid invoice is within 3 days of its due date.
invoice.overdueSent once after the due date passes unpaid.

Coverage by accounting system

Payment writes work on five systems. Sage Intacct payments are read only, so there you can read payment state but not record a payment.

CapabilityXeroQuickBooksNetSuiteSage IntacctFreshBooksWave
PaymentsRead and writeRead and writeRead and writeRead onlyRead and writeRead and write
InvoicesRead and writeRead and writeRead and writeRead and writeRead and writeRead and write
AccountsRead onlyRead onlyRead onlyRead onlyNot availableRead only
Provider webhooksYesYesNot availableNot availableYesYes

When something goes wrong

Your payment webhook fires twice

Use your charge ID as the Idempotency-Key. The second request returns the first result, and the payment is recorded once.

The invoice changed since you last read it

Read the invoice live before a write that depends on its current state. A write the provider refuses comes back as an error with a stable code, not a silent success.

A provider webhook never arrives

Hourly invoice reconciliation compares live payment state and sends the same events, so a missed notification is caught on the next pass.

Your endpoint was down

Webhook delivery is retried. After you fix the endpoint, replay a failed delivery with a reason, and the original attempt history is kept.

Limits to know first

  • This applies payments to invoices. Bank feeds, bank transactions, and bank reconciliation are not part of the API.
  • Sage Intacct payments are read only.
  • Writes and synchronization need a cached connection. Zero-retention connections support live reads only, so they cannot create records or send payment and due-date events.

Common questions

Does recording a payment move money?

No. It records in the accounting system that an invoice was paid, with the amount, date, and the account the money landed in. Collecting the money stays with your payment provider.

How do I learn about payments recorded outside my product?

Subscribe to invoice.payment_changed and invoice.paid. When someone records a payment directly in the accounting system, AccountingKit reads the live invoice and sends a signed event with the new payment state.

Which accounting systems accept payment writes?

Xero, QuickBooks Online, NetSuite, FreshBooks, and Wave accept payment writes. Sage Intacct payments are read only.

How do I verify a webhook really came from AccountingKit?

Each delivery carries an AccountingKit-Signature header with a timestamp and an HMAC of the exact raw body. Verify it with your signing secret before parsing the JSON. The Node SDK does this in constructWebhookEvent and rejects events outside a five-minute window.

Keep reading