ml-connector
MYOBBrex

MYOB and Brex integration

MYOB runs accounting and financial records for SMEs. Brex manages corporate cards, expenses, and spend data. Connecting them keeps your accounting records current with every card transaction and expense your teams incur. Brex card activity and vendor expenses flow into MYOB as bills and purchase invoices, posted to the GL accounts you choose, eliminating manual data entry and the risk of missed or misclassified spend.

How MYOB works

MYOB Business API (AccountRight Live v2) exposes contacts, bills, purchase orders, sales invoices, GL accounts, GL journals, and inventory items through REST endpoints with OData v3 query parameters. Authentication requires OAuth 2.0 Authorization Code flow plus a second set of credentials: the MYOB company file username and password encoded in the x-myobapi-cftoken header. Access tokens expire in 20 minutes and refresh tokens last 1 week. MYOB does not support webhooks, so all integrations poll for changes using the LastModified timestamp field with OData $filter queries to detect records modified since the last sync.

How Brex works

Brex API exposes transactions, accounts, expenses, vendors, transfers, accounting records, and team users through REST JSON endpoints at https://api.brex.com. Authentication uses Bearer token authorization with a static API key for single-tenant accounts or OAuth 2.0 for multi-tenant access. Brex supports webhooks via Svix for event types including TRANSFER_PROCESSED, EXPENSE_PAYMENT_UPDATED, and ACCOUNTING_RECORD_READY_FOR_EXPORT. Webhook signatures use HMAC-SHA256 verification. Most operations on Transactions are read-only, but Expenses and Vendors are writable.

What moves between them

The main flow runs from Brex into MYOB. Card transactions and approved expenses from Brex sync into MYOB as purchase bills (for card spend) and purchase invoices (for vendor expenses), each posted to a configured GL account. ml-connector can also listen for Brex webhook events to trigger immediate sync on transaction settlement and expense approval. Vendor contact records from Brex are synced into MYOB Contacts as suppliers so that expense vendor names match existing suppliers in the ledger.

How ml-connector handles it

ml-connector stores both OAuth credential sets encrypted and refreshes each token before it expires: MYOB access tokens at the 20-minute mark and Brex tokens well before the 1-hour lifetime. For MYOB's dual-credential requirement, it caches the company file password encrypted and supplies both the OAuth Bearer token and the x-myobapi-cftoken header on every MYOB call, returning 401 if the company file credentials are wrong. It polls MYOB using OData LastModified filtering to detect new bills and invoices. On the Brex side, it receives webhook events from Brex for transaction settlements and expense approvals, verifying the HMAC-SHA256 signature on every webhook payload, and can also poll Brex transaction and expense endpoints as a fallback. Card transactions are mapped to MYOB Purchase Bills with the card account as the payee, and Brex expenses are mapped to Purchase Invoices with the vendor matched or created in MYOB Contacts. GL account mapping is configurable per integration, so card spend can post to different accounts by expense category. Every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A growing technology consulting firm with 25 employees issues Brex corporate cards to project teams for client travel, meals, and miscellaneous project expenses. Finance team spent 3 to 4 hours every week exporting card transactions from Brex, categorizing them by project, and manually posting them into MYOB as bills for reconciliation. With MYOB and Brex connected, every card transaction and approved expense lands in MYOB automatically, posted to the project or cost center configured for that expense category. Weekly reconciliation now takes 15 minutes instead of hours, and the Brex expense approval workflow is the source of truth for what hits the books.

What you can do

  • Sync Brex card transactions into MYOB as purchase bills, posted to GL accounts you configure.
  • Map Brex approved expenses to MYOB purchase invoices with vendor details auto-matched or created.
  • Receive real-time Brex webhooks for transaction settlements and expense approvals, triggering immediate sync into MYOB.
  • Handle MYOB's dual OAuth and company file credential requirement, refreshing both tokens before expiry.
  • Poll MYOB using OData LastModified filters and Brex transaction endpoints as a fallback, with retries and full audit trail on every record.

Questions

Does the integration require manual GL account mapping?
Yes, but it is one-time setup. You configure which Brex expense categories post to which MYOB GL accounts. Once set, every expense of that category flows to the mapped account automatically. You can update mappings any time without re-syncing historical data.
How does ml-connector handle MYOB's company file password requirement?
ml-connector stores the company file password encrypted and supplies it in the x-myobapi-cftoken header along with your OAuth token on every MYOB API call. The password is never logged or exposed. If it expires or is rotated, you update it once in the integration settings.
What happens if a Brex webhook fails or arrives out of order?
ml-connector verifies the HMAC-SHA256 signature on every webhook and confirms the transaction ID is not already in MYOB before posting. If the webhook times out, ml-connector falls back to polling Brex transaction and expense endpoints, so no spend is ever missed. Every record is deduplicated by transaction ID.

Related integrations

Connect MYOB and Brex

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

Get started