Xero and SPS Commerce integration
Xero handles accounting and supplier invoicing. SPS Commerce connects you to major retail trading partners like Walmart and Target through an EDI network. Together they let you receive purchase orders from retailers through SPS, acknowledge them in Xero, and send invoices back through the network without manual file handling or format conversion. ml-connector bridges the two and moves the documents on a schedule you control.
What moves between them
Incoming purchase orders flow from SPS Commerce into Xero. When a retailer sends a PO through the SPS network, ml-connector pulls it on schedule and creates a purchase order in Xero, mapped to the correct supplier contact and line items. Outbound invoices flow from Xero back to SPS Commerce. After you issue an invoice in Xero against a PO that came from SPS, ml-connector sends it through the network to the original retailer in the correct EDI format, wrapped in the RSX envelope. Advance ship notices and acknowledgments also flow outbound. The cadence is scheduled polling for inbound (typically every 5 to 15 minutes) and event-driven for outbound (immediately after invoice creation in Xero).
How ml-connector handles it
ml-connector stores both OAuth2 credential sets encrypted and uses Xero's tenant-scoped authentication by accepting the tenant ID per customer and including it on every API call. For SPS, it includes the OAuth2 bearer token in the Authorization header and handles token refresh when calls return 401. On inbound, it polls the SPS purchase order endpoint on your chosen schedule, unwraps each document from the RSX 7.7.7 envelope, maps it to a Xero supplier by trading partner ID, and creates a purchase order with line items matched to Xero items. On outbound, it listens for invoice creation in Xero (via webhook or polling), wraps the invoice and associated line details in the RSX envelope with the correct EDI 810 format, and POSTs it to SPS to route to the originating retailer. ml-connector de-duplicates incoming POs by document number and stores the mapping between SPS document IDs and Xero PO IDs so the same PO is never created twice. It tracks SPS rate limits and backs off on 429 responses. Every record carries an audit trail so failed transmissions can be replayed.
A real-world example
A mid-sized apparel supplier sells to Walmart, Target, and Amazon through SPS Commerce's EDI network. Before the integration, the procurement team received POs via SFTP file drop in X12 format, manually converted them to line items, and re-entered them into Xero. When the goods shipped, they exported invoices from Xero, manually formatted them as EDI 810, and uploaded them back to the SFTP drop for SPS to route. With Xero and SPS Commerce connected, incoming retail POs flow automatically into Xero as purchase orders, and outbound invoices from Xero are automatically formatted and sent back through the SPS network. The procurement team no longer re-enters purchase order data, and the invoice dispatch step is eliminated. Discrepancies between Xero and retail shipping partners are caught immediately because every order is synchronized.
What you can do
- Receive purchase orders from retail trading partners through SPS Commerce and create them automatically in Xero.
- Send invoices from Xero to SPS Commerce and route them to the correct retail partner in EDI format.
- Map SPS trading partner identifiers to Xero supplier contacts so orders arrive under the correct vendor.
- Authenticate Xero with OAuth2 and tenant-scoped API calls, and SPS with OAuth2 client credentials and RSX envelope format.
- Sync on a schedule you control with de-duplication, rate limit handling, and a full audit trail on every record.
Questions
- What records move between Xero and SPS Commerce?
- Inbound purchase orders flow from SPS Commerce into Xero as purchase orders. Outbound invoices, advance ship notices, and functional acknowledgments flow from Xero into SPS and are routed to retail trading partners in EDI format. Both directions are deduplicated by document number to prevent duplicate creates.
- How does ml-connector handle Xero's per-tenant API structure?
- Xero requires the Xero-tenant-id header on every API call to target a specific organization, and each tenant has its own webhook signing key. ml-connector accepts the tenant ID per customer, includes it on all calls, and validates webhook signatures using the customer's stored signing key so multi-tenant setups work without cross-tenant leakage.
- What is the RSX envelope and why does SPS require it?
- RSX 7.7.7 is SPS Commerce's JSON wrapper for EDI documents. Every purchase order, invoice, and ASN from or to SPS must be wrapped in this envelope so the network can route it to the correct retail partner and validate it against that partner's trading partner configuration. ml-connector handles the wrapping and unwrapping automatically so your Xero invoices and POs are formatted transparently.
Related integrations
More Xero integrations
Other systems that connect to SPS Commerce
Connect Xero and SPS Commerce
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started