Close an invoice
This API closes the specified invoice. You can only close an invoice after the total invoice amount has been paid in full (which means that the balance amount of the invoice is zero).
You must provide appropriate data for the invoice_id parameter.
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
POST /v1/invoices/{invoice_id}/close
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 ID of the specific invoice. This is a mandatory parameter. |
Response
Success (201 Created)
{
"is_invoice_closed": true,
"error": {},
"status": 11
}
Response fields
| Field | Type | Description |
|---|---|---|
| is_invoice_closed | boolean | |
| error | object | |
| status | integer |
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/invoices/{invoice_id}/close' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/invoices/{invoice_id}/close', {
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}/close',
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}/close");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/invoices/{invoice_id}/close')
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)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |