Update a specific booking
curl --request PATCH \
--url https://b.anny.co/api/v1/bookings/{booking_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"id": "4467710",
"type": "bookings",
"attributes": {
"end_date": "2021-10-08T08:15:00+02:00",
"blocker_end_date": "2021-10-08T08:30:00+02:00"
},
"relationships": {}
}
}
'import requests
url = "https://b.anny.co/api/v1/bookings/{booking_id}"
payload = { "data": {
"id": "4467710",
"type": "bookings",
"attributes": {
"end_date": "2021-10-08T08:15:00+02:00",
"blocker_end_date": "2021-10-08T08:30:00+02:00"
},
"relationships": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
id: '4467710',
type: 'bookings',
attributes: {
end_date: '2021-10-08T08:15:00+02:00',
blocker_end_date: '2021-10-08T08:30:00+02:00'
},
relationships: {}
}
})
};
fetch('https://b.anny.co/api/v1/bookings/{booking_id}', 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/{booking_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'id' => '4467710',
'type' => 'bookings',
'attributes' => [
'end_date' => '2021-10-08T08:15:00+02:00',
'blocker_end_date' => '2021-10-08T08:30:00+02:00'
],
'relationships' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/{booking_id}"
payload := strings.NewReader("{\n \"data\": {\n \"id\": \"4467710\",\n \"type\": \"bookings\",\n \"attributes\": {\n \"end_date\": \"2021-10-08T08:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T08:30:00+02:00\"\n },\n \"relationships\": {}\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://b.anny.co/api/v1/bookings/{booking_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"id\": \"4467710\",\n \"type\": \"bookings\",\n \"attributes\": {\n \"end_date\": \"2021-10-08T08:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T08:30:00+02:00\"\n },\n \"relationships\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/bookings/{booking_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"id\": \"4467710\",\n \"type\": \"bookings\",\n \"attributes\": {\n \"end_date\": \"2021-10-08T08:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T08:30:00+02:00\"\n },\n \"relationships\": {}\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-08T06:15:00+00:00",
"blocker_start_date": "2021-10-08T05:00:00+00:00",
"blocker_end_date": "2021-10-08T06:30:00+00:00",
"description": "Max Mustermann - Basic",
"charged_duration": 60,
"weight": 1,
"currency": "EUR",
"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": false,
"is_editable": true,
"updated_at": "2021-10-07T09:12:19+00:00"
},
"links": {
"self": "https://b.anny.co/api/v1/bookings/4467710"
},
"meta": []
}
}Booking Management
Update a specific booking
PATCH
/
api
/
v1
/
bookings
/
{booking_id}
Update a specific booking
curl --request PATCH \
--url https://b.anny.co/api/v1/bookings/{booking_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"id": "4467710",
"type": "bookings",
"attributes": {
"end_date": "2021-10-08T08:15:00+02:00",
"blocker_end_date": "2021-10-08T08:30:00+02:00"
},
"relationships": {}
}
}
'import requests
url = "https://b.anny.co/api/v1/bookings/{booking_id}"
payload = { "data": {
"id": "4467710",
"type": "bookings",
"attributes": {
"end_date": "2021-10-08T08:15:00+02:00",
"blocker_end_date": "2021-10-08T08:30:00+02:00"
},
"relationships": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
id: '4467710',
type: 'bookings',
attributes: {
end_date: '2021-10-08T08:15:00+02:00',
blocker_end_date: '2021-10-08T08:30:00+02:00'
},
relationships: {}
}
})
};
fetch('https://b.anny.co/api/v1/bookings/{booking_id}', 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/{booking_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'id' => '4467710',
'type' => 'bookings',
'attributes' => [
'end_date' => '2021-10-08T08:15:00+02:00',
'blocker_end_date' => '2021-10-08T08:30:00+02:00'
],
'relationships' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/{booking_id}"
payload := strings.NewReader("{\n \"data\": {\n \"id\": \"4467710\",\n \"type\": \"bookings\",\n \"attributes\": {\n \"end_date\": \"2021-10-08T08:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T08:30:00+02:00\"\n },\n \"relationships\": {}\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://b.anny.co/api/v1/bookings/{booking_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"id\": \"4467710\",\n \"type\": \"bookings\",\n \"attributes\": {\n \"end_date\": \"2021-10-08T08:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T08:30:00+02:00\"\n },\n \"relationships\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/bookings/{booking_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"id\": \"4467710\",\n \"type\": \"bookings\",\n \"attributes\": {\n \"end_date\": \"2021-10-08T08:15:00+02:00\",\n \"blocker_end_date\": \"2021-10-08T08:30:00+02:00\"\n },\n \"relationships\": {}\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-08T06:15:00+00:00",
"blocker_start_date": "2021-10-08T05:00:00+00:00",
"blocker_end_date": "2021-10-08T06:30:00+00:00",
"description": "Max Mustermann - Basic",
"charged_duration": 60,
"weight": 1,
"currency": "EUR",
"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": false,
"is_editable": true,
"updated_at": "2021-10-07T09:12:19+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
Pfadparameter
Abfrageparameter
Organization ID
Body
application/json
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
Antwort
OK
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