Create bookings of service bundles and day packages
This API creates bookings of service bundles and day packages and also supports couple bookings.
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 /{api_url}/v1/bookings
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| is_couple_booking | string | No | — | Identifies if a booking being made is for a couple |
Response
Success (201 Created)
{
"id": "0e1dd3f5-5468-43a0-8a49-16895944b7c4",
"Error": {}
}
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | |
| Error | object |
Example
curl --request POST \
--url 'https://api.zenoti.com/{api_url}/v1/bookings' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{}'
const response = await fetch('https://api.zenoti.com/{api_url}/v1/bookings', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/{api_url}/v1/bookings',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new { }),
Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.zenoti.com/{api_url}/v1/bookings", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/{api_url}/v1/bookings')
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 = {}.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 |