Xero API

By Abhishek Kumar
8 min read
Explore Xero's RESTful API for seamless accounting integration, real-time updates with webhooks, and comprehensive documentation for developers.

Table of Contents

Get paid sooner when you accept payments online straight from a Xero invoice. Give your customers different payment options, including PayPal and Stripe.

API Overview

Xero is a cloud-based accounting software designed for small businesses and accountants. It offers a comprehensive suite of features, including invoicing, expense tracking, bank reconciliation, and financial reporting. Xero integrates with a wide range of third-party applications, making it a versatile solution for businesses of all sizes. Its user-friendly interface and intuitive navigation make it easy for users to manage their finances and gain valuable insights into their business performance. Xero's mobile app allows users to access their financial data on the go, providing them with real-time updates and the ability to manage their finances from anywhere. The Xero API provides developers with access to Xero's functionality and data. The API is RESTful and uses OAuth 2.0 for authentication. The API documentation is comprehensive and includes examples in multiple programming languages. Xero also offers a range of tools and resources to help developers integrate with the API, including a sandbox environment for testing and a community forum for support. Webhooks allow developers to receive real-time notifications of changes to Xero data. Rate limits are in place to ensure that the API is used responsibly and to prevent abuse. Developers can monitor their API usage through the Xero Developer Portal.

API Request Limits

Starter Plan

20 requests per second

Standard Plan

60 requests per second

Premium Plan

120 requests per second

APIs

Accounts

Method: get

Description: Retrieves a list of accounts..

Endpoint: /Accounts

Parameters:

Accounts

Method: get

Description: Retrieves a specific account..

Endpoint: /Accounts/{id}

Parameters:

Accounts/{id}

Method: put

Description: Updates a specific account..

Endpoint: /Accounts/{id}?

Parameters:

Accounts/{id}

Method: delete

Description: Deletes a specific account..

Endpoint: /Accounts/{id}

Parameters:

ActivityStatements

Method: get

Description: Retrieves the activity statement for a given statement date according to the organisation's tax reporting period..

Endpoint: /ActivityStatements/{activityStatementId}

Parameters:

Attachments

Method: get

Description: Retrieves a list of attachments..

Endpoint: /Attachments

Parameters:

Attachments

Method: post

Description: Uploads an attachment.

Endpoint: e.g.

Parameters: a PDF receipt.

BankAccounts

Method: get

Description: Retrieves a list of bank accounts..

Endpoint: /BankAccounts

Parameters:

BankTransactions

Method: get

Description: Retrieves a list of bank transactions according to specified query parameters..

Endpoint: /BankTransactions

Parameters:

BatchPayments

Method: post

Description: Creates a batch payment from multiple existing account payments..

Endpoint: /BatchPayments

Parameters:

BatchPayments

Method: get

Description: Retrieves all the Batch Payments created through the Xero API..

Endpoint: /BatchPayments

Parameters:

Brands

Method: get

Description: Retrieves a list of brands..

Endpoint: /Brands

Parameters:

BrandingThemes

Method: get

Description: Retrieves a list of branding themes..

Endpoint: /BrandingThemes

Parameters:

CalendarEvents

Method: get

Description: Retrieves events from a Google Calendar that are associated with this Xero organisation..

Endpoint: /CalendarEvents

Parameters:

Contacts

Method: get

Description: Retrieves a list of contacts..

Endpoint: /Contacts

Parameters:

Contacts

Method: get

Description: Retrieves a specific contact..

Endpoint: /Contacts/{id}

Parameters:

Contacts/{id}

Method: put

Description: Updates a contact..

Endpoint: /Contacts/{id}

Parameters:

Contacts/{id}

Method: delete

Description: Deletes a contact..

Endpoint: /Contacts/{id}

Parameters:

Contacts/{id}/attachments

Method: get

Description: Retrieves a list of attachments for a given contact..

Endpoint: /Contacts/{id}/Attachments

Parameters:

Contacts/{id}/attachments

Method: post

Description: Uploads an attachment to a contact..

Endpoint: /Contacts/{id}/Attachments

Parameters:

CreditNotes

Method: get

Description: Retrieves a list of credit notes..

Endpoint: /CreditNotes

Parameters:

CreditNotes

Method: get

Description: Retrieves a specific credit note..

Endpoint: /CreditNotes/{creditNoteId}

Parameters:

CreditNotes/{id}

Method: put

Description: Updates a specific credit note..

Endpoint: /CreditNotes/{id}?

Parameters:

CreditNotes/{id}

Method: delete

Description: Deletes a specific credit note..

Endpoint: /CreditNotes/{id}

Parameters:

Currencies

Method: get

Description: Retrieves a list of currencies..

Endpoint: /Currencies

Parameters:

Currencies

Method: get

Description: Retrieves a specific currency..

Endpoint: /Currencies/{currencyCode}

Parameters:

EmployeeGroups

Method: get

Description: Retrieves a list of employee groups..

Endpoint: /EmployeeGroups

Parameters:

EmployeeGroups

Method: get

Description: Retrieves a specific employee group..

Endpoint: /EmployeeGroups/{id}

Parameters:

Employees

Method: get

Description: Retrieves a list of employees..

Endpoint: /Employees

Parameters:

Employees

Method: get

Description: Retrieves a specific employee..

Endpoint: /Employees/{id}

Parameters:

Employees/{id}

Method: put

Description: Updates a specific employee..

Endpoint: /Employees/{id}

Parameters:

Employees/{id}

Method: delete

Description: Deletes a specific employee..

Endpoint: /Employees/{id}

Parameters:

ExpenseClaims

Method: get

Description: Retrieves a list of expense claims..

Endpoint: /ExpenseClaims

Parameters:

ExpenseClaims

Method: get

Description: Retrieves a specific expense claim..

Endpoint: /ExpenseClaims/{id}

Parameters:

ExpenseClaims/{id}

Method: put

Description: Updates a specific expense claim..

Endpoint: /ExpenseClaims/{id}

Parameters:

ExpenseClaims/{id}

Method: delete

Description: Deletes a specific expense claim..

Endpoint: /ExpenseClaims/{id}

Parameters:

FixedAssets

Method: get

Description: Retrieves a list of fixed assets..

Endpoint: /FixedAssets

Parameters:

FixedAssets

Method: get

Description: Retrieves a specific fixed asset..

Endpoint: /FixedAssets/{id}

Parameters:

FixedAssets/{id}

Method: put

Description: Updates a specific fixed asset..

Endpoint: /FixedAssets/{id}

Parameters:

FixedAssets/{id}

Method: delete

Description: Deletes a specific fixed asset..

Endpoint: /FixedAssets/{id}

Parameters:

HistoryRecords

Method: get

Description: Retrieves a list of history records..

Endpoint: /HistoryRecords

Parameters:

HistoryRecords

Method: get

Description: Retrieves a specific history record..

Endpoint: /HistoryRecords/{id}

Parameters:

Invoices

Method: get

Description: Retrieves a list of invoices..

Endpoint: /Invoices

Parameters:

Invoices

Method: get

Description: Retrieves a specific invoice..

Endpoint: /Invoices/{invoiceId}

Parameters:

Invoices/{id}

Method: put

Description: Updates a specific invoice..

Endpoint: /Invoices/{id}?

Parameters:

Invoices/{id}

Method: delete

Description: Deletes a specific invoice..

Endpoint: /Invoices/{id}

Parameters:

ItemGroups

Method: get

Description: Retrieves a list of item groups..

Endpoint: /ItemGroups

Parameters:

ItemGroups

Method: get

Description: Retrieves a specific item group..

Endpoint: /ItemGroups/{id}

Parameters:

Items

Method: get

Description: Retrieves a list of items..

Endpoint: /Items

Parameters:

Items

Method: get

Description: Retrieves a specific item..

Endpoint: /Items/{id}

Parameters:

Items/{id}

Method: put

Description: Updates a specific item..

Endpoint: /Items/{id}?

Parameters:

Items/{id}

Method: delete

Description: Deletes a specific item..

Endpoint: /Items/{id}

Parameters:

JournalEntries

Method: get

Description: Retrieves a list of journal entries..

Endpoint: /JournalEntries

Parameters:

JournalEntries

Method: get

Description: Retrieves a specific journal entry..

Endpoint: /JournalEntries/{id}

Parameters:

JournalEntries/{id}

Method: put

Description: Updates a specific journal entry..

Endpoint: /JournalEntries/{id}

Parameters:

JournalEntries/{id}

Method: delete

Description: Deletes a specific journal entry..

Endpoint: /JournalEntries/{id}

Parameters:

Journals

Method: get

Description: Retrieves a list of journals..

Endpoint: /Journals

Parameters:

Journals

Method: get

Description: Retrieves a specific journal..

Endpoint: /Journals/{id}

Parameters:

LinkedTransactions

Method: get

Description: Retrieves a list of linked transactions for a given transaction..

Endpoint: /LinkedTransactions

Parameters:

ManualJournals

Method: get

Description: Retrieves a list of manual journals..

Endpoint: /ManualJournals

Parameters:

ManualJournals

Method: get

Description: Retrieves a specific manual journal..

Endpoint: /ManualJournals/{id}

Parameters:

ManualJournals/{id}

Method: put

Description: Updates a specific manual journal..

Endpoint: /ManualJournals/{id}

Parameters:

ManualJournals/{id}

Method: delete

Description: Deletes a specific manual journal..

Endpoint: /ManualJournals/{id}

Parameters:

Organisation

Method: get

Description: Retrieves information about the specified organisation..

Endpoint: /Organisation

Parameters:

Organisation

Method: post

Description: Creates a new organisation..

Endpoint: /Organisation

Parameters:

Organisations

Method: get

Description: Retrieves a list of organisations..

Endpoint: /Organisations

Parameters:

Overpayments

Method: get

Description: Retrieves a list of overpayments..

Endpoint: /Overpayments

Parameters:

Overpayments

Method: get

Description: Retrieves a specific overpayment..

Endpoint: /Overpayments/{overpaymentId}

Parameters:

Payments

Method: get

Description: Retrieves a list of payments..

Endpoint: /Payments

Parameters:

Payments

Method: get

Description: Retrieves a specific payment..

Endpoint: /Payments/{id}

Parameters:

Payments/{id}

Method: put

Description: Updates a specific payment..

Endpoint: /Payments/{id}?

Parameters:

Payments/{id}

Method: delete

Description: Deletes a specific payment..

Endpoint: /Payments/{id}

Parameters:

Prepayments

Method: get

Description: Retrieves a list of prepayments..

Endpoint: /Prepayments

Parameters:

Prepayments

Method: get

Description: Retrieves a specific prepayment..

Endpoint: /Prepayments/{prepaymentId}

Parameters:

PurchaseOrders

Method: get

Description: Retrieves a list of purchase orders..

Endpoint: /PurchaseOrders

Parameters:

PurchaseOrders

Method: get

Description: Retrieves a specific purchase order..

Endpoint: /PurchaseOrders/{purchaseOrderId}

Parameters:

PurchaseOrders/{id}

Method: put

Description: Updates a specific purchase order..

Endpoint: /PurchaseOrders/{id}?

Parameters:

PurchaseOrders/{id}

Method: delete

Description: Deletes a specific purchase order..

Endpoint: /PurchaseOrders/{id}

Parameters:

Quotes

Method: get

Description: Retrieves a list of quotes..

Endpoint: /Quotes

Parameters:

Quotes

Method: get

Description: Retrieves a specific quote..

Endpoint: /Quotes/{quoteId}

Parameters:

Quotes/{id}

Method: put

Description: Updates a specific quote..

Endpoint: /Quotes/{id}?

Parameters:

Quotes/{id}

Method: delete

Description: Deletes a specific quote..

Endpoint: /Quotes/{id}

Parameters:

Receipts

Method: get

Description: Retrieves a list of receipts..

Endpoint: /Receipts

Parameters:

Receipts

Method: post

Description: Creates a receipt..

Endpoint: /Receipts

Parameters:

Receipts

Method: get

Description: Retrieves a specific receipt..

Endpoint: /Receipts/{receiptId}

Parameters:

Receipts/{id}

Method: put

Description: Updates a specific receipt..

Endpoint: /Receipts/{id}?

Parameters:

Receipts/{id}

Method: delete

Description: Deletes a specific receipt..

Endpoint: /Receipts/{id}

Parameters:

Reports

Method: get

Description: Retrieves a list of available reports..

Endpoint: /Reports

Parameters:

Reports

Method: get

Description: Retrieves a specific report..

Endpoint: /Reports/{reportId}

Parameters:

Reports/{id}

Method: put

Description: Updates a specific report..

Endpoint: /Reports/{id}

Parameters:

Reports/{id}

Method: delete

Description: Deletes a specific report..

Endpoint: /Reports/{id}

Parameters:

TaxRates

Method: get

Description: Retrieves a list of tax rates..

Endpoint: /TaxRates

Parameters:

TaxRates

Method: get

Description: Retrieves a specific tax rate..

Endpoint: /TaxRates/{taxRateId}

Parameters:

TrackingCategories

Method: get

Description: Retrieves a list of tracking categories..

Endpoint: /TrackingCategories

Parameters:

TrackingCategories

Method: get

Description: Retrieves a specific tracking category..

Endpoint: /TrackingCategories/{id}

Parameters:

TrackingOptions

Method: get

Description: Retrieves a list of tracking options..

Endpoint: /TrackingOptions

Parameters:

TrackingOptions

Method: get

Description: Retrieves a specific tracking option..

Endpoint: /TrackingOptions/{id}

Parameters:

Transfer

Method: get

Description: Retrieves a list of transfers..

Endpoint: /Transfer

Parameters:

Transfer

Method: get

Description: Retrieves a specific transfer..

Endpoint: /Transfer/{id}

Parameters:

Transfer/{id}

Method: put

Description: Updates a specific transfer..

Endpoint: /Transfer/{id}

Parameters:

Transfer/{id}

Method: delete

Description: Deletes a specific transfer..

Endpoint: /Transfer/{id}

Parameters:

UnitOfMeasures

Method: get

Description: Retrieves a list of units of measure..

Endpoint: /UnitOfMeasures

Parameters:

FAQ

How do I authenticate with Xero API?

Use OAuth 2.0 to authenticate and authorize your application. Obtain a consumer key and secret from the Xero developer portal.

What are the rate limits for Xero API?

Rate limits vary depending on API endpoint. Refer to the Xero API documentation for specific limits for each endpoint.

How do I get a sandbox account for testing?

Sign up for a free Xero developer account. Create a new organization within the developer account and select the 'Sandbox' option.

How do I handle API errors?

Xero API returns errors in JSON format. Handle errors by checking the 'error' key in the response and taking appropriate actions based on the error code and message.

How do I use a private key for authentication?

Generate a private key using an RSA or ECDSA algorithm. Use the private key to create a JWT (JSON Web Token) and pass it in the 'Authorization' header of API requests.

Last Update: September 02, 2024