The Xero Payroll API is a RESTful web service and uses the OAuth (v1.0a) protocol to authenticate 3rd party applications.
The Payroll API exposes payroll related functions of the Xero payroll application and can be used for a variety of purposes such as syncing employee details, importing timesheets etc.
NZ Xero organisations (including the sample Demo company) must have concluded the payroll setup steps before the Payroll API can be used.
In order to authorise
any API connection the Xero user must have the
Standard or
Adviser role.
In addition, only Xero users with
payroll administrator access can authorise access to payroll endpoints.
The base url for all payroll endpoints is https://api.xero.com/payroll.xro/2.0/
e.g. The URL for the Employees endpoint is https://api.xero.com/payroll.xro/2.0/employees
The Payroll API is currently version 2.0
All payroll endpoints have paginating results. A maximum of 100 records will be returned per request. To fetch the second page append a page parameter to the URL e.g. ?page=2. If there are 100 records in the response you will need to check if there is any more data by fetching the next page.
See the Types and Codes applicable for use with the Payroll API endpoints.
See the HTTP Response Codes and Errors applicable for the Payroll API endpoints.
The Payroll API has it's own section of our feature request forum - please feel free to suggest any features that you would like to see added to this API.