Finish an order
curl --request POST \
--url https://b.anny.co/api/v1/order \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"accept_terms": true,
"subscribe_newsletter": false,
"agreements": {
"stadtmitte-buero": true
},
"customer": {
"given_name": "Max",
"family_name": "Mustermann",
"email": "max.mustermann@mail.com",
"mobile": "+491701234567",
"company": null,
"birth_date": null,
"sex": null,
"phone": null,
"title": null
},
"custom_fields": {
"6598dc92-e273-4944-8cfa-4430a397891e": "Google"
},
"bookings_custom_fields": {
"b_3711615": {
"55536678-2266-4bb0-99f5-206348244ad2": "CTO"
},
"b_3712360": {
"55536678-2266-4bb0-99f5-206348244ad2": "COO"
}
},
"address": {
"street_address": "Jülicher Straße 68",
"address_line_2": "Hinterhaus",
"zip_code": "52070",
"city": "Aachen",
"area": "NRW",
"country_code": "DE"
},
"meta": {
"timezone": "Europe/Berlin",
"timezone_offset": -120,
"remember_customer": true
},
"verify_guest_email": {
"state": "fESIyHXND2Yv9SYN",
"code": "166655"
}
}
'import requests
url = "https://b.anny.co/api/v1/order"
payload = {
"accept_terms": True,
"subscribe_newsletter": False,
"agreements": { "stadtmitte-buero": True },
"customer": {
"given_name": "Max",
"family_name": "Mustermann",
"email": "max.mustermann@mail.com",
"mobile": "+491701234567",
"company": None,
"birth_date": None,
"sex": None,
"phone": None,
"title": None
},
"custom_fields": { "6598dc92-e273-4944-8cfa-4430a397891e": "Google" },
"bookings_custom_fields": {
"b_3711615": { "55536678-2266-4bb0-99f5-206348244ad2": "CTO" },
"b_3712360": { "55536678-2266-4bb0-99f5-206348244ad2": "COO" }
},
"address": {
"street_address": "Jülicher Straße 68",
"address_line_2": "Hinterhaus",
"zip_code": "52070",
"city": "Aachen",
"area": "NRW",
"country_code": "DE"
},
"meta": {
"timezone": "Europe/Berlin",
"timezone_offset": -120,
"remember_customer": True
},
"verify_guest_email": {
"state": "fESIyHXND2Yv9SYN",
"code": "166655"
}
}
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({
accept_terms: true,
subscribe_newsletter: false,
agreements: {'stadtmitte-buero': true},
customer: {
given_name: 'Max',
family_name: 'Mustermann',
email: 'max.mustermann@mail.com',
mobile: '+491701234567',
company: null,
birth_date: null,
sex: null,
phone: null,
title: null
},
custom_fields: {'6598dc92-e273-4944-8cfa-4430a397891e': 'Google'},
bookings_custom_fields: {
b_3711615: {'55536678-2266-4bb0-99f5-206348244ad2': 'CTO'},
b_3712360: {'55536678-2266-4bb0-99f5-206348244ad2': 'COO'}
},
address: {
street_address: 'Jülicher Straße 68',
address_line_2: 'Hinterhaus',
zip_code: '52070',
city: 'Aachen',
area: 'NRW',
country_code: 'DE'
},
meta: {timezone: 'Europe/Berlin', timezone_offset: -120, remember_customer: true},
verify_guest_email: {state: 'fESIyHXND2Yv9SYN', code: '166655'}
})
};
fetch('https://b.anny.co/api/v1/order', 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",
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([
'accept_terms' => true,
'subscribe_newsletter' => false,
'agreements' => [
'stadtmitte-buero' => true
],
'customer' => [
'given_name' => 'Max',
'family_name' => 'Mustermann',
'email' => 'max.mustermann@mail.com',
'mobile' => '+491701234567',
'company' => null,
'birth_date' => null,
'sex' => null,
'phone' => null,
'title' => null
],
'custom_fields' => [
'6598dc92-e273-4944-8cfa-4430a397891e' => 'Google'
],
'bookings_custom_fields' => [
'b_3711615' => [
'55536678-2266-4bb0-99f5-206348244ad2' => 'CTO'
],
'b_3712360' => [
'55536678-2266-4bb0-99f5-206348244ad2' => 'COO'
]
],
'address' => [
'street_address' => 'Jülicher Straße 68',
'address_line_2' => 'Hinterhaus',
'zip_code' => '52070',
'city' => 'Aachen',
'area' => 'NRW',
'country_code' => 'DE'
],
'meta' => [
'timezone' => 'Europe/Berlin',
'timezone_offset' => -120,
'remember_customer' => true
],
'verify_guest_email' => [
'state' => 'fESIyHXND2Yv9SYN',
'code' => '166655'
]
]),
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"
payload := strings.NewReader("{\n \"accept_terms\": true,\n \"subscribe_newsletter\": false,\n \"agreements\": {\n \"stadtmitte-buero\": true\n },\n \"customer\": {\n \"given_name\": \"Max\",\n \"family_name\": \"Mustermann\",\n \"email\": \"max.mustermann@mail.com\",\n \"mobile\": \"+491701234567\",\n \"company\": null,\n \"birth_date\": null,\n \"sex\": null,\n \"phone\": null,\n \"title\": null\n },\n \"custom_fields\": {\n \"6598dc92-e273-4944-8cfa-4430a397891e\": \"Google\"\n },\n \"bookings_custom_fields\": {\n \"b_3711615\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"CTO\"\n },\n \"b_3712360\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"COO\"\n }\n },\n \"address\": {\n \"street_address\": \"Jülicher Straße 68\",\n \"address_line_2\": \"Hinterhaus\",\n \"zip_code\": \"52070\",\n \"city\": \"Aachen\",\n \"area\": \"NRW\",\n \"country_code\": \"DE\"\n },\n \"meta\": {\n \"timezone\": \"Europe/Berlin\",\n \"timezone_offset\": -120,\n \"remember_customer\": true\n },\n \"verify_guest_email\": {\n \"state\": \"fESIyHXND2Yv9SYN\",\n \"code\": \"166655\"\n }\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")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"accept_terms\": true,\n \"subscribe_newsletter\": false,\n \"agreements\": {\n \"stadtmitte-buero\": true\n },\n \"customer\": {\n \"given_name\": \"Max\",\n \"family_name\": \"Mustermann\",\n \"email\": \"max.mustermann@mail.com\",\n \"mobile\": \"+491701234567\",\n \"company\": null,\n \"birth_date\": null,\n \"sex\": null,\n \"phone\": null,\n \"title\": null\n },\n \"custom_fields\": {\n \"6598dc92-e273-4944-8cfa-4430a397891e\": \"Google\"\n },\n \"bookings_custom_fields\": {\n \"b_3711615\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"CTO\"\n },\n \"b_3712360\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"COO\"\n }\n },\n \"address\": {\n \"street_address\": \"Jülicher Straße 68\",\n \"address_line_2\": \"Hinterhaus\",\n \"zip_code\": \"52070\",\n \"city\": \"Aachen\",\n \"area\": \"NRW\",\n \"country_code\": \"DE\"\n },\n \"meta\": {\n \"timezone\": \"Europe/Berlin\",\n \"timezone_offset\": -120,\n \"remember_customer\": true\n },\n \"verify_guest_email\": {\n \"state\": \"fESIyHXND2Yv9SYN\",\n \"code\": \"166655\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/order")
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 \"accept_terms\": true,\n \"subscribe_newsletter\": false,\n \"agreements\": {\n \"stadtmitte-buero\": true\n },\n \"customer\": {\n \"given_name\": \"Max\",\n \"family_name\": \"Mustermann\",\n \"email\": \"max.mustermann@mail.com\",\n \"mobile\": \"+491701234567\",\n \"company\": null,\n \"birth_date\": null,\n \"sex\": null,\n \"phone\": null,\n \"title\": null\n },\n \"custom_fields\": {\n \"6598dc92-e273-4944-8cfa-4430a397891e\": \"Google\"\n },\n \"bookings_custom_fields\": {\n \"b_3711615\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"CTO\"\n },\n \"b_3712360\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"COO\"\n }\n },\n \"address\": {\n \"street_address\": \"Jülicher Straße 68\",\n \"address_line_2\": \"Hinterhaus\",\n \"zip_code\": \"52070\",\n \"city\": \"Aachen\",\n \"area\": \"NRW\",\n \"country_code\": \"DE\"\n },\n \"meta\": {\n \"timezone\": \"Europe/Berlin\",\n \"timezone_offset\": -120,\n \"remember_customer\": true\n },\n \"verify_guest_email\": {\n \"state\": \"fESIyHXND2Yv9SYN\",\n \"code\": \"166655\"\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": [],
"data": [
{
"type": "orders",
"id": "2010687",
"attributes": {
"number": "BO17499925",
"currency": "EUR",
"total": 249,
"net_amount": 209.24,
"tax_amount": 39.76,
"discount_amount": 0,
"status": "open",
"access_token": "uuzahppQhD7wmJscn8IbwRe9hJb2wq",
"expires_at": null,
"created_at": "2021-09-24T12:18:49+00:00",
"updated_at": "2021-09-24T12:22:02+00:00"
},
"relationships": {
"bookings": {
"data": [
{
"type": "bookings",
"id": "3713015"
}
]
},
"customer": {
"data": {
"type": "customers",
"id": "408936"
}
},
"last_payment": {
"data": null
},
"sub_orders": {
"data": []
}
},
"links": {
"self": "https://b.anny.co/api/v1/orders/2010687"
},
"meta": []
}
],
"included": [
{
"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": true
},
"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": true
},
"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": true
},
"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": true
},
"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-24T11:57:10+00:00",
"access_code": null
},
"meta": {
"resource_list": "Leadership Coach",
"min_duration_total": 249
}
},
{
"type": "bookings",
"id": "3713015",
"attributes": {
"number": "BB88036740",
"status": "accepted",
"is_blocker": false,
"start_date": "2021-10-14T07:00:00+00:00",
"end_date": "2021-10-14T11:00:00+00:00",
"blocker_start_date": "2021-10-14T07:00:00+00:00",
"blocker_end_date": "2021-10-14T11:00:00+00:00",
"description": "",
"charged_duration": 240,
"weight": 1
},
"relationships": {
"booking_add_ons": {
"data": []
},
"resource": {
"data": {
"type": "resources",
"id": "22233"
}
},
"service": {
"data": {
"type": "services",
"id": "2800"
}
},
"sub_bookings": {
"data": []
},
"cancellation_policy": {
"data": null
}
},
"meta": []
},
{
"type": "customers",
"id": "408936",
"attributes": {
"locale": "de",
"title": null,
"given_name": "Max",
"family_name": "Mustermann",
"full_name": "Max Mustermann",
"sex": 0,
"birth_date": null,
"email": "max.mustermann@mail.com",
"mobile": "+491701234567",
"phone": null,
"company": null,
"custom_entry_map": {
"6598dc92-e273-4944-8cfa-4430a397891e": {
"value": "Google",
"formatted_value": "Google",
"label": "Wie bist du auf uns aufmerksam geworden?"
}
},
"created_at": "2021-09-24T12:01:08+00:00"
}
}
]
}Orders & Checkout
Finish an order
This endpoint is necessary to complete an order. The response is an array of orders, one for each organization involved, since the booked resources may be offered by different organizations.
A booking is not always accepted automatically, depending on the settings of the resource it still has to be confirmed manually by the organization.
POST
/
api
/
v1
/
order
Finish an order
curl --request POST \
--url https://b.anny.co/api/v1/order \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"accept_terms": true,
"subscribe_newsletter": false,
"agreements": {
"stadtmitte-buero": true
},
"customer": {
"given_name": "Max",
"family_name": "Mustermann",
"email": "max.mustermann@mail.com",
"mobile": "+491701234567",
"company": null,
"birth_date": null,
"sex": null,
"phone": null,
"title": null
},
"custom_fields": {
"6598dc92-e273-4944-8cfa-4430a397891e": "Google"
},
"bookings_custom_fields": {
"b_3711615": {
"55536678-2266-4bb0-99f5-206348244ad2": "CTO"
},
"b_3712360": {
"55536678-2266-4bb0-99f5-206348244ad2": "COO"
}
},
"address": {
"street_address": "Jülicher Straße 68",
"address_line_2": "Hinterhaus",
"zip_code": "52070",
"city": "Aachen",
"area": "NRW",
"country_code": "DE"
},
"meta": {
"timezone": "Europe/Berlin",
"timezone_offset": -120,
"remember_customer": true
},
"verify_guest_email": {
"state": "fESIyHXND2Yv9SYN",
"code": "166655"
}
}
'import requests
url = "https://b.anny.co/api/v1/order"
payload = {
"accept_terms": True,
"subscribe_newsletter": False,
"agreements": { "stadtmitte-buero": True },
"customer": {
"given_name": "Max",
"family_name": "Mustermann",
"email": "max.mustermann@mail.com",
"mobile": "+491701234567",
"company": None,
"birth_date": None,
"sex": None,
"phone": None,
"title": None
},
"custom_fields": { "6598dc92-e273-4944-8cfa-4430a397891e": "Google" },
"bookings_custom_fields": {
"b_3711615": { "55536678-2266-4bb0-99f5-206348244ad2": "CTO" },
"b_3712360": { "55536678-2266-4bb0-99f5-206348244ad2": "COO" }
},
"address": {
"street_address": "Jülicher Straße 68",
"address_line_2": "Hinterhaus",
"zip_code": "52070",
"city": "Aachen",
"area": "NRW",
"country_code": "DE"
},
"meta": {
"timezone": "Europe/Berlin",
"timezone_offset": -120,
"remember_customer": True
},
"verify_guest_email": {
"state": "fESIyHXND2Yv9SYN",
"code": "166655"
}
}
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({
accept_terms: true,
subscribe_newsletter: false,
agreements: {'stadtmitte-buero': true},
customer: {
given_name: 'Max',
family_name: 'Mustermann',
email: 'max.mustermann@mail.com',
mobile: '+491701234567',
company: null,
birth_date: null,
sex: null,
phone: null,
title: null
},
custom_fields: {'6598dc92-e273-4944-8cfa-4430a397891e': 'Google'},
bookings_custom_fields: {
b_3711615: {'55536678-2266-4bb0-99f5-206348244ad2': 'CTO'},
b_3712360: {'55536678-2266-4bb0-99f5-206348244ad2': 'COO'}
},
address: {
street_address: 'Jülicher Straße 68',
address_line_2: 'Hinterhaus',
zip_code: '52070',
city: 'Aachen',
area: 'NRW',
country_code: 'DE'
},
meta: {timezone: 'Europe/Berlin', timezone_offset: -120, remember_customer: true},
verify_guest_email: {state: 'fESIyHXND2Yv9SYN', code: '166655'}
})
};
fetch('https://b.anny.co/api/v1/order', 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",
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([
'accept_terms' => true,
'subscribe_newsletter' => false,
'agreements' => [
'stadtmitte-buero' => true
],
'customer' => [
'given_name' => 'Max',
'family_name' => 'Mustermann',
'email' => 'max.mustermann@mail.com',
'mobile' => '+491701234567',
'company' => null,
'birth_date' => null,
'sex' => null,
'phone' => null,
'title' => null
],
'custom_fields' => [
'6598dc92-e273-4944-8cfa-4430a397891e' => 'Google'
],
'bookings_custom_fields' => [
'b_3711615' => [
'55536678-2266-4bb0-99f5-206348244ad2' => 'CTO'
],
'b_3712360' => [
'55536678-2266-4bb0-99f5-206348244ad2' => 'COO'
]
],
'address' => [
'street_address' => 'Jülicher Straße 68',
'address_line_2' => 'Hinterhaus',
'zip_code' => '52070',
'city' => 'Aachen',
'area' => 'NRW',
'country_code' => 'DE'
],
'meta' => [
'timezone' => 'Europe/Berlin',
'timezone_offset' => -120,
'remember_customer' => true
],
'verify_guest_email' => [
'state' => 'fESIyHXND2Yv9SYN',
'code' => '166655'
]
]),
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"
payload := strings.NewReader("{\n \"accept_terms\": true,\n \"subscribe_newsletter\": false,\n \"agreements\": {\n \"stadtmitte-buero\": true\n },\n \"customer\": {\n \"given_name\": \"Max\",\n \"family_name\": \"Mustermann\",\n \"email\": \"max.mustermann@mail.com\",\n \"mobile\": \"+491701234567\",\n \"company\": null,\n \"birth_date\": null,\n \"sex\": null,\n \"phone\": null,\n \"title\": null\n },\n \"custom_fields\": {\n \"6598dc92-e273-4944-8cfa-4430a397891e\": \"Google\"\n },\n \"bookings_custom_fields\": {\n \"b_3711615\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"CTO\"\n },\n \"b_3712360\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"COO\"\n }\n },\n \"address\": {\n \"street_address\": \"Jülicher Straße 68\",\n \"address_line_2\": \"Hinterhaus\",\n \"zip_code\": \"52070\",\n \"city\": \"Aachen\",\n \"area\": \"NRW\",\n \"country_code\": \"DE\"\n },\n \"meta\": {\n \"timezone\": \"Europe/Berlin\",\n \"timezone_offset\": -120,\n \"remember_customer\": true\n },\n \"verify_guest_email\": {\n \"state\": \"fESIyHXND2Yv9SYN\",\n \"code\": \"166655\"\n }\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")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"accept_terms\": true,\n \"subscribe_newsletter\": false,\n \"agreements\": {\n \"stadtmitte-buero\": true\n },\n \"customer\": {\n \"given_name\": \"Max\",\n \"family_name\": \"Mustermann\",\n \"email\": \"max.mustermann@mail.com\",\n \"mobile\": \"+491701234567\",\n \"company\": null,\n \"birth_date\": null,\n \"sex\": null,\n \"phone\": null,\n \"title\": null\n },\n \"custom_fields\": {\n \"6598dc92-e273-4944-8cfa-4430a397891e\": \"Google\"\n },\n \"bookings_custom_fields\": {\n \"b_3711615\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"CTO\"\n },\n \"b_3712360\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"COO\"\n }\n },\n \"address\": {\n \"street_address\": \"Jülicher Straße 68\",\n \"address_line_2\": \"Hinterhaus\",\n \"zip_code\": \"52070\",\n \"city\": \"Aachen\",\n \"area\": \"NRW\",\n \"country_code\": \"DE\"\n },\n \"meta\": {\n \"timezone\": \"Europe/Berlin\",\n \"timezone_offset\": -120,\n \"remember_customer\": true\n },\n \"verify_guest_email\": {\n \"state\": \"fESIyHXND2Yv9SYN\",\n \"code\": \"166655\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/order")
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 \"accept_terms\": true,\n \"subscribe_newsletter\": false,\n \"agreements\": {\n \"stadtmitte-buero\": true\n },\n \"customer\": {\n \"given_name\": \"Max\",\n \"family_name\": \"Mustermann\",\n \"email\": \"max.mustermann@mail.com\",\n \"mobile\": \"+491701234567\",\n \"company\": null,\n \"birth_date\": null,\n \"sex\": null,\n \"phone\": null,\n \"title\": null\n },\n \"custom_fields\": {\n \"6598dc92-e273-4944-8cfa-4430a397891e\": \"Google\"\n },\n \"bookings_custom_fields\": {\n \"b_3711615\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"CTO\"\n },\n \"b_3712360\": {\n \"55536678-2266-4bb0-99f5-206348244ad2\": \"COO\"\n }\n },\n \"address\": {\n \"street_address\": \"Jülicher Straße 68\",\n \"address_line_2\": \"Hinterhaus\",\n \"zip_code\": \"52070\",\n \"city\": \"Aachen\",\n \"area\": \"NRW\",\n \"country_code\": \"DE\"\n },\n \"meta\": {\n \"timezone\": \"Europe/Berlin\",\n \"timezone_offset\": -120,\n \"remember_customer\": true\n },\n \"verify_guest_email\": {\n \"state\": \"fESIyHXND2Yv9SYN\",\n \"code\": \"166655\"\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": [],
"data": [
{
"type": "orders",
"id": "2010687",
"attributes": {
"number": "BO17499925",
"currency": "EUR",
"total": 249,
"net_amount": 209.24,
"tax_amount": 39.76,
"discount_amount": 0,
"status": "open",
"access_token": "uuzahppQhD7wmJscn8IbwRe9hJb2wq",
"expires_at": null,
"created_at": "2021-09-24T12:18:49+00:00",
"updated_at": "2021-09-24T12:22:02+00:00"
},
"relationships": {
"bookings": {
"data": [
{
"type": "bookings",
"id": "3713015"
}
]
},
"customer": {
"data": {
"type": "customers",
"id": "408936"
}
},
"last_payment": {
"data": null
},
"sub_orders": {
"data": []
}
},
"links": {
"self": "https://b.anny.co/api/v1/orders/2010687"
},
"meta": []
}
],
"included": [
{
"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": true
},
"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": true
},
"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": true
},
"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": true
},
"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-24T11:57:10+00:00",
"access_code": null
},
"meta": {
"resource_list": "Leadership Coach",
"min_duration_total": 249
}
},
{
"type": "bookings",
"id": "3713015",
"attributes": {
"number": "BB88036740",
"status": "accepted",
"is_blocker": false,
"start_date": "2021-10-14T07:00:00+00:00",
"end_date": "2021-10-14T11:00:00+00:00",
"blocker_start_date": "2021-10-14T07:00:00+00:00",
"blocker_end_date": "2021-10-14T11:00:00+00:00",
"description": "",
"charged_duration": 240,
"weight": 1
},
"relationships": {
"booking_add_ons": {
"data": []
},
"resource": {
"data": {
"type": "resources",
"id": "22233"
}
},
"service": {
"data": {
"type": "services",
"id": "2800"
}
},
"sub_bookings": {
"data": []
},
"cancellation_policy": {
"data": null
}
},
"meta": []
},
{
"type": "customers",
"id": "408936",
"attributes": {
"locale": "de",
"title": null,
"given_name": "Max",
"family_name": "Mustermann",
"full_name": "Max Mustermann",
"sex": 0,
"birth_date": null,
"email": "max.mustermann@mail.com",
"mobile": "+491701234567",
"phone": null,
"company": null,
"custom_entry_map": {
"6598dc92-e273-4944-8cfa-4430a397891e": {
"value": "Google",
"formatted_value": "Google",
"label": "Wie bist du auf uns aufmerksam geworden?"
}
},
"created_at": "2021-09-24T12:01:08+00:00"
}
}
]
}Abfrageparameter
Body
application/vnd.api+json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Independent address payload. Use address resource keys.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Antwort
200 - application/vnd.api+json
OK
Array of orders; for each involved organization one
Show child attributes
Show child attributes
⌘I