ml-connector
XeroServiceNow

Xero and ServiceNow integration

Xero runs accounting for small and medium businesses. ServiceNow's Source-to-Pay Operations suite handles Accounts Payable and procurement. Connecting the two keeps your AP records in agreement, eliminates manual invoice re-entry, and keeps payment and account master data synchronized across systems. Invoice records from Xero flow into ServiceNow's staging tables, ready to be processed into full AP documents without rework.

How Xero works

Xero is a cloud-based accounting platform that exposes invoices, purchase orders, payments, accounts, and contacts through the Xero Accounting API, a REST service returning JSON or XML responses. Xero authenticates with OAuth2 Authorization Code flow, with access tokens expiring after 30 minutes; offline_access scope allows refresh tokens to persist for 60 days. Xero publishes webhook events for invoices, credit notes, payments, manual journals, purchase orders, and bank transactions, though webhooks contain metadata only and require a follow-up GET to fetch the full record. It also supports delta sync via If-Modified-Since header for polling. Rate limits are 5 concurrent calls, 60 per minute per tenant, and 5000 per day per tenant. All requests require the Xero-tenant-id header to specify the organization.

How ServiceNow works

ServiceNow's Source-to-Pay Operations suite extends the core platform with Accounts Payable, procurement, sourcing, and supplier management features. ServiceNow exposes tables like sn_apo_invoice, sn_apo_payment, proc_po, and cmn_cost_center through REST Table API endpoints on a customer-supplied subdomain. ServiceNow authenticates with OAuth2 Client Credentials for machine-to-machine access, OAuth2 Authorization Code for user-delegated access, or Basic Auth. Source-to-Pay staging tables are module-licensed add-ons and require appropriate role assignments. ServiceNow uses polling only; there is no native outbound webhook system, though Business Rules and Outbound REST Messages can be manually configured for custom push. Token lifespan defaults to 30 minutes.

What moves between them

Invoices, purchase orders, and payments flow from Xero into ServiceNow's Accounts Payable staging tables. ml-connector consumes Xero webhook events for invoice creates and updates, fetches the full invoice record from Xero, maps Xero line-item accounts and amounts to ServiceNow cost centers and GL accounts, and writes the invoice into the ServiceNow staging table ready for AP processing. Contacts and accounts are synced bidirectionally to keep supplier master data and GL account hierarchies aligned. ServiceNow's staging tables are write destinations; financial records flow from Xero into ServiceNow and are not written back.

How ml-connector handles it

ml-connector receives Xero webhook events for invoices and payments, validates the signature using the Xero-provided signing key, and fetches the full invoice payload from Xero using OAuth2 bearer tokens that refresh automatically after 30 minutes. It maps each invoice line to the matching ServiceNow cost center and GL account by cross-referencing the Xero tracking category and account code against ServiceNow's cmn_cost_center and itfm_gl_accounts tables. For ServiceNow authentication, ml-connector uses OAuth2 Client Credentials or Basic Auth to write invoices into the sn_apo_invoice staging table; if the customer has enabled custom Business Rules for real-time push, ml-connector can trigger them by writing to a well-known staging table. Xero's rate limits of 60 calls per minute per tenant are respected with exponential backoff on 429 responses. Because ServiceNow S2P staging tables are module-licensed add-ons, ml-connector verifies the customer instance has them enabled before writing. Duplicate detection uses the Xero invoice number as the natural key in the staging table.

A real-world example

A mid-sized professional services firm uses Xero for financial accounting and ServiceNow for IT Service Management with a recent Source-to-Pay module license for AP and procurement. Before the integration, accounts payable staff downloaded invoices from Xero weekly and manually typed them into ServiceNow's AP staging tables, a process that introduced typos, took 4 hours per week, and left Xero and ServiceNow out of sync until reconciliation. With Xero and ServiceNow connected, each invoice that hits Xero automatically lands in ServiceNow within seconds, mapped to the correct cost center, and the AP team can focus on approval routing and payment rather than data entry. Supplier master records stay synchronized without manual effort.

What you can do

  • Move Xero invoices and purchase orders into ServiceNow Accounts Payable staging tables, mapped to ServiceNow cost centers and GL accounts.
  • Consume Xero webhook events and validate signatures to detect invoice creates and updates in real-time.
  • Authenticate with Xero OAuth2 and handle token refresh on 30-minute expiry, and ServiceNow OAuth2 Client Credentials or Basic Auth.
  • Map Xero tracking categories and line-item accounts to ServiceNow cost centers and GL accounts, keeping dimensional alignment.
  • Detect duplicate invoices by Xero invoice number and prevent re-entry into ServiceNow staging tables.

Questions

Do invoices flow both ways between Xero and ServiceNow?
No. Invoices flow from Xero into ServiceNow's Accounts Payable staging tables only. ServiceNow staging tables are write destinations for AP data extraction from Xero. Supplier master data and GL accounts can be synced bidirectionally to keep both systems aligned, but invoice and payment records are Xero-to-ServiceNow only.
How does ml-connector handle Xero's webhook events and ServiceNow's lack of webhooks?
ml-connector listens for Xero webhook events for invoice creates and updates, validates the signature using Xero's signing key, and fetches the full invoice record from Xero with a follow-up GET request. It then writes the invoice directly to ServiceNow's sn_apo_invoice staging table using REST API calls. Because ServiceNow has no native outbound webhooks, ml-connector polls ServiceNow's supplier and GL account tables on a schedule to keep master data in sync.
What happens if the invoice amount or account mappings conflict between Xero and ServiceNow?
ml-connector validates that each invoice line maps to an existing ServiceNow cost center and GL account before writing to the staging table. If a cost center or GL account is missing in ServiceNow, ml-connector logs the error with the Xero invoice number so the AP team can investigate and add the missing dimension. The invoice is not written until all mappings are valid.

Related integrations

Connect Xero and ServiceNow

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

Get started