curl --request POST \
--url https://b.anny.co/api/v1/bookings/instant \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add_ons": [
{
"add_on_id": "<string>",
"quantity": 1
}
],
"booking_custom_entry_map": {},
"customer_note": "<string>",
"allow_request": true,
"incognito": true,
"recurring": {
"interval": 2,
"until": "2023-12-25",
"days": [
3
],
"month_day": 16,
"set_pos": 123,
"timezone": "<string>"
}
}
'import requests
url = "https://b.anny.co/api/v1/bookings/instant"
payload = {
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add_ons": [
{
"add_on_id": "<string>",
"quantity": 1
}
],
"booking_custom_entry_map": {},
"customer_note": "<string>",
"allow_request": True,
"incognito": True,
"recurring": {
"interval": 2,
"until": "2023-12-25",
"days": [3],
"month_day": 16,
"set_pos": 123,
"timezone": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
resource_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
service_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
add_ons: [{add_on_id: '<string>', quantity: 1}],
booking_custom_entry_map: {},
customer_note: '<string>',
allow_request: true,
incognito: true,
recurring: {
interval: 2,
until: '2023-12-25',
days: [3],
month_day: 16,
set_pos: 123,
timezone: '<string>'
}
})
};
fetch('https://b.anny.co/api/v1/bookings/instant', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://b.anny.co/api/v1/bookings/instant",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'resource_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'service_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'add_ons' => [
[
'add_on_id' => '<string>',
'quantity' => 1
]
],
'booking_custom_entry_map' => [
],
'customer_note' => '<string>',
'allow_request' => true,
'incognito' => true,
'recurring' => [
'interval' => 2,
'until' => '2023-12-25',
'days' => [
3
],
'month_day' => 16,
'set_pos' => 123,
'timezone' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/bookings/instant"
payload := strings.NewReader("{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add_ons\": [\n {\n \"add_on_id\": \"<string>\",\n \"quantity\": 1\n }\n ],\n \"booking_custom_entry_map\": {},\n \"customer_note\": \"<string>\",\n \"allow_request\": true,\n \"incognito\": true,\n \"recurring\": {\n \"interval\": 2,\n \"until\": \"2023-12-25\",\n \"days\": [\n 3\n ],\n \"month_day\": 16,\n \"set_pos\": 123,\n \"timezone\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://b.anny.co/api/v1/bookings/instant")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add_ons\": [\n {\n \"add_on_id\": \"<string>\",\n \"quantity\": 1\n }\n ],\n \"booking_custom_entry_map\": {},\n \"customer_note\": \"<string>\",\n \"allow_request\": true,\n \"incognito\": true,\n \"recurring\": {\n \"interval\": 2,\n \"until\": \"2023-12-25\",\n \"days\": [\n 3\n ],\n \"month_day\": 16,\n \"set_pos\": 123,\n \"timezone\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/bookings/instant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add_ons\": [\n {\n \"add_on_id\": \"<string>\",\n \"quantity\": 1\n }\n ],\n \"booking_custom_entry_map\": {},\n \"customer_note\": \"<string>\",\n \"allow_request\": true,\n \"incognito\": true,\n \"recurring\": {\n \"interval\": 2,\n \"until\": \"2023-12-25\",\n \"days\": [\n 3\n ],\n \"month_day\": 16,\n \"set_pos\": 123,\n \"timezone\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "bookings",
"id": "booking-uuid",
"attributes": {
"status": "accepted",
"start_date": "2026-04-15T09:00:00+02:00",
"end_date": "2026-04-15T10:00:00+02:00",
"number": "BB12345678"
},
"relationships": {
"resource": {
"data": {
"type": "resources",
"id": "resource-uuid"
}
},
"service": {
"data": {
"type": "services",
"id": "service-uuid"
}
}
}
},
"meta": {
"preview": {
"id": "booking-uuid",
"start_date": "2026-04-15T09:00:00+02:00",
"end_date": "2026-04-15T10:00:00+02:00"
}
}
}Create an instant booking
Auth: customer. Creates and completes a booking immediately without going through the cart flow. Used for authenticated customer and kiosk-like flows. The service must be free and the resource must accept bookings automatically (service meta.supports_instant_booking); with allow_request a resource without automatic acceptance gets a request instead (meta.supports_instant_request). The response meta.preview carries the entry that the booker’s booking previews (GET /api/v1/customer-accounts/{customer_account_id}/booking-previews) list for the new booking, so a client can show it without reloading the previews. When a booking rule of the organization refuses the booking, the 400 error keeps the organization’s own message in code and detail and adds meta.reason booking_rule_exceeded and meta.booking_rule with the rule’s rule_type, max_bookings, time_period and customer_scope.
curl --request POST \
--url https://b.anny.co/api/v1/bookings/instant \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add_ons": [
{
"add_on_id": "<string>",
"quantity": 1
}
],
"booking_custom_entry_map": {},
"customer_note": "<string>",
"allow_request": true,
"incognito": true,
"recurring": {
"interval": 2,
"until": "2023-12-25",
"days": [
3
],
"month_day": 16,
"set_pos": 123,
"timezone": "<string>"
}
}
'import requests
url = "https://b.anny.co/api/v1/bookings/instant"
payload = {
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add_ons": [
{
"add_on_id": "<string>",
"quantity": 1
}
],
"booking_custom_entry_map": {},
"customer_note": "<string>",
"allow_request": True,
"incognito": True,
"recurring": {
"interval": 2,
"until": "2023-12-25",
"days": [3],
"month_day": 16,
"set_pos": 123,
"timezone": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
resource_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
service_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
add_ons: [{add_on_id: '<string>', quantity: 1}],
booking_custom_entry_map: {},
customer_note: '<string>',
allow_request: true,
incognito: true,
recurring: {
interval: 2,
until: '2023-12-25',
days: [3],
month_day: 16,
set_pos: 123,
timezone: '<string>'
}
})
};
fetch('https://b.anny.co/api/v1/bookings/instant', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://b.anny.co/api/v1/bookings/instant",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'resource_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'service_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'add_ons' => [
[
'add_on_id' => '<string>',
'quantity' => 1
]
],
'booking_custom_entry_map' => [
],
'customer_note' => '<string>',
'allow_request' => true,
'incognito' => true,
'recurring' => [
'interval' => 2,
'until' => '2023-12-25',
'days' => [
3
],
'month_day' => 16,
'set_pos' => 123,
'timezone' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/bookings/instant"
payload := strings.NewReader("{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add_ons\": [\n {\n \"add_on_id\": \"<string>\",\n \"quantity\": 1\n }\n ],\n \"booking_custom_entry_map\": {},\n \"customer_note\": \"<string>\",\n \"allow_request\": true,\n \"incognito\": true,\n \"recurring\": {\n \"interval\": 2,\n \"until\": \"2023-12-25\",\n \"days\": [\n 3\n ],\n \"month_day\": 16,\n \"set_pos\": 123,\n \"timezone\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://b.anny.co/api/v1/bookings/instant")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add_ons\": [\n {\n \"add_on_id\": \"<string>\",\n \"quantity\": 1\n }\n ],\n \"booking_custom_entry_map\": {},\n \"customer_note\": \"<string>\",\n \"allow_request\": true,\n \"incognito\": true,\n \"recurring\": {\n \"interval\": 2,\n \"until\": \"2023-12-25\",\n \"days\": [\n 3\n ],\n \"month_day\": 16,\n \"set_pos\": 123,\n \"timezone\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/bookings/instant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add_ons\": [\n {\n \"add_on_id\": \"<string>\",\n \"quantity\": 1\n }\n ],\n \"booking_custom_entry_map\": {},\n \"customer_note\": \"<string>\",\n \"allow_request\": true,\n \"incognito\": true,\n \"recurring\": {\n \"interval\": 2,\n \"until\": \"2023-12-25\",\n \"days\": [\n 3\n ],\n \"month_day\": 16,\n \"set_pos\": 123,\n \"timezone\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "bookings",
"id": "booking-uuid",
"attributes": {
"status": "accepted",
"start_date": "2026-04-15T09:00:00+02:00",
"end_date": "2026-04-15T10:00:00+02:00",
"number": "BB12345678"
},
"relationships": {
"resource": {
"data": {
"type": "resources",
"id": "resource-uuid"
}
},
"service": {
"data": {
"type": "services",
"id": "service-uuid"
}
}
}
},
"meta": {
"preview": {
"id": "booking-uuid",
"start_date": "2026-04-15T09:00:00+02:00",
"end_date": "2026-04-15T10:00:00+02:00"
}
}
}Body
Answers to the service's booking forms as {custom_field_uuid: value}, validated like in the checkout. Answers to questions the form does not show are dropped. If the service requires customer or order details that only the checkout asks for, the request fails with instant_booking_requires_checkout_details.
If true, a free booking on a resource that does not accept bookings automatically is created as a request (status requested) instead of being refused. Needs a service with meta.supports_instant_request. Without the flag such a booking is refused with invalid_instant_booking.
Antwort
Created booking
The response is of type object.