ml-connector
QuickBooks OnlineBrex

QuickBooks Online and Brex integration

QuickBooks Online is where your financial records live. Brex is where your corporate spend happens. Connecting the two means every corporate card expense and company transfer Brex processes flows automatically into QuickBooks Online as a bill or journal entry, posted to the accounts and vendors you set up. Your accounting team stops waiting for CSV exports and manual entry, and your books stay current with your actual company spending.

How QuickBooks Online works

QuickBooks Online exposes vendors, bills, expenses, journal entries, accounts, classes, and departments through the QuickBooks Online Accounting API (v3) over HTTPS REST. It uses OAuth 2.0 Authorization Code flow for multi-tenant access, with access tokens valid for 1 hour and refresh tokens that rotate every 24-26 hours. QuickBooks Online supports both webhooks (push on create, update, delete, merge, and void events) and a CDC polling endpoint with 30-day history. All creates and updates require a SyncToken for concurrency control, and bills, expenses, and invoices cannot be hard-deleted, only marked inactive.

How Brex works

Brex exposes transactions, expenses, accounting records, vendors, and transfers through REST endpoints at api.brex.com. For single-tenant integrations it uses static bearer tokens (API keys with 90-day inactivity expiry); for multi-tenant it uses OAuth 2.0 Authorization Code flow with 1-hour access tokens. Brex pushes events via Svix webhooks including TRANSFER_PROCESSED, EXPENSE_PAYMENT_UPDATED, and ACCOUNTING_RECORD_READY_FOR_EXPORT (alpha). Transactions are read-only, but expenses, vendors, transfers, and accounting records can be created or modified. POST requests to Brex require an Idempotency-Key header to prevent duplicate transfers.

What moves between them

Brex expenses and accounting records flow into QuickBooks Online on demand or when Brex fires a webhook event. Each Brex expense is posted as a QuickBooks Online bill or purchase, mapped to the vendor account and cost center you configure. Brex transfers (card funding, vendor payouts) become journal entries in QuickBooks Online, allocated to bank and expense accounts. Card transactions are reconciled against Brex's accounting records to ensure the general ledger matches actual spend. QuickBooks Online vendors and accounts flow to Brex as reference data for categorization and mapping.

How ml-connector handles it

ml-connector stores the Brex API key encrypted and uses it to pull expenses, transactions, and accounting records from Brex's REST API, then pushes them into QuickBooks Online as bills and journal entries. It listens for Brex webhooks via Svix to catch real-time EXPENSE_PAYMENT_UPDATED and TRANSFER_PROCESSED events, verifying signatures with HMAC-SHA256 and the webhook secret. For QuickBooks Online it uses OAuth to obtain and refresh access tokens before they expire at the 1-hour mark, and validates each request with the required SyncToken to avoid concurrency conflicts. When a Brex webhook or poll finds a new expense, ml-connector looks up the matching vendor in QuickBooks Online by Brex's vendor ID, checks that the cost center exists, then posts the bill with all line items and the matching account code. Transfers are posted as journal entries (from bank account to expense account or vendor payable). If a Brex expense cannot find a matching vendor or account in QuickBooks Online, ml-connector queues it for retry with backoff and logs the mismatch for your review. Brex's Expenses endpoint pages at 100 records, so ml-connector batches reads and uses pagination cursors to walk large result sets without missing records.

A real-world example

A mid-market software company with 50 employees runs Brex for corporate cards and expense management, and QuickBooks Online for accounting. Before the integration, the finance team received a CSV export from Brex once a day, manually categorized each card transaction and expense report into accounts and cost centers, created bills in QuickBooks Online by hand, and reconciled card statements against the expense records at month end. With Brex and QuickBooks Online connected via ml-connector, each approved Brex expense becomes a bill in QuickBooks Online in minutes, allocated to the cost center in Brex and the matching account in QuickBooks Online. Card reconciliation is automatic, and the finance team starts month-end close with the books already current and accurate.

What you can do

  • Post Brex expenses and accounting records into QuickBooks Online as bills and journal entries, mapped to your chart of accounts and vendors.
  • Sync Brex corporate card transactions into QuickBooks Online for automatic reconciliation against accounting records.
  • Handle OAuth token refresh for QuickBooks Online and secure bearer tokens for Brex, both expiring at different intervals.
  • Listen for Brex webhook events via Svix and verify HMAC-SHA256 signatures to catch expenses and transfers in real time.
  • Retry on Brex rate limits and QuickBooks Online SyncToken conflicts, with a full audit trail for every transaction and error.

Questions

How are Brex expenses mapped to QuickBooks Online accounts and vendors?
Each Brex expense carries a vendor ID and cost center that ml-connector uses to look up the matching vendor and account in QuickBooks Online. If both exist, the expense becomes a bill in QuickBooks Online with line items allocated to that account. If the vendor or account is missing, ml-connector queues the expense for retry and flags it in the audit log so your team can add the mapping.
What if Brex or QuickBooks Online change a token or API key while the integration is running?
For Brex, ml-connector re-reads the bearer token from your secure credential store on the next request, so you can rotate keys without downtime. For QuickBooks Online, access tokens expire after 1 hour, so ml-connector refreshes automatically using your stored refresh token before each request. If a refresh token is revoked, the next call fails and ml-connector surfaces the error immediately.
Can Brex push expenses to QuickBooks Online in real time, or does ml-connector have to poll?
Brex supports webhooks via Svix, so ml-connector listens for EXPENSE_PAYMENT_UPDATED and TRANSFER_PROCESSED events and posts them to QuickBooks Online within seconds. You can also configure ml-connector to poll on a schedule (daily, hourly) if you prefer, and it will walk the full Brex expense list with pagination to catch any missed events.

Related integrations

Connect QuickBooks Online and Brex

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

Get started