Reassign the booking customer
curl --request POST \
--url https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "4401"
}
'import requests
url = "https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer"
payload = { "customer_id": "4401" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '4401'})
};
fetch('https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer', 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}/edit/customer",
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([
'customer_id' => '4401'
]),
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}/edit/customer"
payload := strings.NewReader("{\n \"customer_id\": \"4401\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"4401\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer")
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/json'
request.body = "{\n \"customer_id\": \"4401\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "bookings",
"attributes": {
"number": "<string>",
"is_blocker": true,
"start_date": "<string>",
"end_date": "<string>",
"blocker_start_date": "<string>",
"blocker_end_date": "<string>",
"description": "<string>",
"charged_duration": 123,
"weight": 123,
"is_sequence": true,
"price_hidden": true,
"visible_for_customer": true,
"can_edit": true,
"is_own": true,
"currency": "<string>",
"tax_rate": 123,
"total": 123,
"is_net_total": true,
"code": "<string>",
"subtotal": 123,
"charged_total": 123,
"charged_subtotal": 123,
"starting_fee": 123,
"customer_note": "<string>",
"created_at": "<string>",
"canceled_at": "<string>",
"check_in_date": "<string>",
"check_out_date": "<string>",
"custom_entry_map": {},
"is_series": true,
"is_series_master": true,
"series_id": "<string>",
"series_type": "<string>",
"note": "<string>",
"manually_created": true,
"is_sub_booking": true,
"external_uuid": "<string>",
"has_payment": true,
"is_editable": true,
"status_reason": "<string>",
"updated_at": "<string>"
},
"links": {
"self": "<string>"
},
"relationships": {
"resource": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"service": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"order": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"customer": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"organization": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"super_booking": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"sub_bookings": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"booking_add_ons": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"cancellation_policy": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"custom_entries": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"model_identifiers": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"activities": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"test_results": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"external_calendar": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"host": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"attendees": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"booking_participants": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"files": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"access_control_grants": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"sync_sources": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"reminders": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"sequence": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"sequenced_bookings": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"series_bookings": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"series_master": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"booking_series": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"delegated_by": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"queue_ticket": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
}
}
}
}Booking Management
Reassign the booking customer
Reassign the customer of a confirmed booking. The customer must belong to the active organization.
When the booking is not personalized (its customer matches the order customer), the change also updates the order customer. When it is personalized, only this booking is reassigned. Sub-bookings and sequenced children adopt the new customer.
POST
/
api
/
v1
/
bookings
/
{booking_id}
/
edit
/
customer
Reassign the booking customer
curl --request POST \
--url https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "4401"
}
'import requests
url = "https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer"
payload = { "customer_id": "4401" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '4401'})
};
fetch('https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer', 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}/edit/customer",
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([
'customer_id' => '4401'
]),
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}/edit/customer"
payload := strings.NewReader("{\n \"customer_id\": \"4401\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"4401\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/bookings/{booking_id}/edit/customer")
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/json'
request.body = "{\n \"customer_id\": \"4401\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "bookings",
"attributes": {
"number": "<string>",
"is_blocker": true,
"start_date": "<string>",
"end_date": "<string>",
"blocker_start_date": "<string>",
"blocker_end_date": "<string>",
"description": "<string>",
"charged_duration": 123,
"weight": 123,
"is_sequence": true,
"price_hidden": true,
"visible_for_customer": true,
"can_edit": true,
"is_own": true,
"currency": "<string>",
"tax_rate": 123,
"total": 123,
"is_net_total": true,
"code": "<string>",
"subtotal": 123,
"charged_total": 123,
"charged_subtotal": 123,
"starting_fee": 123,
"customer_note": "<string>",
"created_at": "<string>",
"canceled_at": "<string>",
"check_in_date": "<string>",
"check_out_date": "<string>",
"custom_entry_map": {},
"is_series": true,
"is_series_master": true,
"series_id": "<string>",
"series_type": "<string>",
"note": "<string>",
"manually_created": true,
"is_sub_booking": true,
"external_uuid": "<string>",
"has_payment": true,
"is_editable": true,
"status_reason": "<string>",
"updated_at": "<string>"
},
"links": {
"self": "<string>"
},
"relationships": {
"resource": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"service": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"order": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"customer": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"organization": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"super_booking": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"sub_bookings": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"booking_add_ons": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"cancellation_policy": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"custom_entries": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"model_identifiers": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"activities": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"test_results": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"external_calendar": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"host": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"attendees": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"booking_participants": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"files": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"access_control_grants": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"sync_sources": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"reminders": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"sequence": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"sequenced_bookings": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"series_bookings": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"series_master": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"booking_series": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"delegated_by": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"queue_ticket": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
}
}
}
}Autorisierungen
The access token received from the authorization server in the OAuth 2.0 flow.
Header
Bearer Token
Pfadparameter
Booking identifier
Abfrageparameter
Organization ID
Body
application/json
Customer in the active organization.
Antwort
Updated booking
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