A really quick article for anyone who got stumped by the same issue: How to send multiple invoices to Xero in one API call?

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.

Crazy simple solution, your JSON needs to have the key "Invoices" and the list of invoices to create:
{"Invoices":[... list of invoices ...]}
  1.  {"Invoices":[... list of invoices ...]} 
Category: Xero :: Article: 757

Xero API: Standard PHP/cURL Create Invoice

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.

Similar to my ZohoAPI script the process is:
  1. 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.
  2. 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.
  3. Then with the refresh token generate an access token.
  4. Then with the access token get a connection "TenantID".
  5. Then with the tenantID we can retrieve records and/or finally create an invoice (accounts receivables).

Credit where Credit is Due:

Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman

Related Articles

Joes Revolver Map

Joes Word Cloud

name   database   version   find   joomla   search   used   system   display   following   work   creator   function   time   where   parameter   files   uploaded   website   could   error   note   order   mysql   would   windows   source   first   using   form   date   code   table   zoho   file   script   data   need   program   user   server   page   report   added   select   license   list   deluge   value   google   JoelLipman.Com


Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Donate to Joel Lipman via PayPal

Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.