Create simple booking or blocker
curl --request POST \
--url https://b.anny.co/api/v1/bookings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "bookings",
"attributes": {
"status": "accepted",
"is_blocker": false,
"description": "Max Mustermann - Basic",
"weight": 1,
"currency": "EUR",
"is_net_total": false,
"custom_entry_map": {},
"manually_created": true,
"is_sub_booking": false,
"start_date": "2021-10-08T07:15:00+02:00",
"end_date": "2021-10-08T07:45:00+02:00",
"blocker_start_date": "2021-10-08T07:15:00+02:00",
"blocker_end_date": "2021-10-08T07:45:00+02:00"
},
"relationships": {
"resource": {
"data": {
"id": "21887",
"type": "resources"
}
},
"service": {
"data": {
"id": "2777",
"type": "services"
}
},
"order": {
"data": null
}
},
"meta": {}
}
}
'import requests
url = "https://b.anny.co/api/v1/bookings"
payload = { "data": {
"type": "bookings",
"attributes": {
"status": "accepted",
"is_blocker": False,
"description": "Max Mustermann - Basic",
"weight": 1,
"currency": "EUR",
"is_net_total": False,
"custom_entry_map": {},
"manually_created": True,
"is_sub_booking": False,
"start_date": "2021-10-08T07:15:00+02:00",
"end_date": "2021-10-08T07:45:00+02:00",
"blocker_start_date": "2021-10-08T07:15:00+02:00",
"blocker_end_date": "2021-10-08T07:45:00+02:00"
},
"relationships": {
"resource": { "data": {
"id": "21887",
"type": "resources"
} },
"service": { "data": {
"id": "2777",
"type": "services"
} },
"order": { "data": None }
},
"meta": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'bookings',
attributes: {
status: 'accepted',
is_blocker: false,
description: 'Max Mustermann - Basic',
weight: 1,
currency: 'EUR',
is_net_total: false,
custom_entry_map: {},
manually_created: true,
is_sub_booking: false,
start_date: '2021-10-08T07:15:00+02:00',
end_date: '2021-10-08T07:45:00+02:00',
blocker_start_date: '2021-10-08T07:15:00+02:00',
blocker_end_date: '2021-10-08T07:45:00+02:00'
},
relationships: {
resource: {data: {id: '21887', type: 'resources'}},
service: {data: {id: '2777', type: 'services'}},
order: {data: null}
},
meta: {}
}
})
};
fetch('https://b.anny.co/api/v1/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/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([
'data' => [
'type' => 'bookings',
'attributes' => [
'status' => 'accepted',
'is_blocker' => false,
'description' => 'Max Mustermann - Basic',
'weight' => 1,
'currency' => 'EUR',
'is_net_total' => false,
'custom_entry_map' => [
],
'manually_created' => true,
'is_sub_booking' => false,
'start_date' => '2021-10-08T07:15:00+02:00',
'end_date' => '2021-10-08T07:45:00+02:00',
'blocker_start_date' => '2021-10-08T07:15:00+02:00',
'blocker_end_date' => '2021-10-08T07:45:00+02:00'
],
'relationships' => [
'resource' => [
'data' => [
'id' => '21887',
'type' => 'resources'
]
],
'service' => [
'data' => [
'id' => '2777',
'type' => 'services'
]
],
'order' => [
'data' => null
]
],
'meta' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/bookings"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"bookings\",\n \"attributes\": {\n \"status\": \"accepted\",\n \"is_blocker\": false,\n \"description\": \"Max Mustermann - Basic\",\n \"weight\": 1,\n \"currency\": \"EUR\",\n \"is_net_total\": false,\n \"custom_entry_map\": {},\n \"manually_created\": true,\n \"is_sub_booking\": false,\n \"start_date\": \"2021-10-08T07:15:00+02:00\",\n \"end_date\": \"2021-10-08T07:45:00+02:00\",\n \"blocker_start_date\": \"2021-10-08T07:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T07:45:00+02:00\"\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21887\",\n \"type\": \"resources\"\n }\n },\n \"service\": {\n \"data\": {\n \"id\": \"2777\",\n \"type\": \"services\"\n }\n },\n \"order\": {\n \"data\": null\n }\n },\n \"meta\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/bookings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"bookings\",\n \"attributes\": {\n \"status\": \"accepted\",\n \"is_blocker\": false,\n \"description\": \"Max Mustermann - Basic\",\n \"weight\": 1,\n \"currency\": \"EUR\",\n \"is_net_total\": false,\n \"custom_entry_map\": {},\n \"manually_created\": true,\n \"is_sub_booking\": false,\n \"start_date\": \"2021-10-08T07:15:00+02:00\",\n \"end_date\": \"2021-10-08T07:45:00+02:00\",\n \"blocker_start_date\": \"2021-10-08T07:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T07:45:00+02:00\"\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21887\",\n \"type\": \"resources\"\n }\n },\n \"service\": {\n \"data\": {\n \"id\": \"2777\",\n \"type\": \"services\"\n }\n },\n \"order\": {\n \"data\": null\n }\n },\n \"meta\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"bookings\",\n \"attributes\": {\n \"status\": \"accepted\",\n \"is_blocker\": false,\n \"description\": \"Max Mustermann - Basic\",\n \"weight\": 1,\n \"currency\": \"EUR\",\n \"is_net_total\": false,\n \"custom_entry_map\": {},\n \"manually_created\": true,\n \"is_sub_booking\": false,\n \"start_date\": \"2021-10-08T07:15:00+02:00\",\n \"end_date\": \"2021-10-08T07:45:00+02:00\",\n \"blocker_start_date\": \"2021-10-08T07:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T07:45:00+02:00\"\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21887\",\n \"type\": \"resources\"\n }\n },\n \"service\": {\n \"data\": {\n \"id\": \"2777\",\n \"type\": \"services\"\n }\n },\n \"order\": {\n \"data\": null\n }\n },\n \"meta\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "bookings",
"id": "4467710",
"attributes": {
"number": "BB93809456",
"status": "accepted",
"is_blocker": false,
"start_date": "2021-10-08T05:15:00+00:00",
"end_date": "2021-10-08T05:45:00+00:00",
"blocker_start_date": "2021-10-08T05:00:00+00:00",
"blocker_end_date": "2021-10-08T06:00:00+00:00",
"description": "Max Mustermann - Basic",
"charged_duration": 60,
"weight": 1,
"currency": null,
"total": 10,
"is_net_total": false,
"code": "QKuBqC70mmwB7RAi",
"subtotal": 10,
"charged_total": 10,
"charged_subtotal": 10,
"starting_fee": 10,
"customer_note": null,
"created_at": "2021-10-07T08:36:14+00:00",
"canceled_at": null,
"check_in_date": null,
"check_out_date": null,
"custom_entry_map": {},
"note": null,
"manually_created": true,
"is_sub_booking": false,
"external_uuid": null,
"has_payment": null,
"is_editable": true,
"updated_at": "2021-10-07T08:36:14+00:00"
},
"links": {
"self": "https://b.anny.co/api/v1/bookings/4467710"
},
"meta": []
}
}Booking Management
Create simple booking or blocker
POST
/
api
/
v1
/
bookings
Create simple booking or blocker
curl --request POST \
--url https://b.anny.co/api/v1/bookings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "bookings",
"attributes": {
"status": "accepted",
"is_blocker": false,
"description": "Max Mustermann - Basic",
"weight": 1,
"currency": "EUR",
"is_net_total": false,
"custom_entry_map": {},
"manually_created": true,
"is_sub_booking": false,
"start_date": "2021-10-08T07:15:00+02:00",
"end_date": "2021-10-08T07:45:00+02:00",
"blocker_start_date": "2021-10-08T07:15:00+02:00",
"blocker_end_date": "2021-10-08T07:45:00+02:00"
},
"relationships": {
"resource": {
"data": {
"id": "21887",
"type": "resources"
}
},
"service": {
"data": {
"id": "2777",
"type": "services"
}
},
"order": {
"data": null
}
},
"meta": {}
}
}
'import requests
url = "https://b.anny.co/api/v1/bookings"
payload = { "data": {
"type": "bookings",
"attributes": {
"status": "accepted",
"is_blocker": False,
"description": "Max Mustermann - Basic",
"weight": 1,
"currency": "EUR",
"is_net_total": False,
"custom_entry_map": {},
"manually_created": True,
"is_sub_booking": False,
"start_date": "2021-10-08T07:15:00+02:00",
"end_date": "2021-10-08T07:45:00+02:00",
"blocker_start_date": "2021-10-08T07:15:00+02:00",
"blocker_end_date": "2021-10-08T07:45:00+02:00"
},
"relationships": {
"resource": { "data": {
"id": "21887",
"type": "resources"
} },
"service": { "data": {
"id": "2777",
"type": "services"
} },
"order": { "data": None }
},
"meta": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'bookings',
attributes: {
status: 'accepted',
is_blocker: false,
description: 'Max Mustermann - Basic',
weight: 1,
currency: 'EUR',
is_net_total: false,
custom_entry_map: {},
manually_created: true,
is_sub_booking: false,
start_date: '2021-10-08T07:15:00+02:00',
end_date: '2021-10-08T07:45:00+02:00',
blocker_start_date: '2021-10-08T07:15:00+02:00',
blocker_end_date: '2021-10-08T07:45:00+02:00'
},
relationships: {
resource: {data: {id: '21887', type: 'resources'}},
service: {data: {id: '2777', type: 'services'}},
order: {data: null}
},
meta: {}
}
})
};
fetch('https://b.anny.co/api/v1/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/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([
'data' => [
'type' => 'bookings',
'attributes' => [
'status' => 'accepted',
'is_blocker' => false,
'description' => 'Max Mustermann - Basic',
'weight' => 1,
'currency' => 'EUR',
'is_net_total' => false,
'custom_entry_map' => [
],
'manually_created' => true,
'is_sub_booking' => false,
'start_date' => '2021-10-08T07:15:00+02:00',
'end_date' => '2021-10-08T07:45:00+02:00',
'blocker_start_date' => '2021-10-08T07:15:00+02:00',
'blocker_end_date' => '2021-10-08T07:45:00+02:00'
],
'relationships' => [
'resource' => [
'data' => [
'id' => '21887',
'type' => 'resources'
]
],
'service' => [
'data' => [
'id' => '2777',
'type' => 'services'
]
],
'order' => [
'data' => null
]
],
'meta' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/bookings"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"bookings\",\n \"attributes\": {\n \"status\": \"accepted\",\n \"is_blocker\": false,\n \"description\": \"Max Mustermann - Basic\",\n \"weight\": 1,\n \"currency\": \"EUR\",\n \"is_net_total\": false,\n \"custom_entry_map\": {},\n \"manually_created\": true,\n \"is_sub_booking\": false,\n \"start_date\": \"2021-10-08T07:15:00+02:00\",\n \"end_date\": \"2021-10-08T07:45:00+02:00\",\n \"blocker_start_date\": \"2021-10-08T07:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T07:45:00+02:00\"\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21887\",\n \"type\": \"resources\"\n }\n },\n \"service\": {\n \"data\": {\n \"id\": \"2777\",\n \"type\": \"services\"\n }\n },\n \"order\": {\n \"data\": null\n }\n },\n \"meta\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/bookings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"bookings\",\n \"attributes\": {\n \"status\": \"accepted\",\n \"is_blocker\": false,\n \"description\": \"Max Mustermann - Basic\",\n \"weight\": 1,\n \"currency\": \"EUR\",\n \"is_net_total\": false,\n \"custom_entry_map\": {},\n \"manually_created\": true,\n \"is_sub_booking\": false,\n \"start_date\": \"2021-10-08T07:15:00+02:00\",\n \"end_date\": \"2021-10-08T07:45:00+02:00\",\n \"blocker_start_date\": \"2021-10-08T07:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T07:45:00+02:00\"\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21887\",\n \"type\": \"resources\"\n }\n },\n \"service\": {\n \"data\": {\n \"id\": \"2777\",\n \"type\": \"services\"\n }\n },\n \"order\": {\n \"data\": null\n }\n },\n \"meta\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"bookings\",\n \"attributes\": {\n \"status\": \"accepted\",\n \"is_blocker\": false,\n \"description\": \"Max Mustermann - Basic\",\n \"weight\": 1,\n \"currency\": \"EUR\",\n \"is_net_total\": false,\n \"custom_entry_map\": {},\n \"manually_created\": true,\n \"is_sub_booking\": false,\n \"start_date\": \"2021-10-08T07:15:00+02:00\",\n \"end_date\": \"2021-10-08T07:45:00+02:00\",\n \"blocker_start_date\": \"2021-10-08T07:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T07:45:00+02:00\"\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21887\",\n \"type\": \"resources\"\n }\n },\n \"service\": {\n \"data\": {\n \"id\": \"2777\",\n \"type\": \"services\"\n }\n },\n \"order\": {\n \"data\": null\n }\n },\n \"meta\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "bookings",
"id": "4467710",
"attributes": {
"number": "BB93809456",
"status": "accepted",
"is_blocker": false,
"start_date": "2021-10-08T05:15:00+00:00",
"end_date": "2021-10-08T05:45:00+00:00",
"blocker_start_date": "2021-10-08T05:00:00+00:00",
"blocker_end_date": "2021-10-08T06:00:00+00:00",
"description": "Max Mustermann - Basic",
"charged_duration": 60,
"weight": 1,
"currency": null,
"total": 10,
"is_net_total": false,
"code": "QKuBqC70mmwB7RAi",
"subtotal": 10,
"charged_total": 10,
"charged_subtotal": 10,
"starting_fee": 10,
"customer_note": null,
"created_at": "2021-10-07T08:36:14+00:00",
"canceled_at": null,
"check_in_date": null,
"check_out_date": null,
"custom_entry_map": {},
"note": null,
"manually_created": true,
"is_sub_booking": false,
"external_uuid": null,
"has_payment": null,
"is_editable": true,
"updated_at": "2021-10-07T08:36:14+00:00"
},
"links": {
"self": "https://b.anny.co/api/v1/bookings/4467710"
},
"meta": []
}
}Autorisierungen
The access token received from the authorization server in the OAuth 2.0 flow.
Header
Bearer Token
Body
application/vnd.api+json
Show child attributes
Show child attributes
Antwort
Created
A booking blocks the related resource from start_date until its end_date while its status is reserved, requested or accepted.
Status values:
reserved— booking is reserved until order expirationrequested— needs manual acceptance by adminaccepted— accepted (automatically or manually)rejected— rejected by admin before fulfillment; always yields a 100% refund when payment existscanceled— canceled by customer or admin; refund follows the configured cancellation policy conditionsexpired— booking expired because the check-in time passed without check-in
Show child attributes
Show child attributes
⌘I