Ability to Sell Series Regular Packages in API
This API allows you to save the list of regular packages or offer packages which are available for sale at a center.
You must specify the unique identifier for guest_id, center_id, notes, and packages in the API request
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/packages
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| guest_id | string | No | Guest guid |
| center_id | string | No | centers' guid |
| notes | string | No | invoice notes |
| package_details | object[] | No | list of series regular package ids. |
Response
Success (201 Created)
{
"invoice_id": "b8ba6485-b6d2-4681-ad56-8325bdb87955",
"invoice_number": "561"
}
Response fields
| Field | Type | Description |
|---|---|---|
| invoice_id | string | |
| invoice_number | string |
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/invoices/packages' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"guest_id": "string",
"center_id": "string",
"notes": "string",
"package_details": [
{
"...": "..."
}
]
}'
const response = await fetch('https://api.zenoti.com/v1/invoices/packages', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
guest_id: 'string',
center_id: 'string',
notes: 'string',
package_details: [
{ '...': '...' }
]
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/v1/invoices/packages',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={'guest_id': 'string', 'center_id': 'string', 'notes': 'string', 'package_details': [{'...': '...'}]}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new {
guest_id = "string",
center_id = "string",
notes = "string",
package_details = new[] {
new { ... = "..." }
}
}),
Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.zenoti.com/v1/invoices/packages", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/invoices/packages')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
request['Content-Type'] = 'application/json'
request.body = { guest_id: 'string', center_id: 'string', notes: 'string', package_details: [{ ...: '...' }] }.to_json
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 |