Send it in API Explorer
- Export or copy the numbers of the invoices you want to void. Check the list twice: a voided invoice can't be restored.
- Build the JSON above.
- Open api-explorer.xero.com, sign in with your Xero login and allow access. Pick the organisation at the top right, and check its name before you send anything.
- Choose API Xero Accounting API, endpoint Invoices and operation Update Or Create Invoices. The request line should read
POST/Invoices. - Paste the first request, the single test invoice, into Payload and click Make request. Check the response, then open that invoice in Xero and confirm its status changed to void.
- Only then send the remaining requests, one at a time, and read each response for errors.
Voiding can't be undone, and the number of a voided invoice can't be used again. If you need a number back, change it on the invoice before you void it.
Xero's rules
From Xero's Invoices API documentation:
- Approved invoices are voided, not deleted. An
AUTHORISEDinvoice can only change toVOIDED. Drafts and submitted (Awaiting Approval) invoices can be set toDELETED. - No payments. Xero's voiding example is for an approved invoice with no payments applied. Remove payments in Xero first; invoices in a locked period can't be updated at all.
- About 50 per request. There's no fixed count, but Xero calls about 50 per request practical, to stay under the 3.5 MB request limit.
- Rate limits. 60 calls per minute and 5 at a time per organisation, so send the batches one after another.
- Errors per invoice. If you can add the
SummarizeErrors=falseparameter, Xero returns a status and any validation errors for each invoice instead of failing the whole batch.
Sources: Xero Invoices API, Xero API limits.
Without the JSON
API Explorer works well if you're comfortable with it. If you'd rather not touch the API, Bulk Void does the same job from Xero's own invoice list. What each one needs:
| Step | API Explorer + this builder | Bulk Void |
|---|---|---|
| Access | Sign in to API Explorer and allow it access to your organisation | Works in your logged-in Xero tab, no API access |
| Choosing invoices | Copy the invoice numbers into a list | Tick them on the Awaiting Payment tab |
| Sending | One request per 50 invoices, pasted and sent by you | One run for the whole selection |
| Backup | Export it yourself before you start | Saved as a CSV before the run |
| Invoices with payments | Returned as errors in the response | Payments removed first if you turn that on, otherwise skipped. Listed in a dry run first |
| Cost | Free | 5 invoices free, then $29 per organisation |
Bulk Void for Xero
- Tick invoices on the Awaiting Payment tab and click Bulk Void.
- It saves a backup CSV first and shows a dry run.
- Invoices with payments are skipped and listed, unless you turn on “Include invoices with payments”.
- No API connection: it works in your logged-in browser.
Questions
Can the Xero API void invoices that have payments?
Not this way. Xero's documentation shows voiding for an approved invoice with no payments applied. Deal with invoices that have payments in Xero first, in the way that's right for your books.
How many invoices can I send in one request?
Xero sets no fixed count, but says about 50 per request is practical so a request stays under the 3.5 MB limit. This builder splits your list into batches of 50.
Should I use VOIDED or DELETED?
VOIDED for approved (Awaiting Payment) invoices, DELETED for Draft and Awaiting Approval invoices. Xero doesn't let you delete an approved invoice.
Does this work for bills?
Use it for sales invoices. Bill numbers don't have to be unique in Xero, so a number may match more than one bill, and Xero already lets you void Awaiting Payment bills in bulk from the bills list.