ml-connector
XeroIBM Sterling

Xero and IBM Sterling integration

Xero runs your general ledger and accounts. IBM Sterling routes EDI documents to and from your trading partners. Connecting them keeps your procurement records in Xero aligned with what IBM Sterling receives from suppliers and what it sends to customers. Purchase orders and invoices flow from IBM Sterling into Xero as bills and contacts, so your ledger reflects all trading partner activity without manual data entry or re-keying.

How Xero works

Xero Accounting API exposes invoices, purchase orders, contacts, payments, accounts, and manual journals through REST endpoints authenticated with OAuth2 Authorization Code flow. Access tokens expire after 30 minutes and refresh tokens last 60 days. Xero publishes webhooks for invoices, payments, purchase orders, and bank transactions that contain only metadata, requiring a follow-up GET request to fetch the full record. All requests must include the Xero-tenant-id header to target the correct organization. Rate limits are 5 concurrent calls, 60 per minute per tenant, and 5000 per day per tenant. Deleted records are not returned by default, and page-based pagination returns 100 records per page.

How IBM Sterling works

IBM Sterling B2B Integrator is an on-premises or hybrid-cloud platform that manages the lifecycle of EDI documents such as purchase orders, invoices, and advance shipping notices across ANSI X12, EDIFACT, and TRADACOMS standards. It exposes trading partners, workflows, schedules, and mailbox messages through a REST API over HTTPS, with HTTP Basic Authentication or OAuth2 Client Credentials authentication against a customer-specific instance URL. IBM Sterling has no outbound webhooks, only polling. Each customer operates their own B2Bi instance on a non-shared host, and the API credential must be a non-admin user account. EDI documents are accessed as payloads within mailbox messages rather than as queryable REST resources, and network access requires VPN or DMZ exposure.

What moves between them

The primary flow moves EDI documents from IBM Sterling into Xero. ml-connector polls IBM Sterling's mailbox messages on a regular schedule to detect new purchase orders and invoices. When a new EDI document arrives, it extracts the payload, translates it into the appropriate Xero format, maps trading partner identifiers to Xero contacts, and posts the bill to Xero's accounts. If Xero contains an invoice for the same purchase order, ml-connector links them to maintain the audit trail. The flow is pull-only; ml-connector does not write back to IBM Sterling.

How ml-connector handles it

ml-connector stores Xero OAuth2 credentials and handles token refresh when access tokens expire after 30 minutes. For IBM Sterling, it accepts the customer-specific instance hostname and port, authenticates with either HTTP Basic Auth or OAuth2 depending on the customer's configuration, and polls the mailbox API every 2 to 5 minutes. When a new EDI document is detected, ml-connector extracts the message payload, maps the supplier EDI identifier or name to a Xero contact using a configurable matching rule, translates X12 850 (purchase order) or 810 (invoice) segments into the Xero bill schema, and posts to Xero. Because Xero enforces the Xero-tenant-id header and has a 60-per-minute rate limit, ml-connector queues requests and retries with exponential backoff if a 429 or 401 error occurs. IBM Sterling's API credential must not be a super-user account, and the instance is not shared across customers, so each deployment uses a separate set of instance credentials. Every record includes a full audit trail showing the source EDI document, any translation steps, and the Xero transaction ID.

A real-world example

A mid-market distributor uses Xero for general ledger and accounts payable, and IBM Sterling to receive purchase orders from customers and transmit invoices through EDI. Before integration, procurement staff manually entered supplier invoices from IBM Sterling into Xero after converting EDI documents to readable form, a process prone to transcription error and delayed month-end close. With Xero and IBM Sterling connected, supplier invoices and purchase orders flow directly from IBM Sterling into Xero as bills, reducing manual entry to zero and keeping procurement records current. Reconciliation time shrinks because the ledger is already in sync with what suppliers are shipping.

What you can do

  • Read EDI purchase orders and invoices from IBM Sterling mailbox messages and translate them into Xero bill records.
  • Map trading partner EDI identifiers and names to Xero contacts using configurable matching rules.
  • Poll IBM Sterling on a schedule and post bills to Xero with automatic retry and exponential backoff on rate-limit errors.
  • Handle Xero OAuth2 token refresh and IBM Sterling's instance-specific URLs, with support for both HTTP Basic Auth and OAuth2.
  • Track every EDI document through extraction, translation, and posting with a complete audit trail queryable by source document, transaction ID, or timestamp.

Questions

Does ml-connector translate EDI X12 and EDIFACT documents for Xero?
Yes. ml-connector extracts purchase order (X12 850) and invoice (X12 810) documents from IBM Sterling mailbox messages, maps the segments to Xero bill fields, and translates the EDI data into a valid Xero bill. The translation respects Xero's account and tracking category rules so posted bills land on the correct GL accounts.
How does ml-connector handle the instance-specific IBM Sterling URL and OAuth2 refresh for Xero?
Each IBM Sterling customer runs their own on-premises or hybrid instance with a unique hostname and port. ml-connector accepts the full instance URL per customer and stores the credentials encrypted. For Xero, it refreshes the OAuth2 access token every 25 minutes (before the 30-minute expiry) so all API calls carry a valid bearer token.
What happens if IBM Sterling is slow to respond or Xero rate-limits a bill post?
ml-connector queues bill posts and retries with exponential backoff when it receives a 429 (rate limit) or 5xx error from Xero. IBM Sterling polling uses a fixed 2 to 5 minute interval, and if a mailbox API call times out, ml-connector retries the next polling cycle and logs the incident in the audit trail.

Related integrations

Connect Xero and IBM Sterling

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

Get started