curl --request POST \
--url https://b.anny.co/api/v1/order/bookings \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"resource_id": "22233",
"service_id": "2800",
"start_date": "2021-10-15T09:00:00+02:00",
"end_date": "2021-10-15T13:00:00+02:00",
"description": "",
"customer_note": "",
"booking_add_ons": [
{
"add_on_id": "239",
"quantity": 3
}
],
"sub_bookings": [
{
"resource_id": "21888",
"service_id": "2777",
"quantity": 1
}
],
"quantity": 1,
"custom_fields": {}
}
'import requests
url = "https://b.anny.co/api/v1/order/bookings"
payload = {
"resource_id": "22233",
"service_id": "2800",
"start_date": "2021-10-15T09:00:00+02:00",
"end_date": "2021-10-15T13:00:00+02:00",
"description": "",
"customer_note": "",
"booking_add_ons": [
{
"add_on_id": "239",
"quantity": 3
}
],
"sub_bookings": [
{
"resource_id": "21888",
"service_id": "2777",
"quantity": 1
}
],
"quantity": 1,
"custom_fields": {}
}
headers = {"Content-Type": "application/vnd.api+json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
resource_id: '22233',
service_id: '2800',
start_date: '2021-10-15T09:00:00+02:00',
end_date: '2021-10-15T13:00:00+02:00',
description: '',
customer_note: '',
booking_add_ons: [{add_on_id: '239', quantity: 3}],
sub_bookings: [{resource_id: '21888', service_id: '2777', quantity: 1}],
quantity: 1,
custom_fields: {}
})
};
fetch('https://b.anny.co/api/v1/order/bookings', 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/order/bookings",
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([
'resource_id' => '22233',
'service_id' => '2800',
'start_date' => '2021-10-15T09:00:00+02:00',
'end_date' => '2021-10-15T13:00:00+02:00',
'description' => '',
'customer_note' => '',
'booking_add_ons' => [
[
'add_on_id' => '239',
'quantity' => 3
]
],
'sub_bookings' => [
[
'resource_id' => '21888',
'service_id' => '2777',
'quantity' => 1
]
],
'quantity' => 1,
'custom_fields' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.api+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/order/bookings"
payload := strings.NewReader("{\n \"resource_id\": \"22233\",\n \"service_id\": \"2800\",\n \"start_date\": \"2021-10-15T09:00:00+02:00\",\n \"end_date\": \"2021-10-15T13:00:00+02:00\",\n \"description\": \"\",\n \"customer_note\": \"\",\n \"booking_add_ons\": [\n {\n \"add_on_id\": \"239\",\n \"quantity\": 3\n }\n ],\n \"sub_bookings\": [\n {\n \"resource_id\": \"21888\",\n \"service_id\": \"2777\",\n \"quantity\": 1\n }\n ],\n \"quantity\": 1,\n \"custom_fields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/vnd.api+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/order/bookings")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"resource_id\": \"22233\",\n \"service_id\": \"2800\",\n \"start_date\": \"2021-10-15T09:00:00+02:00\",\n \"end_date\": \"2021-10-15T13:00:00+02:00\",\n \"description\": \"\",\n \"customer_note\": \"\",\n \"booking_add_ons\": [\n {\n \"add_on_id\": \"239\",\n \"quantity\": 3\n }\n ],\n \"sub_bookings\": [\n {\n \"resource_id\": \"21888\",\n \"service_id\": \"2777\",\n \"quantity\": 1\n }\n ],\n \"quantity\": 1,\n \"custom_fields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/order/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"resource_id\": \"22233\",\n \"service_id\": \"2800\",\n \"start_date\": \"2021-10-15T09:00:00+02:00\",\n \"end_date\": \"2021-10-15T13:00:00+02:00\",\n \"description\": \"\",\n \"customer_note\": \"\",\n \"booking_add_ons\": [\n {\n \"add_on_id\": \"239\",\n \"quantity\": 3\n }\n ],\n \"sub_bookings\": [\n {\n \"resource_id\": \"21888\",\n \"service_id\": \"2777\",\n \"quantity\": 1\n }\n ],\n \"quantity\": 1,\n \"custom_fields\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "orders",
"id": "2012707",
"attributes": {
"number": "BO39099858",
"currency": "EUR",
"total": 277,
"net_amount": 232.77,
"tax_amount": 44.23,
"discount_amount": 0,
"status": "draft",
"access_token": "fCbsam8YHC4Ant65vQ7VCOkY3mFA4D",
"expires_at": "2021-09-24T14:20:50+00:00",
"created_at": "2021-09-24T14:05:50+00:00",
"updated_at": "2021-09-24T14:05:51+00:00"
},
"relationships": {
"bookings": {
"data": [
{
"type": "bookings",
"id": "3717324"
}
]
},
"customer": {
"data": null
},
"sub_orders": {
"data": [
{
"type": "orders",
"id": "2012708"
}
]
}
},
"links": {
"self": "https://b.anny.co/api/v1/orders/2012707"
},
"meta": {
"download_url": "https://b.anny.co/downloads/order-confirmation/2012707?access_token=fCbsam8YHC4Ant65vQ7VCOkY3mFA4D",
"voucher_code": null,
"is_base_order": true,
"payment_flow": "pay-offline",
"pay_now_amount": 0
}
},
"included": [
{
"type": "add-ons",
"id": "239",
"attributes": {
"name": "Vegan Food",
"description": "<p>We will ensure all snacks offered will be vegan.</p>",
"plain_description": "We will ensure all snacks offered will be vegan.",
"customer_notice": "Select # of vegan attendees",
"lead_time": 0,
"is_third_party": false,
"currency": "EUR",
"tax_rate": 19,
"price": 0
}
},
{
"type": "booking-add-ons",
"id": "795",
"attributes": {
"quantity": 3,
"total": 0
},
"relationships": {
"add_on": {
"data": {
"type": "add-ons",
"id": "239"
}
}
}
},
{
"type": "resources",
"id": "22230",
"attributes": {
"slug": "lc",
"name": "Leadership Coach",
"description": null,
"plain_description": "",
"availabilityMode": null,
"continuous": true,
"color": null,
"auto_accept_bookings": true,
"timezone": "Europe/Berlin",
"quantity": 3,
"staggered_quantity": 3,
"max_booking_quantity": 1,
"has_children": true,
"available_from": "2021-08-31T22:00:00+00:00",
"available_to": null
},
"meta": {
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": true,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"meta_settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": true,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"zoom": false
}
},
{
"type": "images",
"id": "8685",
"attributes": {
"url": "https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg",
"copyright": "",
"width": 1920,
"height": 1080,
"order_index": 0,
"preview_image_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgACwAUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+yrP9pGBfDfirVPsVzIPD7zeYgUZlVTEBs3FRuxL0z26mvnb9mb9tSz8P+GfEumX0N/d3P8AaEurwTXs4l/dSyorRMSQQRuU8A8lz7VtfCu3TWdDstNvgbqxm01zJBKSVfBQjPryAfwFfMvh/wAH6Pa+J/iAkVkqJaqEhUO2EBG4gDPqo/Kvs62VU6jaWh8tgM5dJtVI8yt+p91Xn7Wvw3l1O+S71+e1lilCYQuVcbFO5dp6ZJH4UV+cNvpNrq4ee7jaWXeV3b2Xj8CPWisHl1OOlz1v7YnLVJr5n//Z",
"small_path": "https://cdn.booking-buddy.de/public/images/gallery/small/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg",
"medium_path": "https://cdn.booking-buddy.de/public/images/gallery/medium/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg",
"large_path": "https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg",
"created_at": "2021-09-22T13:37:09+00:00"
}
},
{
"type": "resources",
"id": "22233",
"attributes": {
"slug": "6N0sHUrQyfEfDS1ANXNsD05cn3OPxR",
"name": "Corina Abt",
"description": null,
"plain_description": "",
"availabilityMode": null,
"continuous": true,
"color": null,
"auto_accept_bookings": true,
"timezone": "Europe/Berlin",
"quantity": 1,
"staggered_quantity": null,
"max_booking_quantity": 1,
"has_children": false,
"available_from": null,
"available_to": null
},
"relationships": {
"parent": {
"data": {
"type": "resources",
"id": "22230"
}
},
"cover_image": {
"data": {
"type": "images",
"id": "8685"
}
}
},
"meta": {
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": true,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"meta_settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": true,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"zoom": false
}
},
{
"type": "services",
"id": "2800",
"attributes": {
"name": "Coaching: Leadership - Empower Your Employees",
"slug": "jrekqbe74eo9b7bwmursjki3michwt",
"description": null,
"hidden": false,
"is_rental_option": false,
"has_flexible_duration": false,
"auto_duration": false,
"allow_cross_schedule": false,
"requires_booking_description": false,
"requires_address": true,
"requires_mobile": true,
"allow_customer_notes": true,
"allow_more_bookings": true,
"charge_off_schedule": true,
"booking_interval": 240,
"calculation_interval": 240,
"min_duration": 240,
"max_duration": 240,
"uncharged_duration": 0,
"is_full_day": false,
"lead_time": 10080,
"padding_before": 0,
"padding_after": 0,
"advance_booking_period": 31,
"price": 249,
"starting_fee": 0,
"currency": "EUR",
"tax_rate": 19,
"default_weight": 1,
"created_at": "2021-09-22T13:39:17+00:00",
"updated_at": "2021-09-24T12:34:10+00:00",
"access_code": null
},
"meta": {
"resource_list": "Leadership Coach",
"min_duration_total": 249
}
},
{
"type": "resources",
"id": "21888",
"attributes": {
"slug": "c01",
"name": "C01 - London",
"description": "<p>Testbeschreibung C01</p>",
"plain_description": "Testbeschreibung C01",
"availabilityMode": null,
"continuous": true,
"color": null,
"auto_accept_bookings": true,
"timezone": "Europe/Berlin",
"quantity": 1,
"staggered_quantity": null,
"max_booking_quantity": 1,
"has_children": false,
"available_from": "2021-08-31T22:00:00+00:00",
"available_to": null
},
"meta": {
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": true
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"meta_settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": true
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"zoom": false
}
},
{
"type": "services",
"id": "2777",
"attributes": {
"name": "Basic",
"slug": "mvwps18k7e0lifyxl7icid4znqdcwq",
"description": null,
"hidden": false,
"is_rental_option": true,
"has_flexible_duration": true,
"auto_duration": false,
"allow_cross_schedule": false,
"requires_booking_description": false,
"requires_address": true,
"requires_mobile": true,
"allow_customer_notes": true,
"allow_more_bookings": true,
"charge_off_schedule": true,
"booking_interval": 15,
"calculation_interval": 30,
"min_duration": 30,
"max_duration": 480,
"uncharged_duration": 60,
"is_full_day": false,
"lead_time": 60,
"padding_before": 15,
"padding_after": 15,
"advance_booking_period": 31,
"price": 3,
"starting_fee": 10,
"currency": "EUR",
"tax_rate": 19,
"default_weight": 1,
"created_at": "2021-09-20T13:42:16+00:00",
"updated_at": "2021-09-22T10:48:45+00:00",
"access_code": null
},
"meta": {
"resource_list": "C01 - London, M01 - Aachen, M02 - Köln",
"min_duration_total": 10
}
},
{
"type": "bookings",
"id": "3717325",
"attributes": {
"number": "BB23455895",
"status": "reserved",
"is_blocker": false,
"start_date": "2021-10-05T11:00:00+00:00",
"end_date": "2021-10-05T15:00:00+00:00",
"blocker_start_date": "2021-10-05T11:00:00+00:00",
"blocker_end_date": "2021-10-05T15:00:00+00:00",
"description": null,
"charged_duration": 240,
"weight": 1,
"currency": "EUR",
"total": 28,
"code": "IZSZSvmiV6bo7sIt",
"subtotal": 28,
"charged_total": 28,
"charged_subtotal": 28,
"starting_fee": 10,
"customer_note": null,
"created_at": "2021-09-24T14:05:50+00:00",
"canceled_at": null,
"check_in_date": null,
"check_out_date": null,
"custom_entry_map": {}
},
"relationships": {
"resource": {
"data": {
"type": "resources",
"id": "21888"
}
},
"service": {
"data": {
"type": "services",
"id": "2777"
}
}
},
"meta": []
},
{
"type": "bookings",
"id": "3717324",
"attributes": {
"number": "BB93911074",
"status": "reserved",
"is_blocker": false,
"start_date": "2021-10-05T11:00:00+00:00",
"end_date": "2021-10-05T15:00:00+00:00",
"blocker_start_date": "2021-10-05T11:00:00+00:00",
"blocker_end_date": "2021-10-05T15:00:00+00:00",
"description": null,
"charged_duration": 240,
"weight": 1,
"currency": "EUR",
"total": 277,
"code": "bmLbbkY9Ulrs9dHg",
"subtotal": 249,
"charged_total": 277,
"charged_subtotal": 249,
"starting_fee": 0,
"customer_note": null,
"created_at": "2021-09-24T14:05:50+00:00",
"canceled_at": null,
"check_in_date": null,
"check_out_date": null,
"custom_entry_map": {}
},
"relationships": {
"booking_add_ons": {
"data": [
{
"type": "booking-add-ons",
"id": "795"
}
]
},
"resource": {
"data": {
"type": "resources",
"id": "22233"
}
},
"service": {
"data": {
"type": "services",
"id": "2800"
}
},
"sub_bookings": {
"data": [
{
"type": "bookings",
"id": "3717325"
}
]
},
"cancellation_policy": {
"data": null
}
},
"meta": []
},
{
"type": "legal-documents",
"id": "311",
"attributes": {
"title": "T&C Test",
"content": "<p>T&C Test</p>",
"document_type": "terms_and_conditions"
}
},
{
"type": "legal-documents",
"id": "312",
"attributes": {
"title": "Privacy Test",
"content": "<p>Privacy Test</p>",
"document_type": "privacy_policy"
}
},
{
"type": "organizations",
"id": "734",
"attributes": {
"slug": "stadtmitte-buero",
"name": "Stadtmitte Büro",
"live": true,
"description": null,
"plain_description": "",
"official_name": "Workspace GmbH",
"support_email": "florian.schmitt@anny.co",
"phone": null,
"currency": "EUR",
"timezone": "Europe/Berlin",
"is_organization": true,
"responsible_for_contents": "Florian Schmitt",
"ceo": null,
"vat_id": null,
"register_number": null,
"local_court": null,
"financial_office": null
},
"relationships": {
"legal_documents": {
"data": [
{
"type": "legal-documents",
"id": "311"
},
{
"type": "legal-documents",
"id": "312"
}
]
}
},
"meta": {
"settings": {
"organizeResourcesBy": "category",
"checkout": {
"additionalFields": [],
"additionalRequiredFields": []
},
"preferFormalSalutation": false
},
"meta_settings": {
"organizeResourcesBy": "category",
"checkout": {
"additionalFields": [],
"additionalRequiredFields": []
},
"preferFormalSalutation": false
}
}
},
{
"type": "orders",
"id": "2012708",
"attributes": {
"number": "BO99655285",
"currency": "EUR",
"total": 277,
"net_amount": 232.77,
"tax_amount": 44.23,
"discount_amount": 0,
"status": "draft",
"access_token": "pdEQU9LZBqKB7nQnhkbVBBypQJOkXB",
"expires_at": null,
"created_at": "2021-09-24T14:05:50+00:00",
"updated_at": "2021-09-24T14:05:51+00:00"
},
"relationships": {
"bookings": {
"data": [
{
"type": "bookings",
"id": "3717324"
}
]
},
"organization": {
"data": {
"type": "organizations",
"id": "734"
}
}
},
"meta": []
}
]
}Add booking to order
This endpoint allows to add bookings to an order with status “draft”. After the booking has changed the status, no more changes are possible from the customer side. There does not have to exist an order beforehand, because it is created as soon as the first booking is added.
curl --request POST \
--url https://b.anny.co/api/v1/order/bookings \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"resource_id": "22233",
"service_id": "2800",
"start_date": "2021-10-15T09:00:00+02:00",
"end_date": "2021-10-15T13:00:00+02:00",
"description": "",
"customer_note": "",
"booking_add_ons": [
{
"add_on_id": "239",
"quantity": 3
}
],
"sub_bookings": [
{
"resource_id": "21888",
"service_id": "2777",
"quantity": 1
}
],
"quantity": 1,
"custom_fields": {}
}
'import requests
url = "https://b.anny.co/api/v1/order/bookings"
payload = {
"resource_id": "22233",
"service_id": "2800",
"start_date": "2021-10-15T09:00:00+02:00",
"end_date": "2021-10-15T13:00:00+02:00",
"description": "",
"customer_note": "",
"booking_add_ons": [
{
"add_on_id": "239",
"quantity": 3
}
],
"sub_bookings": [
{
"resource_id": "21888",
"service_id": "2777",
"quantity": 1
}
],
"quantity": 1,
"custom_fields": {}
}
headers = {"Content-Type": "application/vnd.api+json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
resource_id: '22233',
service_id: '2800',
start_date: '2021-10-15T09:00:00+02:00',
end_date: '2021-10-15T13:00:00+02:00',
description: '',
customer_note: '',
booking_add_ons: [{add_on_id: '239', quantity: 3}],
sub_bookings: [{resource_id: '21888', service_id: '2777', quantity: 1}],
quantity: 1,
custom_fields: {}
})
};
fetch('https://b.anny.co/api/v1/order/bookings', 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/order/bookings",
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([
'resource_id' => '22233',
'service_id' => '2800',
'start_date' => '2021-10-15T09:00:00+02:00',
'end_date' => '2021-10-15T13:00:00+02:00',
'description' => '',
'customer_note' => '',
'booking_add_ons' => [
[
'add_on_id' => '239',
'quantity' => 3
]
],
'sub_bookings' => [
[
'resource_id' => '21888',
'service_id' => '2777',
'quantity' => 1
]
],
'quantity' => 1,
'custom_fields' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.api+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/order/bookings"
payload := strings.NewReader("{\n \"resource_id\": \"22233\",\n \"service_id\": \"2800\",\n \"start_date\": \"2021-10-15T09:00:00+02:00\",\n \"end_date\": \"2021-10-15T13:00:00+02:00\",\n \"description\": \"\",\n \"customer_note\": \"\",\n \"booking_add_ons\": [\n {\n \"add_on_id\": \"239\",\n \"quantity\": 3\n }\n ],\n \"sub_bookings\": [\n {\n \"resource_id\": \"21888\",\n \"service_id\": \"2777\",\n \"quantity\": 1\n }\n ],\n \"quantity\": 1,\n \"custom_fields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/vnd.api+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/order/bookings")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"resource_id\": \"22233\",\n \"service_id\": \"2800\",\n \"start_date\": \"2021-10-15T09:00:00+02:00\",\n \"end_date\": \"2021-10-15T13:00:00+02:00\",\n \"description\": \"\",\n \"customer_note\": \"\",\n \"booking_add_ons\": [\n {\n \"add_on_id\": \"239\",\n \"quantity\": 3\n }\n ],\n \"sub_bookings\": [\n {\n \"resource_id\": \"21888\",\n \"service_id\": \"2777\",\n \"quantity\": 1\n }\n ],\n \"quantity\": 1,\n \"custom_fields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/order/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"resource_id\": \"22233\",\n \"service_id\": \"2800\",\n \"start_date\": \"2021-10-15T09:00:00+02:00\",\n \"end_date\": \"2021-10-15T13:00:00+02:00\",\n \"description\": \"\",\n \"customer_note\": \"\",\n \"booking_add_ons\": [\n {\n \"add_on_id\": \"239\",\n \"quantity\": 3\n }\n ],\n \"sub_bookings\": [\n {\n \"resource_id\": \"21888\",\n \"service_id\": \"2777\",\n \"quantity\": 1\n }\n ],\n \"quantity\": 1,\n \"custom_fields\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "orders",
"id": "2012707",
"attributes": {
"number": "BO39099858",
"currency": "EUR",
"total": 277,
"net_amount": 232.77,
"tax_amount": 44.23,
"discount_amount": 0,
"status": "draft",
"access_token": "fCbsam8YHC4Ant65vQ7VCOkY3mFA4D",
"expires_at": "2021-09-24T14:20:50+00:00",
"created_at": "2021-09-24T14:05:50+00:00",
"updated_at": "2021-09-24T14:05:51+00:00"
},
"relationships": {
"bookings": {
"data": [
{
"type": "bookings",
"id": "3717324"
}
]
},
"customer": {
"data": null
},
"sub_orders": {
"data": [
{
"type": "orders",
"id": "2012708"
}
]
}
},
"links": {
"self": "https://b.anny.co/api/v1/orders/2012707"
},
"meta": {
"download_url": "https://b.anny.co/downloads/order-confirmation/2012707?access_token=fCbsam8YHC4Ant65vQ7VCOkY3mFA4D",
"voucher_code": null,
"is_base_order": true,
"payment_flow": "pay-offline",
"pay_now_amount": 0
}
},
"included": [
{
"type": "add-ons",
"id": "239",
"attributes": {
"name": "Vegan Food",
"description": "<p>We will ensure all snacks offered will be vegan.</p>",
"plain_description": "We will ensure all snacks offered will be vegan.",
"customer_notice": "Select # of vegan attendees",
"lead_time": 0,
"is_third_party": false,
"currency": "EUR",
"tax_rate": 19,
"price": 0
}
},
{
"type": "booking-add-ons",
"id": "795",
"attributes": {
"quantity": 3,
"total": 0
},
"relationships": {
"add_on": {
"data": {
"type": "add-ons",
"id": "239"
}
}
}
},
{
"type": "resources",
"id": "22230",
"attributes": {
"slug": "lc",
"name": "Leadership Coach",
"description": null,
"plain_description": "",
"availabilityMode": null,
"continuous": true,
"color": null,
"auto_accept_bookings": true,
"timezone": "Europe/Berlin",
"quantity": 3,
"staggered_quantity": 3,
"max_booking_quantity": 1,
"has_children": true,
"available_from": "2021-08-31T22:00:00+00:00",
"available_to": null
},
"meta": {
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": true,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"meta_settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": true,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"zoom": false
}
},
{
"type": "images",
"id": "8685",
"attributes": {
"url": "https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg",
"copyright": "",
"width": 1920,
"height": 1080,
"order_index": 0,
"preview_image_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgACwAUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+yrP9pGBfDfirVPsVzIPD7zeYgUZlVTEBs3FRuxL0z26mvnb9mb9tSz8P+GfEumX0N/d3P8AaEurwTXs4l/dSyorRMSQQRuU8A8lz7VtfCu3TWdDstNvgbqxm01zJBKSVfBQjPryAfwFfMvh/wAH6Pa+J/iAkVkqJaqEhUO2EBG4gDPqo/Kvs62VU6jaWh8tgM5dJtVI8yt+p91Xn7Wvw3l1O+S71+e1lilCYQuVcbFO5dp6ZJH4UV+cNvpNrq4ee7jaWXeV3b2Xj8CPWisHl1OOlz1v7YnLVJr5n//Z",
"small_path": "https://cdn.booking-buddy.de/public/images/gallery/small/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg",
"medium_path": "https://cdn.booking-buddy.de/public/images/gallery/medium/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg",
"large_path": "https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg",
"created_at": "2021-09-22T13:37:09+00:00"
}
},
{
"type": "resources",
"id": "22233",
"attributes": {
"slug": "6N0sHUrQyfEfDS1ANXNsD05cn3OPxR",
"name": "Corina Abt",
"description": null,
"plain_description": "",
"availabilityMode": null,
"continuous": true,
"color": null,
"auto_accept_bookings": true,
"timezone": "Europe/Berlin",
"quantity": 1,
"staggered_quantity": null,
"max_booking_quantity": 1,
"has_children": false,
"available_from": null,
"available_to": null
},
"relationships": {
"parent": {
"data": {
"type": "resources",
"id": "22230"
}
},
"cover_image": {
"data": {
"type": "images",
"id": "8685"
}
}
},
"meta": {
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": true,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"meta_settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": true,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"zoom": false
}
},
{
"type": "services",
"id": "2800",
"attributes": {
"name": "Coaching: Leadership - Empower Your Employees",
"slug": "jrekqbe74eo9b7bwmursjki3michwt",
"description": null,
"hidden": false,
"is_rental_option": false,
"has_flexible_duration": false,
"auto_duration": false,
"allow_cross_schedule": false,
"requires_booking_description": false,
"requires_address": true,
"requires_mobile": true,
"allow_customer_notes": true,
"allow_more_bookings": true,
"charge_off_schedule": true,
"booking_interval": 240,
"calculation_interval": 240,
"min_duration": 240,
"max_duration": 240,
"uncharged_duration": 0,
"is_full_day": false,
"lead_time": 10080,
"padding_before": 0,
"padding_after": 0,
"advance_booking_period": 31,
"price": 249,
"starting_fee": 0,
"currency": "EUR",
"tax_rate": 19,
"default_weight": 1,
"created_at": "2021-09-22T13:39:17+00:00",
"updated_at": "2021-09-24T12:34:10+00:00",
"access_code": null
},
"meta": {
"resource_list": "Leadership Coach",
"min_duration_total": 249
}
},
{
"type": "resources",
"id": "21888",
"attributes": {
"slug": "c01",
"name": "C01 - London",
"description": "<p>Testbeschreibung C01</p>",
"plain_description": "Testbeschreibung C01",
"availabilityMode": null,
"continuous": true,
"color": null,
"auto_accept_bookings": true,
"timezone": "Europe/Berlin",
"quantity": 1,
"staggered_quantity": null,
"max_booking_quantity": 1,
"has_children": false,
"available_from": "2021-08-31T22:00:00+00:00",
"available_to": null
},
"meta": {
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": true
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"meta_settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": null,
"verifyGuestEmail": true
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"zoom": false
}
},
{
"type": "services",
"id": "2777",
"attributes": {
"name": "Basic",
"slug": "mvwps18k7e0lifyxl7icid4znqdcwq",
"description": null,
"hidden": false,
"is_rental_option": true,
"has_flexible_duration": true,
"auto_duration": false,
"allow_cross_schedule": false,
"requires_booking_description": false,
"requires_address": true,
"requires_mobile": true,
"allow_customer_notes": true,
"allow_more_bookings": true,
"charge_off_schedule": true,
"booking_interval": 15,
"calculation_interval": 30,
"min_duration": 30,
"max_duration": 480,
"uncharged_duration": 60,
"is_full_day": false,
"lead_time": 60,
"padding_before": 15,
"padding_after": 15,
"advance_booking_period": 31,
"price": 3,
"starting_fee": 10,
"currency": "EUR",
"tax_rate": 19,
"default_weight": 1,
"created_at": "2021-09-20T13:42:16+00:00",
"updated_at": "2021-09-22T10:48:45+00:00",
"access_code": null
},
"meta": {
"resource_list": "C01 - London, M01 - Aachen, M02 - Köln",
"min_duration_total": 10
}
},
{
"type": "bookings",
"id": "3717325",
"attributes": {
"number": "BB23455895",
"status": "reserved",
"is_blocker": false,
"start_date": "2021-10-05T11:00:00+00:00",
"end_date": "2021-10-05T15:00:00+00:00",
"blocker_start_date": "2021-10-05T11:00:00+00:00",
"blocker_end_date": "2021-10-05T15:00:00+00:00",
"description": null,
"charged_duration": 240,
"weight": 1,
"currency": "EUR",
"total": 28,
"code": "IZSZSvmiV6bo7sIt",
"subtotal": 28,
"charged_total": 28,
"charged_subtotal": 28,
"starting_fee": 10,
"customer_note": null,
"created_at": "2021-09-24T14:05:50+00:00",
"canceled_at": null,
"check_in_date": null,
"check_out_date": null,
"custom_entry_map": {}
},
"relationships": {
"resource": {
"data": {
"type": "resources",
"id": "21888"
}
},
"service": {
"data": {
"type": "services",
"id": "2777"
}
}
},
"meta": []
},
{
"type": "bookings",
"id": "3717324",
"attributes": {
"number": "BB93911074",
"status": "reserved",
"is_blocker": false,
"start_date": "2021-10-05T11:00:00+00:00",
"end_date": "2021-10-05T15:00:00+00:00",
"blocker_start_date": "2021-10-05T11:00:00+00:00",
"blocker_end_date": "2021-10-05T15:00:00+00:00",
"description": null,
"charged_duration": 240,
"weight": 1,
"currency": "EUR",
"total": 277,
"code": "bmLbbkY9Ulrs9dHg",
"subtotal": 249,
"charged_total": 277,
"charged_subtotal": 249,
"starting_fee": 0,
"customer_note": null,
"created_at": "2021-09-24T14:05:50+00:00",
"canceled_at": null,
"check_in_date": null,
"check_out_date": null,
"custom_entry_map": {}
},
"relationships": {
"booking_add_ons": {
"data": [
{
"type": "booking-add-ons",
"id": "795"
}
]
},
"resource": {
"data": {
"type": "resources",
"id": "22233"
}
},
"service": {
"data": {
"type": "services",
"id": "2800"
}
},
"sub_bookings": {
"data": [
{
"type": "bookings",
"id": "3717325"
}
]
},
"cancellation_policy": {
"data": null
}
},
"meta": []
},
{
"type": "legal-documents",
"id": "311",
"attributes": {
"title": "T&C Test",
"content": "<p>T&C Test</p>",
"document_type": "terms_and_conditions"
}
},
{
"type": "legal-documents",
"id": "312",
"attributes": {
"title": "Privacy Test",
"content": "<p>Privacy Test</p>",
"document_type": "privacy_policy"
}
},
{
"type": "organizations",
"id": "734",
"attributes": {
"slug": "stadtmitte-buero",
"name": "Stadtmitte Büro",
"live": true,
"description": null,
"plain_description": "",
"official_name": "Workspace GmbH",
"support_email": "florian.schmitt@anny.co",
"phone": null,
"currency": "EUR",
"timezone": "Europe/Berlin",
"is_organization": true,
"responsible_for_contents": "Florian Schmitt",
"ceo": null,
"vat_id": null,
"register_number": null,
"local_court": null,
"financial_office": null
},
"relationships": {
"legal_documents": {
"data": [
{
"type": "legal-documents",
"id": "311"
},
{
"type": "legal-documents",
"id": "312"
}
]
}
},
"meta": {
"settings": {
"organizeResourcesBy": "category",
"checkout": {
"additionalFields": [],
"additionalRequiredFields": []
},
"preferFormalSalutation": false
},
"meta_settings": {
"organizeResourcesBy": "category",
"checkout": {
"additionalFields": [],
"additionalRequiredFields": []
},
"preferFormalSalutation": false
}
}
},
{
"type": "orders",
"id": "2012708",
"attributes": {
"number": "BO99655285",
"currency": "EUR",
"total": 277,
"net_amount": 232.77,
"tax_amount": 44.23,
"discount_amount": 0,
"status": "draft",
"access_token": "pdEQU9LZBqKB7nQnhkbVBBypQJOkXB",
"expires_at": null,
"created_at": "2021-09-24T14:05:50+00:00",
"updated_at": "2021-09-24T14:05:51+00:00"
},
"relationships": {
"bookings": {
"data": [
{
"type": "bookings",
"id": "3717324"
}
]
},
"organization": {
"data": {
"type": "organizations",
"id": "734"
}
}
},
"meta": []
}
]
}Abfrageparameter
Allows to include allowed resources in the response
customer, customer.address, invoice, invoice.items, customer, voucher, bookings, bookings.service, bookings.booking_add_ons.add_on, bookings.sub_bookings.resource, bookings.sub_bookings.service, bookings.resource.organization, bookings.resource, bookings.resource.cover_image, bookings.resource.organization.legal_documents Body
id of the resource that should be booked
atomic date time string
atomic date time string
Id of the service which should be booked. When no id is provided, the default service is taken.
The description which will be associated with the bookings resource. It is conditionally required.
A note from the customer which is attented to the booking
List of add ons
Show child attributes
Show child attributes
List of sub bookings
Show child attributes
Show child attributes
Antwort
OK
An order groups one or more bookings into a single transaction with payment and invoicing.
Show child attributes
Show child attributes