Get or create an active order
curl --request GET \
--url https://b.anny.co/api/v1/orderimport requests
url = "https://b.anny.co/api/v1/order"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
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 => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/order"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://b.anny.co/api/v1/order")
.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::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"type": "orders",
"id": "253",
"attributes": {
"number": "BO655735",
"currency": "EUR",
"total": 40,
"net_amount": 33.61,
"tax_amount": 6.39,
"discount_amount": 0,
"status": "draft",
"access_token": "cVVE7ZZ7p3NXHxEdfKM8gAc8qHpq87",
"expires_at": "2020-05-24T17:19:12+00:00",
"created_at": "2020-05-24T16:51:22+00:00",
"updated_at": "2020-05-24T17:04:12+00:00"
},
"relationships": {
"bookings": {
"data": [
{
"type": "bookings",
"id": "83"
},
{
"type": "bookings",
"id": "84"
}
]
},
"customer": {
"data": null
}
},
"links": {
"self": "http://bookingbuddy.test/api/v1/orders/253"
},
"meta": {
"download_url": "http://bookingbuddy.test/downloads/order-confirmation/253/cVVE7ZZ7p3NXHxEdfKM8gAc8qHpq87",
"voucher_code": null
}
},
"included": [
{
"type": "images",
"id": "17",
"attributes": {
"url": "http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg",
"copyright": null,
"preview_image_base64": null,
"small_path": "http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg",
"medium_path": "http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg",
"large_path": "http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg",
"created_at": "2020-05-24T12:49:13+00:00"
}
},
{
"type": "organizations",
"id": "5",
"attributes": {
"slug": "blick-and-sons",
"name": "Blick and Sons",
"description": "Aliquid dolorem corporis doloremque ut natus. Et eos deserunt ipsum perferendis. Voluptatem repellendus distinctio suscipit ad.",
"plain_description": "Aliquid dolorem corporis doloremque ut natus. Et eos deserunt ipsum perferendis. Voluptatem repellendus distinctio suscipit ad.",
"official_name": "Blick and Sons",
"support_email": "junius.koch@greenholt.info",
"phone": null,
"timezone": "Europe/Berlin",
"is_organization": true,
"responsible_for_contents": null,
"ceo": null,
"vat_id": null,
"register_number": null,
"local_court": null,
"financial_office": null
},
"relationships": {
"legal_documents": {
"data": []
}
}
},
{
"type": "resources",
"id": "24",
"attributes": {
"slug": "blick-and-sons-meeting-room-10",
"name": "Meeting room 10",
"cancelable": true,
"auto_accept_bookings": false
},
"relationships": {
"cover_image": {
"data": {
"type": "images",
"id": "17"
}
},
"organization": {
"data": {
"type": "organizations",
"id": "5"
}
}
}
},
{
"type": "bookings",
"id": "83",
"attributes": {
"number": "BB589425",
"status": "reserved",
"start_date": "2020-05-27T08:00:00+00:00",
"end_date": "2020-05-27T09:45:00+00:00",
"blocker_start_date": "2020-05-27T08:00:00+00:00",
"blocker_end_date": "2020-05-27T09:45:00+00:00",
"description": null,
"charged_duration": 105,
"currency": "EUR",
"total": 105,
"subtotal": 105,
"charged_total": 105,
"created_at": "2020-05-24T16:52:38+00:00",
"canceled_at": null
},
"relationships": {
"booking_add_ons": {
"data": []
},
"resource": {
"data": {
"type": "resources",
"id": "24"
}
},
"sub_bookings": {
"data": []
}
},
"meta": {
"ics_link": "http://bookingbuddy.test/add-to-calendar/booking/83?type=ics",
"google_link": "http://bookingbuddy.test/add-to-calendar/booking/83?type=google",
"outlook_link": "http://bookingbuddy.test/add-to-calendar/booking/83?type=webOutlook",
"yahoo_link": "http://bookingbuddy.test/add-to-calendar/booking/83?type=yahoo"
}
},
{
"type": "images",
"id": "8",
"attributes": {
"url": "http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg",
"copyright": null,
"preview_image_base64": null,
"small_path": "http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg",
"medium_path": "http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg",
"large_path": "http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg",
"created_at": "2020-05-24T12:49:13+00:00"
}
},
{
"type": "resources",
"id": "15",
"attributes": {
"slug": "blick-and-sons-meeting-room-1",
"name": "Meeting room 1",
"cancelable": true,
"auto_accept_bookings": false
},
"relationships": {
"cover_image": {
"data": {
"type": "images",
"id": "8"
}
},
"organization": {
"data": {
"type": "organizations",
"id": "5"
}
}
}
},
{
"type": "bookings",
"id": "84",
"attributes": {
"number": "BB874795",
"status": "reserved",
"start_date": "2020-05-26T09:30:00+00:00",
"end_date": "2020-05-26T10:30:00+00:00",
"blocker_start_date": "2020-05-26T09:30:00+00:00",
"blocker_end_date": "2020-05-26T10:30:00+00:00",
"description": null,
"charged_duration": 60,
"currency": "EUR",
"total": 40,
"subtotal": 40,
"charged_total": 40,
"created_at": "2020-05-24T17:04:12+00:00",
"canceled_at": null
},
"relationships": {
"booking_add_ons": {
"data": []
},
"resource": {
"data": {
"type": "resources",
"id": "15"
}
},
"sub_bookings": {
"data": []
}
},
"meta": {
"ics_link": "http://bookingbuddy.test/add-to-calendar/booking/84?type=ics",
"google_link": "http://bookingbuddy.test/add-to-calendar/booking/84?type=google",
"outlook_link": "http://bookingbuddy.test/add-to-calendar/booking/84?type=webOutlook",
"yahoo_link": "http://bookingbuddy.test/add-to-calendar/booking/84?type=yahoo"
}
}
]
}{}Orders & Checkout
Get or create an active order
Auth: optional. This endpoint will return the currently active order (indentified by a cookie). Otherwise, the response would be empty.
Note that orders expire automatically at expires_at. This date will be extended with each booking which is added to the order.
An order with status=draft represents a cart.
GET
/
api
/
v1
/
order
Get or create an active order
curl --request GET \
--url https://b.anny.co/api/v1/orderimport requests
url = "https://b.anny.co/api/v1/order"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
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 => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/order"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://b.anny.co/api/v1/order")
.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::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"type": "orders",
"id": "253",
"attributes": {
"number": "BO655735",
"currency": "EUR",
"total": 40,
"net_amount": 33.61,
"tax_amount": 6.39,
"discount_amount": 0,
"status": "draft",
"access_token": "cVVE7ZZ7p3NXHxEdfKM8gAc8qHpq87",
"expires_at": "2020-05-24T17:19:12+00:00",
"created_at": "2020-05-24T16:51:22+00:00",
"updated_at": "2020-05-24T17:04:12+00:00"
},
"relationships": {
"bookings": {
"data": [
{
"type": "bookings",
"id": "83"
},
{
"type": "bookings",
"id": "84"
}
]
},
"customer": {
"data": null
}
},
"links": {
"self": "http://bookingbuddy.test/api/v1/orders/253"
},
"meta": {
"download_url": "http://bookingbuddy.test/downloads/order-confirmation/253/cVVE7ZZ7p3NXHxEdfKM8gAc8qHpq87",
"voucher_code": null
}
},
"included": [
{
"type": "images",
"id": "17",
"attributes": {
"url": "http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg",
"copyright": null,
"preview_image_base64": null,
"small_path": "http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg",
"medium_path": "http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg",
"large_path": "http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg",
"created_at": "2020-05-24T12:49:13+00:00"
}
},
{
"type": "organizations",
"id": "5",
"attributes": {
"slug": "blick-and-sons",
"name": "Blick and Sons",
"description": "Aliquid dolorem corporis doloremque ut natus. Et eos deserunt ipsum perferendis. Voluptatem repellendus distinctio suscipit ad.",
"plain_description": "Aliquid dolorem corporis doloremque ut natus. Et eos deserunt ipsum perferendis. Voluptatem repellendus distinctio suscipit ad.",
"official_name": "Blick and Sons",
"support_email": "junius.koch@greenholt.info",
"phone": null,
"timezone": "Europe/Berlin",
"is_organization": true,
"responsible_for_contents": null,
"ceo": null,
"vat_id": null,
"register_number": null,
"local_court": null,
"financial_office": null
},
"relationships": {
"legal_documents": {
"data": []
}
}
},
{
"type": "resources",
"id": "24",
"attributes": {
"slug": "blick-and-sons-meeting-room-10",
"name": "Meeting room 10",
"cancelable": true,
"auto_accept_bookings": false
},
"relationships": {
"cover_image": {
"data": {
"type": "images",
"id": "17"
}
},
"organization": {
"data": {
"type": "organizations",
"id": "5"
}
}
}
},
{
"type": "bookings",
"id": "83",
"attributes": {
"number": "BB589425",
"status": "reserved",
"start_date": "2020-05-27T08:00:00+00:00",
"end_date": "2020-05-27T09:45:00+00:00",
"blocker_start_date": "2020-05-27T08:00:00+00:00",
"blocker_end_date": "2020-05-27T09:45:00+00:00",
"description": null,
"charged_duration": 105,
"currency": "EUR",
"total": 105,
"subtotal": 105,
"charged_total": 105,
"created_at": "2020-05-24T16:52:38+00:00",
"canceled_at": null
},
"relationships": {
"booking_add_ons": {
"data": []
},
"resource": {
"data": {
"type": "resources",
"id": "24"
}
},
"sub_bookings": {
"data": []
}
},
"meta": {
"ics_link": "http://bookingbuddy.test/add-to-calendar/booking/83?type=ics",
"google_link": "http://bookingbuddy.test/add-to-calendar/booking/83?type=google",
"outlook_link": "http://bookingbuddy.test/add-to-calendar/booking/83?type=webOutlook",
"yahoo_link": "http://bookingbuddy.test/add-to-calendar/booking/83?type=yahoo"
}
},
{
"type": "images",
"id": "8",
"attributes": {
"url": "http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg",
"copyright": null,
"preview_image_base64": null,
"small_path": "http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg",
"medium_path": "http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg",
"large_path": "http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg",
"created_at": "2020-05-24T12:49:13+00:00"
}
},
{
"type": "resources",
"id": "15",
"attributes": {
"slug": "blick-and-sons-meeting-room-1",
"name": "Meeting room 1",
"cancelable": true,
"auto_accept_bookings": false
},
"relationships": {
"cover_image": {
"data": {
"type": "images",
"id": "8"
}
},
"organization": {
"data": {
"type": "organizations",
"id": "5"
}
}
}
},
{
"type": "bookings",
"id": "84",
"attributes": {
"number": "BB874795",
"status": "reserved",
"start_date": "2020-05-26T09:30:00+00:00",
"end_date": "2020-05-26T10:30:00+00:00",
"blocker_start_date": "2020-05-26T09:30:00+00:00",
"blocker_end_date": "2020-05-26T10:30:00+00:00",
"description": null,
"charged_duration": 60,
"currency": "EUR",
"total": 40,
"subtotal": 40,
"charged_total": 40,
"created_at": "2020-05-24T17:04:12+00:00",
"canceled_at": null
},
"relationships": {
"booking_add_ons": {
"data": []
},
"resource": {
"data": {
"type": "resources",
"id": "15"
}
},
"sub_bookings": {
"data": []
}
},
"meta": {
"ics_link": "http://bookingbuddy.test/add-to-calendar/booking/84?type=ics",
"google_link": "http://bookingbuddy.test/add-to-calendar/booking/84?type=google",
"outlook_link": "http://bookingbuddy.test/add-to-calendar/booking/84?type=webOutlook",
"yahoo_link": "http://bookingbuddy.test/add-to-calendar/booking/84?type=yahoo"
}
}
]
}{}Abfrageparameter
Allows to include allowed resources in the response
Verfügbare Optionen:
bookings, bookings.booking_add_ons.add_on, bookings.resource, bookings.resource.parent, bookings.resource.settings, bookings.service, bookings.service.add_ons, bookings.sub_bookings.resource, bookings.sub_bookings.service, bookings.resource.cover_image, bookings.cancellation_policy, customer, customer.address, voucher, organization, organization.logo_image, organization.legal_documents, invoice, invoice.items, invoice_history, invoice_history.items, sub_orders, sub_orders.bookings, last_payment, last_payment.method, sub_orders, sub_orders.bookings, sub_orders.organization, sub_orders.organization.legal_documents Verfügbare Optionen:
number, total, status, created_at Antwort
OK
An order groups one or more bookings into a single transaction with payment and invoicing.
Show child attributes
Show child attributes
⌘I