ml-connector
Sage 300Brex

Sage 300 and Brex integration

Sage 300 runs financial operations at mid-market companies. Brex runs corporate spend management and card programs. Connecting the two keeps your expense records and your general ledger in sync. Every approved Brex expense generates an accounting record that ml-connector reads and posts directly into Sage 300's accounts payable or journal batches, mapped to the correct vendor and cost center. No manual re-entry, no month-end reconciliation drift, and full visibility into who spent what and where it landed in the ledger.

How Sage 300 works

Sage 300 is an on-premise ERP that exposes Accounts Payable, General Ledger, Purchase Orders, Accounts Receivable, and Inventory through REST and OData APIs. Every request includes HTTP Basic Authentication with an uppercase username and password. The self-hosted IIS server must be exposed over HTTPS on a customer-specific domain. Sage 300 has no webhooks or change-data-capture, so all data is read via polling using OData filters on date/time fields and pagination. The API requires a dedicated user in Administrative Services with Web API security group assigned. Endpoint URLs follow the pattern https://{host}/Sage300WebApi/v1.0/-/{company}/{module}/{resource}, and large sync runs (1500+ calls) can trigger IIS AppPool timeouts if the server is under-configured.

How Brex works

Brex is a corporate spend management platform that exposes transactions, expenses, vendors, accounting records, transfers, and user management through REST APIs. Authentication uses bearer tokens either as static single-tenant API keys (generated in the Brex dashboard, 90-day inactivity expiry) or as OAuth 2.0 access tokens with a one-hour lifetime and optional refresh tokens. Brex supports push notifications via Svix-powered webhooks with HMAC-SHA256 signature verification, including a new ACCOUNTING_RECORD_READY_FOR_EXPORT event (Alpha, added late 2025). Transactions are read-only; write operations are available on Expenses, Vendors, Transfers, Users, Cards, and Budgets. Idempotency keys are required on POST transfers. Spend Limits v1 is deprecated in favor of v2.

What moves between them

The main flow runs from Brex into Sage 300. After an expense is approved in Brex and an accounting record is ready, ml-connector reads the Brex accounting record, retrieves the matched vendor and amount, and posts the entry into Sage 300's General Ledger (GLJournalBatches) or Accounts Payable (APInvoiceBatches) depending on the expense type. Vendor names from Brex are matched against existing APVendors in Sage 300 so the posting lands on the correct vendor account. The sync runs on a schedule you set, aligned with your expense approval cadence, typically once per day or after each expense is approved. All data flows are read-only from Brex into Sage 300; ml-connector never writes back to Brex.

How ml-connector handles it

ml-connector stores both the Sage 300 HTTP Basic Auth credentials (username and password, uppercase) and the Brex bearer token encrypted. On the Sage 300 side, it polls the host URL you provide and uses OData filters on transaction dates to retrieve only new or updated records since the last sync. On the Brex side, it can either poll for new accounting records or listen for the ACCOUNTING_RECORD_READY_FOR_EXPORT webhook event via Svix and verify the webhook signature using the provided secret. When an accounting record arrives, ml-connector retrieves the linked Brex expense, looks up the Brex vendor name in your Sage 300 APVendors list, and posts the GL entry to the matching GLJournalBatch or APInvoiceBatch. If a vendor name does not exist in Sage 300, the record is held in audit until you add the vendor, then replayed. Brex bearer tokens expire after 90 days of inactivity, so ml-connector tracks token age and refreshes before expiry. If a GL posting fails (for example, the GL account does not exist), the record is logged in full audit detail and can be replayed without duplicating the Brex transaction. IIS AppPool timeouts on large Sage 300 runs are handled with exponential backoff retries.

A real-world example

A mid-sized professional services firm uses Brex for corporate cards and expense management across five offices and 200 employees. Finance previously exported Brex transaction reports weekly, matched them to vendors in a spreadsheet, and manually entered the GL postings into Sage 300 at month-end close. With Brex and Sage 300 connected, each approved expense flows into the ledger automatically the next day, vendors are matched by name, and the GL is ready for close review without any manual data entry. The audit trail shows exactly which Brex expense created which GL posting, so exceptions are caught and resolved in minutes instead of days.

What you can do

  • Post approved Brex expenses into Sage 300 General Ledger or Accounts Payable batches, matched to the correct vendor and cost center.
  • Sync Brex transactions and accounting records on a schedule you control, with polling or webhook delivery via Svix.
  • Map Brex vendor names to existing Sage 300 APVendors so expenses land on the correct GL accounts and vendor accounts.
  • Handle HTTP Basic Auth for Sage 300 and bearer token lifecycle management for Brex, with encrypted credential storage.
  • Hold unmatched records in audit when a vendor does not exist in Sage 300, and replay them automatically when the vendor is added, with no duplication.

Questions

Which direction does data move between Sage 300 and Brex?
Data flows from Brex into Sage 300 only. Approved Brex expenses and their accounting records are read from Brex and posted into Sage 300 General Ledger or Accounts Payable batches. Sage 300 is never written back to, so the connection is purely read-from-Brex.
How does ml-connector handle vendor matching between Brex and Sage 300?
When a Brex expense arrives with a vendor name, ml-connector looks up that vendor name in your Sage 300 APVendors list. If the vendor exists, the GL posting is matched to that vendor account. If the vendor does not exist, the record is held in audit and you are notified; once you add the vendor to Sage 300, the record is replayed and posted automatically without duplication.
Does ml-connector support both polling and Brex webhooks for expense notification?
Yes. ml-connector can poll Brex's accounting records endpoint on a schedule, or listen for the ACCOUNTING_RECORD_READY_FOR_EXPORT webhook event and verify the signature using your Svix secret. Webhook delivery is faster; polling is reliable if webhooks are not yet enabled or preferred. You choose the method during setup.

Related integrations

Connect Sage 300 and Brex

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

Get started