FreshBooks
FreshBooks API integration with verified webhooks: OAuth 2.0 with single-use rotating refresh tokens, business/account discovery, canonical invoices, payments, contacts, taxes, and sync.
Organizations, contacts, invoices, payments, and tax rates for every connected FreshBooks
business, with verified FreshBooks webhooks.
Register your own FreshBooks app in the console, then create a connect session with
freshbooks.
FreshBooks runs behind the same public API as every other provider. A FreshBooks invoice, payment, contact, or tax rate has the same normalized shape as its Xero and QuickBooks Online equivalents, writes accept the same canonical bodies, and FreshBooks callbacks arrive at your endpoint as the same signed AccountingKit events.
Capability summary
| Area | Support |
|---|---|
| Authentication | FreshBooks OAuth 2.0, /users/me business discovery, single-use rotating refresh tokens |
| Reads | Cached lists, live point reads, and exact live search |
| Writes | Normalized contacts, invoices, and payments |
| Read-only resources | Organizations (businesses) and tax rates |
| Synchronization | Full sync, day-overlap incremental sync (updated_min), and hourly invoice reconciliation |
| Webhooks | Callback verifier handshake + X-FreshBooks-Hmac-SHA256 verification, followed by a live read |
| Cancellation | Invoice soft deletion (vis_state: 1) through the shared cancel endpoint |
Supported resources and operations
| Resource | FreshBooks resource | List | Get | Create | Update | Notes |
|---|---|---|---|---|---|---|
| Organizations | /users/me | ✓ | ✓ | — | — | Active business memberships with an account_id |
| Contacts | users/clients | ✓ | ✓ | ✓ | ✓ | FreshBooks clients (canonical customers) |
| Invoices | invoices/invoices | ✓ | ✓ | ✓ | ✓ | Always read with include[]=lines; cancel = delete |
| Payments | payments/payments | ✓ | ✓ | ✓ | — | Allocations link to invoices; vis_state=1 = deleted |
| Tax rates | taxes/taxes | ✓ | ✓ | — | — | Exact decimal percentage strings preserved |
A FreshBooks user may hold client-only memberships that have no account_id. AccountingKit filters
those memberships out during OAuth discovery so only real accounting businesses can be connected.
Not supported in this release
These resources and features report provider_unsupported in the connection capability manifest,
and a request for them returns 400:
- chart of accounts (
accounts) — FreshBooks does not expose a CRUD chart-of-accounts endpoint; - purchase orders, quotes, credit notes, overpayments, prepayments, and branding themes;
- Profit and Loss reports (
GET /reports/profit-and-loss); - provider-native
provider_datawrites; invoice.download_pdf,invoice.get_online_url, andorganization.get_deep_linkprovider actions (FreshBooks' REST API does not expose a public binary PDF download or share-link endpoint).
Set up your own FreshBooks app
Every connection runs through a FreshBooks OAuth app your organization registers and owns. AccountingKit encrypts its credentials and operates OAuth, single-use refresh token rotation, webhooks, and durable operations for it.
Create the provider app draft
In the console, choose Test or Live, open Provider apps, and add FreshBooks. AccountingKit creates a resumable draft and shows the exact OAuth redirect URI and webhook URL for it.
Create the FreshBooks developer app
On the FreshBooks Developer Portal, create an application and enable these OAuth scopes (FreshBooks scopes are configured on the app rather than passed on the authorize URL):
user:profile:readuser:clients:readanduser:clients:writeuser:invoices:readanduser:invoices:writeuser:payments:readanduser:payments:writeuser:taxes:read
Add the redirect URI
Add the exact OAuth redirect URI shown in the console to your FreshBooks application settings:
https://api.accountingkit.dev/connect/freshbooks/callbackRegister and verify webhook callbacks
FreshBooks registers webhooks per accounting account through the Events Callbacks API
(POST /events/account/{account_id}/events/callbacks) pointing to the app-specific URL shown in
the console:
https://api.accountingkit.dev/webhooks/freshbooks/{provider_app_id}Subscribe to invoice.create, invoice.update, invoice.delete, invoice.sendByEmail,
payment.create, payment.update, payment.delete, client.create, client.update,
client.delete, tax.create, tax.update, and tax.delete. Complete the callback
verification PUT with the verifier FreshBooks issues and keep that verifier string — it is
your HMAC signing secret.
Store the credentials
Paste the Client ID, Client Secret, and webhook verifier into the console. They are encrypted before persistence and never returned. Then authorize a FreshBooks business and select Check setup: the first authorization proves OAuth and scopes, and a verified callback or signed event proves webhook delivery.
Connect a business
Create a connect session with "provider": "freshbooks" and open the returned connect_url:
curl --request POST "https://api.accountingkit.dev/v1/connect-sessions" \
--header "Authorization: Bearer $ACCOUNTINGKIT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"provider": "freshbooks",
"external_account_id": "customer_123",
"redirect_uri": "https://app.example.com/integrations/freshbooks/complete",
"provider_app_id": "the-app-id-from-the-console",
"retention_mode": "cached"
}'After OAuth completes, AccountingKit calls /auth/api/v1/users/me to discover the user's active
FreshBooks accounting businesses (account_id). If the user belongs to more than one business, the
hosted flow prompts them to choose one before the connection becomes active.
FreshBooks webhooks
FreshBooks delivers webhook notifications as application/x-www-form-urlencoded POST requests
containing name, object_id, account_id, business_id, and identity_id (or user_id).
Signature verification (X-FreshBooks-Hmac-SHA256)
FreshBooks signs the form parameters serialized like Python's json.dumps(request.form) — all
values cast to strings, with a single space after every colon and comma ({"key": "value", ...}) —
keyed with the callback's verifier secret, base64-encoded in X-FreshBooks-Hmac-SHA256.
AccountingKit canonicalizes the form parameters (rejecting duplicate keys as ambiguous), verifies
the signature in constant time, deduplicates per (provider_app_id, event_id), and routes each
event in SQL by provider app and account_id.
Callback verification challenges (callback.verify / verification) carrying the configured
verifier are acknowledged with 200 and mark the provider app's webhook check as verified.
Event routing
| FreshBooks event | What AccountingKit does |
|---|---|
invoice.create, invoice.update, invoice.delete, invoice.sendByEmail | Reads the invoice live (include[]=lines) and runs the invoice lifecycle pipeline |
payment.create, payment.update, payment.delete | Reads the payment, then reconciles the linked invoice |
client.*, tax.*, others | Recorded as ignored and reconciled by incremental sync |
Writing contacts, invoices, and payments
- Contacts (
users/clients):external_referenceis stored inclient.note,tax_numberinvat_number,phoneinbus_phone,po_boxaddresses inp_*, andstreetaddresses ins_*. FreshBooks does not filter onnote, so live contact search usesnameorstatus. - Invoices (
invoices/invoices):external_referenceis stored inpo_number. Because FreshBooks computesdue_datefromcreate_date+due_offset_days, AccountingKit calculatesdue_offset_daysautomatically fromissue_dateanddue_date. New invoices default todraft; pass"status": "authorised"to mark the invoice as sent (action_mark_as_sent: true). Updates replace the invoice's fulllinesarray. Per-linediscount_rateandaccount_codeare rejected with400. - Payments (
payments/payments):external_referenceis stored inpayment.note. Passprovider_options.freshbooks.payment_type(for example"Bank Transfer","Check","Cash","Credit Card", or"Other"; defaults to"Other"). FreshBooks has no payment exchange rate field, socurrency_rateis rejected with400. - Cancellation:
POST /v1/connections/:connection_id/invoices/:resource_id/cancelsetsvis_state: 1on unpaid invoices and returns"cancellation_status": "deleted". Invoices with applied payments return409.
Limitations and FreshBooks facts
- Single-use rotating refresh tokens. FreshBooks invalidates the prior refresh token on every
refresh. AccountingKit serializes refreshes behind a per-connection lock, persists each new token
atomically before returning it, and rejects any refresh response that omits a replacement
refresh_token. - Day-granularity incremental sync. FreshBooks'
search[updated_min]acceptsYYYY-MM-DDdates without time or timezone precision. AccountingKit subtracts one full day as an overlap window and deduplicates records onprovider_updated_at. - Pagination cap. FreshBooks silently caps
per_pageat100; AccountingKit pages through collections transparently usingpageandpages. - Visibility state (
vis_state). NormalPUTupdates never sendvis_state, preventing accidental state transitions. Deleted invoices and payments (vis_state=1) normalize tostatus: "deleted".
Oracle NetSuite
Oracle NetSuite integration via SuiteTalk REST Web Services v1 and SuiteQL: OAuth 2.0 with PKCE, account-specific domains, subsidiary discovery, idempotent writes, and incremental sync.
Wave
Wave accounting API integration over GraphQL: seven resource families, OAuth 2.0 with Pro plan eligibility, invoice PDF/online URL/cancellation, and verified x-wave-signature webhooks.