ml-connector
FreshBooksCoupa

FreshBooks and Coupa integration

FreshBooks runs your invoicing and accounting. Coupa runs your procurement and vendor spend management. Connecting the two keeps your supplier master data, purchase orders, and bills in agreement. New suppliers created in Coupa appear in FreshBooks as bill vendors, and invoices from Coupa vendors sync into FreshBooks as bills without re-entry. Payment records flow both directions so your cash accounts stay reconciled.

How FreshBooks works

FreshBooks exposes clients, invoices, bills, bill vendors, payments, expenses, and chart of accounts through REST APIs at https://api.freshbooks.com using OAuth 2.0 user-delegated authorization (not client credentials). It does not support a shared base hostname; the API requires the account ID and business ID in the path. FreshBooks pushes invoice, bill, payment, and vendor events via webhooks to a registered endpoint with HMAC-SHA256 signature verification. Webhook delivery latency ranges from seconds to several minutes, and delivery is not guaranteed in real-time order. Purchase orders are not supported in FreshBooks.

How Coupa works

Coupa exposes suppliers, purchase orders, invoices, payments, and lookup values through REST APIs at a customer-specific instance URL using OAuth 2.0 client credentials. Coupa pushes supplier, purchase-order, invoice, and payment events via webhooks with HMAC-SHA256 signature verification. Webhooks are capped at 256 KB and Coupa enforces rate limits on 5xx and 429 responses with automatic backoff and retry up to 3 attempts. Multi-instance support (production and sandbox tenants per customer) is not yet implemented, so each customer maps to a single Coupa tenant.

What moves between them

Supplier master data flows from Coupa to FreshBooks as bill vendors. Purchase orders from Coupa map to bills in FreshBooks, tagged with the Coupa PO number for audit. Invoices received from Coupa vendors are created in FreshBooks as bills and linked to the matching PO. Payment records flow both directions: Coupa pushes supplier payments to FreshBooks, and FreshBooks payment webhooks notify Coupa for matching and cost-center allocation. The sync runs on webhook push from both sides, with a polling fallback if webhooks are unavailable.

How ml-connector handles it

FreshBooks uses user-delegated OAuth2 (not client credentials), so ml-connector stores a refresh token and applies it on each call, silently refreshing when a 401 is returned. Coupa uses client credentials with client ID and secret. Both require HMAC-SHA256 signature verification on incoming webhooks, and ml-connector validates the signature before storing the record. Suppliers are fetched from Coupa and synced as bill vendors in FreshBooks by matching on vendor name; a vendor must exist before a Coupa PO can be posted as a bill to avoid dangling references. Purchase orders in Coupa lack a FreshBooks equivalent, so ml-connector creates a bill with vendor PO number and line items from the Coupa PO. Invoices are matched to existing bills by PO number and vendor. Rate limits on the Coupa side are handled with exponential backoff capped at 30 seconds. Every webhook delivery carries a full audit trail and can be replayed if a downstream write fails.

A real-world example

A mid-sized consulting firm uses FreshBooks for invoicing and accounting, and Coupa for vendor procurement and purchase order management. Before the integration, the procurement team created a PO in Coupa, and when the vendor invoice arrived, the finance team re-entered the invoice as a bill in FreshBooks by hand, then reconciled the two at month end. With FreshBooks and Coupa connected, supplier master data syncs automatically, POs flow from Coupa into FreshBooks as draft bills, and incoming vendor invoices are matched to the PO and posted without re-keying. Month-end close sees procurement and accounting already aligned, and the manual entry step is eliminated.

What you can do

  • Sync supplier master data from Coupa into FreshBooks as bill vendors, keeping supplier lists in agreement.
  • Map Coupa purchase orders to FreshBooks bills with PO number and line items for full audit trail.
  • Receive invoice and payment webhooks from both FreshBooks and Coupa, validate signatures, and post records with automatic replay on failure.
  • Handle FreshBooks user-delegated OAuth2 with silent token refresh and Coupa client credentials with rate-limit backoff.
  • Reconcile payment records bidirectionally so cash accounts and procurement spend are always in sync.

Questions

How does ml-connector handle FreshBooks user-delegated OAuth and Coupa client credentials?
FreshBooks requires OAuth2 user-delegated authorization (not client credentials), so ml-connector stores the refresh token and reapplies it on each call, silently refreshing when a 401 is returned. Coupa uses client credentials with client ID and secret. Both credential sets are encrypted and stored per customer.
What happens to Coupa purchase orders that have no equivalent in FreshBooks?
ml-connector creates a bill in FreshBooks with the Coupa PO number and line items so the PO is recorded in accounting. Incoming vendor invoices are matched to this bill by PO number and vendor, linking procurement and invoicing.
How are supplier records matched between Coupa and FreshBooks?
Suppliers are matched by name. When a new supplier is created in Coupa, ml-connector syncs it as a bill vendor in FreshBooks with the same name. If a vendor with that name already exists, the sync skips creation to avoid duplicates.

Related integrations

Connect FreshBooks and Coupa

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started