Print

Xero API: Standard PHP/cURL Create Invoice

What?
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:
  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).

Register to read more ...