Bulk void Xero invoices with API Explorer

Xero won't void Awaiting Payment sales invoices in bulk from its screens, but its API can void approved invoices that have no payments. Paste your invoice numbers below and this page writes the JSON for Xero's API Explorer, split into batches of 50.

It's free and runs in your browser. What you paste never leaves this page.

Updated . Rules from Xero's developer documentation.

JSON builder

One per line, or paste a column from a spreadsheet. Commas and tabs work too. Duplicates and a header row are removed. This page only formats the numbers; it can't check them against your Xero.

What should happen to them?

Rather tick invoices than paste JSON? Bulk Void voids them straight from Xero's Awaiting Payment list, with a backup CSV first. The first 5 invoices are free.

Add to Chrome

Only for sales invoices with no payments applied and outside a locked period. The builder works offline once the page has loaded; what you paste isn't sent anywhere.

Send it in API Explorer

  1. Export or copy the numbers of the invoices you want to void. Check the list twice: a voided invoice can't be restored.
  2. Build the JSON above.
  3. 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.
  4. Choose API Xero Accounting API, endpoint Invoices and operation Update Or Create Invoices. The request line should read POST /Invoices.
  5. 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.
  6. 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 AUTHORISED invoice can only change to VOIDED. Drafts and submitted (Awaiting Approval) invoices can be set to DELETED.
  • 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=false parameter, 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:

StepAPI Explorer + this builderBulk Void
AccessSign in to API Explorer and allow it access to your organisationWorks in your logged-in Xero tab, no API access
Choosing invoicesCopy the invoice numbers into a listTick them on the Awaiting Payment tab
SendingOne request per 50 invoices, pasted and sent by youOne run for the whole selection
BackupExport it yourself before you startSaved as a CSV before the run
Invoices with paymentsReturned as errors in the responsePayments removed first if you turn that on, otherwise skipped. Listed in a dry run first
CostFree5 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.
Add to Chrome: first 5 invoices free

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.

Rather click than code?

Bulk Void saves a backup, shows you a dry run, then voids the whole batch for you.

Add to Chrome

or see how it works