Void an invoice
Voids an open invoice, reversing all associated transactions. Voided invoices cannot be reopened.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (under Administrator) — Required to access Zenoti APIs.
Endpoint
POST /v1/invoices/{invoice_id}/void
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| invoice_id | string (GUID) | Yes | Invoice identifier |
Response
Success (200 OK)
{
"is_voided": true,
"status": -1,
"error": null
}
Response fields
| Field | Type | Description |
|---|---|---|
| is_voided | boolean | Whether the invoice was voided |
| status | integer | Invoice status (-1=Voided) |
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/invoices/a2b3c4d5-e6f7-8901-bcde-f23456789012/void' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/invoices/{invoice_id}/void', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/v1/invoices/{invoice_id}/void',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.PostAsync(
"https://api.zenoti.com/v1/invoices/{invoice_id}/void");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/invoices/{invoice_id}/void')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.zenoti.com/v1/invoices/{invoice_id}/void');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: bearer {{access_token}}'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
Error codes
| Status | Description |
|---|---|
| 401 | Unauthorized — invalid or expired access token |
| 418 | Invoice not found |
| 420 | Invoice is already closed — cannot void |
| 429 | Too many requests — rate limit exceeded (60/min) |