Delete a product from an invoice
Use this API to delete a product from an invoice.
Provide unique identifiers of the invoice as invoice_id and invoice_item_id of the product you want to delete from the invoice and this API will delete that from the invoice.
Note: Comments are either mandatory or optional based on your configuration. If the comments are optional, then pass "comments" as an empty string ("") in the body of the API.
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
DELETE /v1/invoices/{invoice_id}/invoiceitems/{invoice_item_id}
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 identifier of the invoice from which you want to delete a product. |
| invoice_item_id | string | Yes | Mandatory Unique 32-character identifier of the invoice item or product that you want to delete from the invoice. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| comments | string | No | Comments from guest. |
Response
Success (204 No Content)
{
"success": true,
"message": "null",
"error": {}
}
Response fields
| Field | Type | Description |
|---|---|---|
| success | boolean | |
| message | string | |
| error | object |
Example
curl --request DELETE \
--url 'https://api.zenoti.com/v1/invoices/{invoice_id}/invoiceitems/{invoice_item_id}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/invoices/{invoice_id}/invoiceitems/{invoice_item_id}', {
method: 'DELETE',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.delete(
'https://api.zenoti.com/v1/invoices/{invoice_id}/invoiceitems/{invoice_item_id}',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.DeleteAsync(
"https://api.zenoti.com/v1/invoices/{invoice_id}/invoiceitems/{invoice_item_id}");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/invoices/{invoice_id}/invoiceitems/{invoice_item_id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.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 |