Xero API: Send Multiple Invoices
- Category: Xero
- Hits: 16698
A really quick article for anyone who got stumped by the same issue: How to send multiple invoices to Xero in one API call?
Why?
Our use-case is in Zoho Deluge which couldn't generate more than 5 invoices in a scheduled task because Xero only allows 5 concurrent connections at one time... And Zoho was trying to send about 7 at a time (as in schedule created 7 Zoho invoices but only 5 Xero invoices). Our solution: Send all Zoho invoices in API call to Xero... apparently it can accept up to 60 invoices in one call.
How?
Crazy simple solution, your JSON needs to have the key "Invoices" and the list of invoices to create:
{"Invoices":[... list of invoices ...]}
Xero API: Standard PHP/cURL Create Invoice
- Category: Xero
- Hits: 2073
This is an article documenting a generic script that can be used to push an invoice to the demo Xero environment. Following the steps below will connect you to the Demonstration environment of Xero at no cost to you the developer.
How?
Similar to my ZohoAPI script the process is:
- Start with a HTML form to add your client ID/client Secret/scopes and Redirect URI. These get stored in a temporary file to retrieve later.
- Then you get a button that will return the "CODE" variable via GET (URL). Clicking on this will get the CODE variable and use it to generate a refresh token.
- Then with the refresh token generate an access token.
- Then with the access token get a connection "TenantID".
- Then with the tenantID we can retrieve records and/or finally create an invoice (accounts receivables).


