Reserve a slot for a service booking

POST https://api.zenoti.com/v1/bookings/{booking_id}/slots/reserve

This API helps you to reserve a slot for the specified service booking (booking_id).You can also use this API to reserve a slot for the required group service booking (booking_id).You can choose a specific therapist or a therapist based on a certain gender while creating a service booking; after which, a unique 32-digit booking_id is generated.You must then specify the generated booking_id in the API request. You can also provide appropriate details for the slot_time parameter in the API request body to reserve a slot for the service booking.After you have reserved a slot for the service booking, you can then proceed to confirm the service booking.This API also allows guests to reserve appointments for family members. Provided, there is a relationship defined in Zenoti and an appointment reservation can only be done by the host. Note: Invoice id is not generated in this step by default, It is generated only when you confirm a reservation with confirm a service booking API call. you can generate an temporary invoice in reserve slot API by using the create_invoice flag in the request body.

Before you begin

Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.

Endpoint

POST /v1/bookings/{booking_id}/slots/reserve

Base URL: https://api.zenoti.com

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
booking_id string Yes Mandatory Unique 32-character identifier of the service booking.

Request body

Field Type Required Description
slot_time string (date) No date time of the slot
notes string No Takes invoice notes
create_invoice boolean No Parameter to define if invoice is to be created or not, default is false. Pass true if you need an invoice.

Response

Success (201 Created)

{
  "is_reserved": true,
  "reservation_id": "5ea5439b-5f0e-4dbb-8c3c-114e44248b35",
  "expiry_time": "2025-01-07T16:46:50",
  "blocking_time": 5,
  "invoices": [
    {
      "...": "..."
    }
  ],
  "error": {}
}

Response fields

Field Type Description
is_reserved boolean
reservation_id string
expiry_time string
blocking_time integer
invoices object[]
invoices[].guest object
invoices[].invoice_id string
invoices[].items object[]
error object

Example

curl --request POST \
  --url 'https://api.zenoti.com/v1/bookings/{booking_id}/slots/reserve' \
  --header 'Authorization: bearer {{access_token}}' \
  --header 'Content-Type: application/json' \
  --data '{
  "slot_time": "2020-06-15T05:50:58",
  "notes": "string",
  "create_invoice": false
}'
const response = await fetch('https://api.zenoti.com/v1/bookings/{booking_id}/slots/reserve', {
  method: 'POST',
  headers: {
    'Authorization': 'bearer {{access_token}}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ slot_time: '2020-06-15T05:50:58', notes: 'string', create_invoice: false })
});
const data = await response.json();
import requests

response = requests.post(
    'https://api.zenoti.com/v1/bookings/{booking_id}/slots/reserve',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
    json={'slot_time': '2020-06-15T05:50:58', 'notes': 'string', 'create_invoice': False}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
    JsonSerializer.Serialize(new { slot_time = "2020-06-15T05:50:58", notes = "string", create_invoice = false }),
    Encoding.UTF8, "application/json");
var response = await client.PostAsync(
    "https://api.zenoti.com/v1/bookings/{booking_id}/slots/reserve", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/bookings/{booking_id}/slots/reserve')
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 = { slot_time: '2020-06-15T05:50:58', notes: 'string', create_invoice: false }.to_json
response = http.request(request)
data = JSON.parse(response.body)

Error codes

Status Description
401 Unauthorized -- invalid or expired access token
429 Too many requests -- rate limit exceeded