Xero and Stampli integration
Xero handles your accounting and purchase orders. Stampli manages approvals, matching, and vendor payments for accounts payable. Connecting the two means every vendor invoice tied to a Xero purchase order is automatically captured and routed to Stampli for approval and payment, eliminating manual invoice data entry and keeping your GL accounts aligned across both systems. ml-connector watches for new invoices in Xero, bundles them with their purchase order context, maps GL accounts, and delivers them as structured files to Stampli's SFTP import directory.
What moves between them
ml-connector polls Xero for new purchase orders and vendor invoices on a cadence you define (typically every 15 to 30 minutes aligned with your invoice processing schedule). For each invoice matched to a purchase order, it extracts the invoice, vendor contact, line items, GL account references, and associated amounts. The connector maps Xero GL accounts to Stampli GL accounts, validates vendor records, and constructs a CSV or XML file conforming to Stampli's invoice import template. The file is delivered via SFTP to Stampli's inbound directory, where Stampli's AP automation engine ingests it for PO matching, approval routing, and payment execution. No data flows back from Stampli to Xero in this integration.
How ml-connector handles it
ml-connector accepts Xero OAuth2 credentials and tenant ID, refreshing the access token every 25 minutes to avoid expiry within a request cycle. It polls Xero's Invoices and PurchaseOrders endpoints using the If-Modified-Since header to retrieve only records changed since the last sync run. For each ACCPAY (vendor bill) invoice, the connector resolves the linked contact and purchase order context, extracts line-item GL account references and tracking categories, and performs a lookup to match Xero GL accounts to Stampli's account dimension codes (mapped during setup). SFTP credentials are stored encrypted, and the connector validates them on every connection. Files are staged locally, checksummed, and delivered to Stampli's SFTP import directory with a naming convention that includes the sync timestamp to avoid collisions. If an SFTP upload fails, the connector retries with exponential backoff and logs the error with the full file content for manual replay. If Xero's rate limit is hit (429 response), the connector backs off according to the Retry-After header. Every record extracted from Xero is audited with timestamp, source invoice ID, and delivery status so failed invoices can be reprocessed without duplicating successful ones.
A real-world example
A small but growing manufacturing business uses Xero for accounting and purchase order management, and recently deployed Stampli to streamline its accounts payable team's manual invoice processing. Before the integration, the AP team received purchase orders and vendor invoices through email and Xero reports, manually entered invoice details into Stampli for matching and approval, and struggled to keep GL account coding consistent between systems. With Xero and Stampli connected, every purchase order creates a pre-matched invoice record in Stampli, GL accounts are automatically coded from the Xero PO, and the approval workflow begins without manual data entry. Month-end closes faster because invoice counts reconcile without exception hunting.
What you can do
- Extract vendor invoices from Xero and automatically match them to purchase orders for capture into Stampli.
- Map Xero GL accounts and cost allocations to Stampli's accounting dimensions so invoices land on the correct cost center.
- Poll Xero on a schedule aligned with your invoice arrival frequency using delta sync to minimize API load.
- Store and protect SFTP credentials encrypted, validate connectivity, and retry failed deliveries with full audit trails.
- Deduplicate invoices across sync runs by invoice ID and reconcile successful uploads against Xero's source records.
Questions
- Why does ml-connector use SFTP and file-based delivery instead of a REST API?
- Stampli does not publish a public REST API for third-party integrations without a formal partnership agreement. File-based SFTP integration is the only available path for external systems. ml-connector constructs CSV or XML files conforming to Stampli's import templates and delivers them via SFTP, which provides the same automation and audit trail as a direct API would.
- How does the integration handle Xero's OAuth2 token expiry and rate limits?
- ml-connector refreshes Xero's access token every 25 minutes, well before the 30-minute expiry window, so token expiration never interrupts a sync run. If Xero returns a 429 rate-limit response, ml-connector respects the Retry-After header, backs off exponentially, and logs the retry so that no invoices are missed during peak invoice periods.
- What happens if an invoice cannot be matched to a purchase order in Xero?
- Unmatched invoices are flagged in the audit log and can be routed to a review queue within Stampli for manual approval, or excluded from the automated delivery based on your configuration. ml-connector tracks which invoices were successfully delivered and which were held, so operators can follow up with PO exceptions without re-scanning Xero manually.
Related integrations
More Xero integrations
Other systems that connect to Stampli
Connect Xero and Stampli
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started