ml-connector
XeroTrueCommerce

Xero and TrueCommerce integration

Xero handles your accounting and Xero purchase orders. TrueCommerce exchanges EDI documents with your trading partners. Connecting the two keeps your ERP and your supply chain in sync without manual re-keying. Invoices and purchase orders flow from Xero into TrueCommerce as EDI documents formatted for your trading partners, and acknowledgments and shipment notices flow back into Xero for visibility. ml-connector handles Xero OAuth2 credentials, TrueCommerce API key or SFTP authentication, EDI transformation, and polling on a schedule you control.

How Xero works

Xero exposes invoices, purchase orders, contacts, accounts, payments, and credit notes through the Xero Accounting API, a REST service that accepts OAuth2 with a 30-minute access token and 60-day refresh token. Every call requires the Xero-tenant-id header to specify the target organization, and Xero enforces strict rate limits: 5 concurrent calls, 60 per minute per tenant, and 5000 per day. Webhooks are available for invoices, purchase orders, payments, and bank transactions but contain only metadata, requiring a follow-up REST call to fetch the full record. Deleted records are not returned by default.

How TrueCommerce works

TrueCommerce is a cloud EDI and supply chain platform, not a standalone ERP. It exchanges documents with trading partners via SFTP, managed REST API (the Exchange API), EDI (X12 and EDIFACT), or a local Windows Integration Service. Authentication runs through SFTP credentials provisioned by TrueCommerce, API keys, or bearer tokens per customer. There is no public OAuth or self-serve token generation; all credentials are set up during account onboarding. TrueCommerce Transaction Manager supports scheduled import and export jobs, and the managed Exchange API can be configured for near-real-time or scheduled polling. File naming and integration paths are customer-specific.

What moves between them

The main flow moves Xero invoices and purchase orders into TrueCommerce as EDI documents. Xero invoices become X12 810 documents, and Xero purchase orders become X12 850 documents. TrueCommerce purchase order acknowledgments (X12 855) and advance ship notices (X12 856) are polled and can be stored as records in Xero for visibility. The sync runs on a schedule tied to your order and invoicing cadence, not on webhooks; ml-connector polls Xero for new or modified purchase orders and invoices, transforms them to EDI, and deposits them in TrueCommerce via SFTP or the Exchange API. Acknowledgments and shipments are polled from TrueCommerce and can be flagged or logged for reconciliation.

How ml-connector handles it

ml-connector stores both Xero OAuth2 credentials and TrueCommerce API key or SFTP username and password encrypted. On the Xero side, it refreshes the OAuth2 access token when a call returns 401, respects the 5 concurrent-call and 60-per-minute rate limits by queuing requests, and uses the If-Modified-Since header to poll only changed records since the last sync. On the TrueCommerce side, it connects via SFTP or the Exchange API (per your configuration), deposits transformed EDI documents, and polls acknowledgments and shipments on your sync schedule. Xero contacts are mapped to TrueCommerce trading partners so purchase orders and invoices route to the correct destination. Every record carries a full audit trail and can be replayed if a transformation or transmission fails.

A real-world example

A mid-sized distributor uses Xero for accounting and order management and uses TrueCommerce to exchange orders and invoices with five major retail partners in X12 EDI format. Before the integration, the operations team exported purchase orders from Xero twice daily, manually formatted them as X12 850 documents in a spreadsheet macro, and uploaded them to TrueCommerce via SFTP. Inbound acknowledgments were downloaded and logged by hand. With Xero and TrueCommerce connected, each purchase order in Xero flows automatically to TrueCommerce as a properly formatted EDI document within minutes, and acknowledgments are captured and logged without manual intervention. The operations team now spends their time on exceptions rather than data entry.

What you can do

  • Transform Xero invoices and purchase orders into X12 EDI documents and deliver them to TrueCommerce via SFTP or the Exchange API.
  • Map Xero contacts to TrueCommerce trading partners so orders and invoices route to the correct destination.
  • Poll Xero with OAuth2 credentials and respect rate limits and retry logic, tracking token expiry and refreshing when needed.
  • Authenticate TrueCommerce via API key, SFTP credentials, or bearer token provisioned during onboarding.
  • Capture TrueCommerce acknowledgments and shipments and log them for visibility and reconciliation.

Questions

Which direction does data move between Xero and TrueCommerce?
The primary flow moves Xero purchase orders and invoices into TrueCommerce as EDI documents. Acknowledgments and shipment notices from TrueCommerce are polled and captured for visibility. TrueCommerce is a VAN, not an ERP, so it does not source invoices or orders; it exchanges them with trading partners.
How does ml-connector handle Xero rate limits and OAuth2 token expiry?
ml-connector queues requests to stay within the 5 concurrent-call and 60-per-minute limits, uses the If-Modified-Since header to fetch only changed records, and tracks Xero OAuth2 token expiry. When a call returns 401, ml-connector refreshes the access token automatically.
Does ml-connector support both SFTP and the TrueCommerce Exchange API?
Yes. ml-connector can connect to TrueCommerce via SFTP or the managed Exchange API, depending on your account setup. TrueCommerce provisions credentials during onboarding, and ml-connector stores them encrypted and uses them for every request.

Related integrations

Connect Xero and TrueCommerce

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

Get started