Skip to content

Xero Accounting API API

by xero.com

OAuthHTTPSFinance
Open documentation ↗

Overview

Join a vibrant community of developers whose integrations with Xero are shaping the future of small businesses globally. Xero Developer: Powering Your Innovation and Growth!

Xero Accounting API is a finance API from xero.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 224 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Finance
Base URL
https://api.xero.com/api.xro/2.0
Version
2.9.4
Endpoints
224
Spec updated
2021-02-25

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.xero.com/api.xro/2.0/Accounts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.xero.com/api.xro/2.0/Accounts", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://api.xero.com/api.xro/2.0/Accounts",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/AccountsRetrieves the full chart of accounts
PUT/AccountsCreates a new chart of accounts
GET/Accounts/{AccountID}Retrieves a single chart of accounts by using a unique account Id
POST/Accounts/{AccountID}Updates a chart of accounts
DELETE/Accounts/{AccountID}Deletes a chart of accounts
GET/Accounts/{AccountID}/AttachmentsRetrieves attachments for a specific accounts by using a unique account Id
GET/Accounts/{AccountID}/Attachments/{AttachmentID}Retrieves a specific attachment from a specific account using a unique attachment Id
GET/Accounts/{AccountID}/Attachments/{FileName}Retrieves an attachment for a specific account by filename
POST/Accounts/{AccountID}/Attachments/{FileName}Updates attachment on a specific account by filename
PUT/Accounts/{AccountID}/Attachments/{FileName}Creates an attachment on a specific account
GET/BankTransactionsRetrieves any spent or received money transactions
POST/BankTransactionsUpdates or creates one or more spent or received money transaction
PUT/BankTransactionsCreates one or more spent or received money transaction
GET/BankTransactions/{BankTransactionID}Retrieves a single spent or received money transaction by using a unique bank transaction Id
POST/BankTransactions/{BankTransactionID}Updates a single spent or received money transaction
GET/BankTransactions/{BankTransactionID}/AttachmentsRetrieves any attachments from a specific bank transactions
GET/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}Retrieves specific attachments from a specific BankTransaction using a unique attachment Id
GET/BankTransactions/{BankTransactionID}/Attachments/{FileName}Retrieves a specific attachment from a specific bank transaction by filename
POST/BankTransactions/{BankTransactionID}/Attachments/{FileName}Updates a specific attachment from a specific bank transaction by filename
PUT/BankTransactions/{BankTransactionID}/Attachments/{FileName}Creates an attachment for a specific bank transaction by filename
GET/BankTransactions/{BankTransactionID}/HistoryRetrieves history from a specific bank transaction using a unique bank transaction Id
PUT/BankTransactions/{BankTransactionID}/HistoryCreates a history record for a specific bank transactions
GET/BankTransfersRetrieves all bank transfers
PUT/BankTransfersCreates a bank transfer
GET/BankTransfers/{BankTransferID}Retrieves specific bank transfers by using a unique bank transfer Id
GET/BankTransfers/{BankTransferID}/AttachmentsRetrieves attachments from a specific bank transfer
GET/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}Retrieves a specific attachment from a specific bank transfer using a unique attachment ID
GET/BankTransfers/{BankTransferID}/Attachments/{FileName}Retrieves a specific attachment on a specific bank transfer by file name
POST/BankTransfers/{BankTransferID}/Attachments/{FileName}updateBankTransferAttachmentByFileName
PUT/BankTransfers/{BankTransferID}/Attachments/{FileName}createBankTransferAttachmentByFileName
GET/BankTransfers/{BankTransferID}/HistoryRetrieves history from a specific bank transfer using a unique bank transfer Id
PUT/BankTransfers/{BankTransferID}/HistoryCreates a history record for a specific bank transfer
GET/BatchPaymentsRetrieves either one or many batch payments for invoices
PUT/BatchPaymentsCreates one or many batch payments for invoices
GET/BatchPayments/{BatchPaymentID}/HistoryRetrieves history from a specific batch payment
PUT/BatchPayments/{BatchPaymentID}/HistoryCreates a history record for a specific batch payment
GET/BrandingThemesRetrieves all the branding themes
GET/BrandingThemes/{BrandingThemeID}Retrieves a specific branding theme using a unique branding theme Id
GET/BrandingThemes/{BrandingThemeID}/PaymentServicesRetrieves the payment services for a specific branding theme
POST/BrandingThemes/{BrandingThemeID}/PaymentServicesCreates a new custom payment service for a specific branding theme
GET/ContactGroupsRetrieves the contact Id and name of all the contacts in a contact group
PUT/ContactGroupsCreates a contact group
GET/ContactGroups/{ContactGroupID}Retrieves a specific contact group by using a unique contact group Id
POST/ContactGroups/{ContactGroupID}Updates a specific contact group
PUT/ContactGroups/{ContactGroupID}/ContactsCreates contacts to a specific contact group
DELETE/ContactGroups/{ContactGroupID}/ContactsDeletes all contacts from a specific contact group
DELETE/ContactGroups/{ContactGroupID}/Contacts/{ContactID}Deletes a specific contact from a contact group using a unique contact Id
GET/ContactsRetrieves all contacts in a Xero organisation
POST/ContactsUpdates or creates one or more contacts in a Xero organisation
PUT/ContactsCreates multiple contacts (bulk) in a Xero organisation
GET/Contacts/{ContactID}Retrieves a specific contacts in a Xero organisation using a unique contact Id
POST/Contacts/{ContactID}Updates a specific contact in a Xero organisation
GET/Contacts/{ContactID}/AttachmentsRetrieves attachments for a specific contact in a Xero organisation
GET/Contacts/{ContactID}/Attachments/{AttachmentID}Retrieves a specific attachment from a specific contact using a unique attachment Id
GET/Contacts/{ContactID}/Attachments/{FileName}Retrieves a specific attachment from a specific contact by file name
POST/Contacts/{ContactID}/Attachments/{FileName}updateContactAttachmentByFileName
PUT/Contacts/{ContactID}/Attachments/{FileName}createContactAttachmentByFileName
GET/Contacts/{ContactID}/CISSettingsRetrieves CIS settings for a specific contact in a Xero organisation
GET/Contacts/{ContactID}/HistoryRetrieves history records for a specific contact
PUT/Contacts/{ContactID}/HistoryCreates a new history record for a specific contact
GET/Contacts/{ContactNumber}Retrieves a specific contact by contact number in a Xero organisation
GET/CreditNotesRetrieves any credit notes
POST/CreditNotesUpdates or creates one or more credit notes
PUT/CreditNotesCreates a new credit note
GET/CreditNotes/{CreditNoteID}Retrieves a specific credit note using a unique credit note Id
POST/CreditNotes/{CreditNoteID}Updates a specific credit note
PUT/CreditNotes/{CreditNoteID}/AllocationsCreates allocation for a specific credit note
GET/CreditNotes/{CreditNoteID}/AttachmentsRetrieves attachments for a specific credit notes
GET/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}Retrieves a specific attachment from a specific credit note using a unique attachment Id
GET/CreditNotes/{CreditNoteID}/Attachments/{FileName}Retrieves a specific attachment on a specific credit note by file name
POST/CreditNotes/{CreditNoteID}/Attachments/{FileName}Updates attachments on a specific credit note by file name
PUT/CreditNotes/{CreditNoteID}/Attachments/{FileName}Creates an attachment for a specific credit note
GET/CreditNotes/{CreditNoteID}/HistoryRetrieves history records of a specific credit note
PUT/CreditNotes/{CreditNoteID}/HistoryRetrieves history records of a specific credit note
GET/CreditNotes/{CreditNoteID}/pdfRetrieves credit notes as PDF files
GET/CurrenciesRetrieves currencies for your Xero organisation
PUT/CurrenciesCreate a new currency for a Xero organisation
GET/EmployeesRetrieves employees used in Xero payrun
POST/EmployeesCreates a single new employees used in Xero payrun
PUT/EmployeesCreates new employees used in Xero payrun
GET/Employees/{EmployeeID}Retrieves a specific employee used in Xero payrun using a unique employee Id
GET/ExpenseClaimsRetrieves expense claims
PUT/ExpenseClaimsCreates expense claims
GET/ExpenseClaims/{ExpenseClaimID}Retrieves a specific expense claim using a unique expense claim Id
POST/ExpenseClaims/{ExpenseClaimID}Updates a specific expense claims
GET/ExpenseClaims/{ExpenseClaimID}/HistoryRetrieves history records of a specific expense claim
PUT/ExpenseClaims/{ExpenseClaimID}/HistoryCreates a history record for a specific expense claim
GET/InvoiceReminders/SettingsRetrieves invoice reminder settings
GET/InvoicesRetrieves sales invoices or purchase bills
POST/InvoicesUpdates or creates one or more sales invoices or purchase bills
PUT/InvoicesCreates one or more sales invoices or purchase bills
GET/Invoices/{InvoiceID}Retrieves a specific sales invoice or purchase bill using a unique invoice Id
POST/Invoices/{InvoiceID}Updates a specific sales invoices or purchase bills
GET/Invoices/{InvoiceID}/AttachmentsRetrieves attachments for a specific invoice or purchase bill
GET/Invoices/{InvoiceID}/Attachments/{AttachmentID}Retrieves a specific attachment from a specific invoices or purchase bills by using a unique attachment Id
GET/Invoices/{InvoiceID}/Attachments/{FileName}Retrieves an attachment from a specific invoice or purchase bill by filename
POST/Invoices/{InvoiceID}/Attachments/{FileName}Updates an attachment from a specific invoices or purchase bill by filename
PUT/Invoices/{InvoiceID}/Attachments/{FileName}Creates an attachment for a specific invoice or purchase bill by filename
POST/Invoices/{InvoiceID}/EmailSends a copy of a specific invoice to related contact via email
GET/Invoices/{InvoiceID}/HistoryRetrieves history records for a specific invoice

Showing the first 100 of 224 endpoints; the full list is in the documentation.

Questions

Does the Xero Accounting API API need an API key?

Yes. The Xero Accounting API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Xero Accounting API API support HTTPS?

Yes, the Xero Accounting API API is served over HTTPS.

How many endpoints does the Xero Accounting API API have?

Its OpenAPI description lists 224 endpoints in version 2.9.4. The first 100 are shown on this page.

What are alternatives to the Xero Accounting API API?

Other Finance APIs include Stripe, SEC EDGAR Data, Plaid, Fed Treasury, Razorpay IFSC.

Compare alternatives →

Listed from APIs.guru (CC0).