Skip to Content
AccountingKitDocs
Integrations

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.

Available

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

AreaSupport
AuthenticationFreshBooks OAuth 2.0, /users/me business discovery, single-use rotating refresh tokens
ReadsCached lists, live point reads, and exact live search
WritesNormalized contacts, invoices, and payments
Read-only resourcesOrganizations (businesses) and tax rates
SynchronizationFull sync, day-overlap incremental sync (updated_min), and hourly invoice reconciliation
WebhooksCallback verifier handshake + X-FreshBooks-Hmac-SHA256 verification, followed by a live read
CancellationInvoice soft deletion (vis_state: 1) through the shared cancel endpoint

Supported resources and operations

ResourceFreshBooks resourceListGetCreateUpdateNotes
Organizations/users/me✓✓——Active business memberships with an account_id
Contactsusers/clients✓✓✓✓FreshBooks clients (canonical customers)
Invoicesinvoices/invoices✓✓✓✓Always read with include[]=lines; cancel = delete
Paymentspayments/payments✓✓✓—Allocations link to invoices; vis_state=1 = deleted
Tax ratestaxes/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_data writes;
  • invoice.download_pdf, invoice.get_online_url, and organization.get_deep_link provider 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:read
  • user:clients:read and user:clients:write
  • user:invoices:read and user:invoices:write
  • user:payments:read and user:payments:write
  • user: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/callback

Register 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 eventWhat AccountingKit does
invoice.create, invoice.update, invoice.delete, invoice.sendByEmailReads the invoice live (include[]=lines) and runs the invoice lifecycle pipeline
payment.create, payment.update, payment.deleteReads the payment, then reconciles the linked invoice
client.*, tax.*, othersRecorded as ignored and reconciled by incremental sync

Writing contacts, invoices, and payments

  • Contacts (users/clients): external_reference is stored in client.note, tax_number in vat_number, phone in bus_phone, po_box addresses in p_*, and street addresses in s_*. FreshBooks does not filter on note, so live contact search uses name or status.
  • Invoices (invoices/invoices): external_reference is stored in po_number. Because FreshBooks computes due_date from create_date + due_offset_days, AccountingKit calculates due_offset_days automatically from issue_date and due_date. New invoices default to draft; pass "status": "authorised" to mark the invoice as sent (action_mark_as_sent: true). Updates replace the invoice's full lines array. Per-line discount_rate and account_code are rejected with 400.
  • Payments (payments/payments): external_reference is stored in payment.note. Pass provider_options.freshbooks.payment_type (for example "Bank Transfer", "Check", "Cash", "Credit Card", or "Other"; defaults to "Other"). FreshBooks has no payment exchange rate field, so currency_rate is rejected with 400.
  • Cancellation: POST /v1/connections/:connection_id/invoices/:resource_id/cancel sets vis_state: 1 on unpaid invoices and returns "cancellation_status": "deleted". Invoices with applied payments return 409.

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] accepts YYYY-MM-DD dates without time or timezone precision. AccountingKit subtracts one full day as an overlap window and deduplicates records on provider_updated_at.
  • Pagination cap. FreshBooks silently caps per_page at 100; AccountingKit pages through collections transparently using page and pages.
  • Visibility state (vis_state). Normal PUT updates never send vis_state, preventing accidental state transitions. Deleted invoices and payments (vis_state=1) normalize to status: "deleted".

On this page