FINCommercial ยท Xero

Xero Accounting API

Accounting API for the platform most SG SMEs and accountants run on: invoices, contacts, bank transactions, payroll and reports. Essential for any SG ERP or fintech that syncs books.

How to authenticate

5 stops to a working call

  1. 1Create a free developer account at developer.xero.com and add an app.
  2. 2Configure the OAuth 2.0 redirect URI and copy client id/secret.
  3. 3Run the authorization code flow requesting scopes like accounting.transactions offline_access.
  4. 4Exchange the code for access + refresh tokens; access tokens last 30 minutes.
  5. 5Call the API with Authorization: Bearer and the xero-tenant-id header from the connections endpoint.

Example request

Request
curl -H 'Authorization: Bearer ACCESS_TOKEN' -H 'xero-tenant-id: TENANT_ID' -H 'Accept: application/json' 'https://api.xero.com/api.xro/2.0/Invoices?page=1'

Example response

Response (truncated)
{"Invoices":[{"InvoiceID":"...","Type":"ACCREC","Contact":{"Name":"ABC Pte Ltd"},"AmountDue":214.00,"Status":"AUTHORISED"}]}

Xero Accounting API: common questions

Is the Xero Accounting API free?

The Xero Accounting API is listed as freemium. Check the official Xero docs for current pricing.

Does the Xero Accounting API need an API key?

Yes. It uses OAuth 2.0. Create a free developer account at developer.xero.com and add an app. Configure the OAuth 2.0 redirect URI and copy client id/secret. Run the authorization code flow requesting scopes like accounting.transactions offline_access. Exchange the code for access + refresh tokens; access tokens last 30 minutes. Call the API with Authorization: Bearer and the xero-tenant-id header from the connections endpoint.

What is the Xero Accounting API endpoint?

The base URL is https://api.xero.com/api.xro/2.0. A working example: curl -H 'Authorization: Bearer ACCESS_TOKEN' -H 'xero-tenant-id: TENANT_ID' -H 'Accept: application/json' 'https://api.xero.com/api.xro/2.0/Invoices?page=1'

What is the Xero Accounting API rate limit?

60 calls/min and 5,000 calls/day per tenant (documented by Xero)

Notes for AI agents

Forgetting the xero-tenant-id header is the classic 403 cause. Refresh tokens rotate on every use; persist the newest one atomically.

Machine-readable version: /api/apis/xero

On the same line