ml-connector
XeroCoupa

Xero and Coupa integration

Xero handles your accounting and general ledger. Coupa manages procurement and supplier relationships. When you connect the two, purchase orders entered in Xero automatically appear in Coupa for approval and tracking, and supplier invoices received in Coupa sync back to Xero for matching and payment. ml-connector bridges the two APIs and keeps your procurement and accounting records in a single source of truth.

How Xero works

Xero exposes accounting records through its REST API, including invoices, purchase orders, contacts, accounts, payments, and manual journals. It authenticates with OAuth2 Authorization Code flow, with access tokens expiring after 30 minutes and refresh tokens valid for 60 days. Xero requires the Xero-tenant-id header on every request to target a specific organization, enforces page-based pagination with a maximum of 100 records per page, and publishes webhook events for creates and updates on invoices, contacts, and purchase orders. Webhook payloads contain metadata only, so full record details must be fetched with a follow-up GET request. Xero rate-limits to 5 concurrent calls and 60 per minute per tenant.

How Coupa works

Coupa is a cloud procurement platform accessible through a tenant-specific REST API at a customer's Coupa instance URL. It authenticates with OAuth2 client credentials and requires the X-Coupa-API-Version header on all requests. Coupa publishes webhook events for purchase orders, requisitions, invoices, suppliers, and payments with HMAC-SHA256 signing for security. The platform rate-limits on 5xx and 429 responses and enforces a 30 second default timeout per request. Webhook payloads are capped at 256KB and the platform enforces up to 3 automatic retry attempts on rate-limit responses with exponential backoff capped at 30 seconds.

What moves between them

Purchase orders and supplier invoices flow from Xero into Coupa. When a purchase order is created or updated in Xero, ml-connector reads the full record and posts it into Coupa as a procurement document linked to the appropriate supplier contact. Supplier invoices received in Xero are similarly synced into Coupa for three-way matching and approval workflow. Supplier master records in Xero are kept aligned with Coupa's supplier table so that invoices reference valid supplier entities on both sides. The integration can poll Xero on a schedule or react to webhook events, and reads back Coupa's purchase order state after writes to ensure both systems remain consistent.

How ml-connector handles it

ml-connector stores both Xero OAuth credentials and Coupa API keys encrypted and manages Xero's OAuth2 token refresh cycle automatically. It presents the Xero-tenant-id header on every Xero call and validates tenant context before reading. Because Xero webhooks deliver metadata only, ml-connector fetches the full purchase order or invoice record from Xero after receiving a webhook notification, then constructs the corresponding Coupa procurement document, mapping Xero contacts to Coupa suppliers by matching external ID or business name. It respects both Xero's rate limits by spacing requests and Coupa's exponential backoff when rate-limited, and it handles pagination across both systems to ensure all records are captured. Every synced record carries a cross-reference ID so duplicates are avoided if a webhook is replayed, and a full audit trail tracks each record's source, target, and any mapping decisions made during the sync.

A real-world example

A mid-market services company uses Xero for accounting and general ledger and Coupa for supplier management and procurement workflows. Before integration, purchase orders were entered in Xero for accounting records but had to be manually re-entered into Coupa for approval and three-way matching with receipts and invoices. This created delays, duplicate data entry, and reconciliation gaps between the two systems, especially when a PO was changed in one system after being entered in the other. With Xero and Coupa connected, new purchase orders flow from Xero into Coupa automatically, linked to the correct supplier and ready for approval. Supplier invoices that arrive in Xero are synced into Coupa for matching, eliminating manual entry and keeping both systems in agreement throughout the procure-to-pay cycle.

What you can do

  • Sync purchase orders from Xero into Coupa as procurement documents, automatically linked to supplier records.
  • Keep supplier master records aligned across Xero and Coupa so invoices reference valid suppliers in both systems.
  • Map Xero contacts to Coupa suppliers by external ID or business name to ensure accurate sourcing.
  • Handle Xero OAuth2 token refresh, rate limits, and page-based pagination transparently.
  • Maintain a full audit trail of every synced record with cross-reference IDs to prevent duplicates on webhook replay.

Questions

Which direction does data move between Xero and Coupa?
The primary flow is from Xero into Coupa. Purchase orders and supplier invoices entered in Xero are synced into Coupa for procurement workflows and three-way matching. Supplier master records are kept aligned in both directions so that invoices in either system reference the same supplier entities.
How does the integration handle Xero's webhook payloads that contain metadata only?
When ml-connector receives a webhook notification from Xero, it immediately fetches the full purchase order or invoice record using the resource ID and the Xero REST API. This ensures Coupa receives complete data including line items, amounts, and tax details needed for procurement workflows.
How does ml-connector manage the different authentication schemes between Xero and Coupa?
ml-connector stores both credential sets encrypted and manages them independently. It refreshes Xero's OAuth2 access tokens automatically when they expire after 30 minutes, and it presents Coupa's client credentials and required headers on every Coupa call. Both systems' credentials are stored in a per-customer encrypted vault.

Related integrations

Connect Xero and Coupa

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

Get started