Cancel a service booking
Use this API to cancel a service booking.
You must specify the invoice_id parameter, and this API will cancel all the appointments and purchases associated with the invoice.
This API also allows guests to cancel service bookings of family members. Provided, there is a relationship defined in Zenoti and only the host can cancel the service booking of family members.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
PUT /v1/invoices/{invoice_id}/cancel
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 | Yes | Mandatory Unique 32-character of the invoice that contains the appointments that you want to cancel. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| comments | string | No | — | Optional Reasons for the cancellation. Note: Comments will be Mandatory or Optional depending on your configuration. |
Response
Success (200 OK)
{
"success": true,
"is_charge_applied": false
}
Response fields
| Field | Type | Description |
|---|---|---|
| success | boolean | |
| is_charge_applied | boolean |
Example
curl --request PUT \
--url 'https://api.zenoti.com/v1/invoices/{invoice_id}/cancel' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/invoices/{invoice_id}/cancel', {
method: 'PUT',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.put(
'https://api.zenoti.com/v1/invoices/{invoice_id}/cancel',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.PutAsync(
"https://api.zenoti.com/v1/invoices/{invoice_id}/cancel");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/invoices/{invoice_id}/cancel')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |