I’m no Zapier expert, but I’ve managed to create an OAuth 2.0 integration with an action that successfully sends an invoice. It did take a few tweaks. I did it via the UI but you could obviously use the CLI tool if you prefer. If anyone has any tips to improve this please let me know!
Create your new Integration and select OAuth 2.0 for your authentication. Set up the redirect url, client id and client secret as normal. Add some scopes (accounting.transactions is required to email an invoice) and the
Tick the option for “I want to automatically refresh on unauthorized error”
For the test endpoint use GET https://api.xero.com/connections
Now, go to Test Authentication and go through the authorization flow to connect your organisation. The response from the test call will include the tenantId which you can copy to your clipboard.

Click “Save and Finish” then go to the Advanced section from the left hand nav. Here you can add a TENANT_ID environment variable and paste in the tenantId value you have in your clipboard.

Now you’ve set up your authorization you can create the action to email an invoice. Click Add Action and fill out the name etc. On the Input Designer tab add InvoiceID as an input field.

Then go to the API Configuration tab and Configure your API Request. Here you’ll need to switch to code mode:

There are three things you’ll need to add/change from the standard template
- Add the InvoiceID input field into the URL
- Add the xero-tenant-id header with the TENANT_ID environment variable
- Hard code a response object e.g. {“Result”:”Success”}. This is because Zapier doesn’t like the empty response body you get back from the Xero API. There’s probably a less hacky way to do this but it does the job.
Now if you test the API request with a valid InvoiceID from your organisation the email will be sent from Xero.
I’ve put my integration up on Github which includes other basic examples like retrieving invoices and creating contacts. Hopefully it's helpful.