curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"clientId": "cli_01kv8p20m1gnqvxl92xln6awk8",
"bookingStartUtc": "2026-07-09T13:30:00.000Z",
"bookingEndUtc": "2026-07-09T14:00:00.000Z",
"bookingTz": "America/Toronto",
"locationType": "TRAVEL_ZONE",
"services": [
{
"serviceId": "srv_01kv60qg12e82acr78edfnjhvv",
"offeringId": "off_01kv60qge5eh59ap0gw0pqrrys",
"businessModelType": "SINGLE_BOOKING",
"orderId": "ord_01kx16ek2jf4r9da74adf6m4h0",
"orderItemId": "oi_01kx16ek2kf2fsc9x7b2n1dfc9",
"quantity": 1
}
],
"supplierId": "sup_01kv60qgnef2kt3pvqgwmkbzfr",
"locationId": "stz_01kv60qgs4e4nbjhzradnqtj0h",
"latitude": 43.6532,
"longitude": -79.3832,
"address": {
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"unitNumber": "4B"
},
"capacity": 1,
"notes": []
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings"
payload = {
"clientId": "cli_01kv8p20m1gnqvxl92xln6awk8",
"bookingStartUtc": "2026-07-09T13:30:00.000Z",
"bookingEndUtc": "2026-07-09T14:00:00.000Z",
"bookingTz": "America/Toronto",
"locationType": "TRAVEL_ZONE",
"services": [
{
"serviceId": "srv_01kv60qg12e82acr78edfnjhvv",
"offeringId": "off_01kv60qge5eh59ap0gw0pqrrys",
"businessModelType": "SINGLE_BOOKING",
"orderId": "ord_01kx16ek2jf4r9da74adf6m4h0",
"orderItemId": "oi_01kx16ek2kf2fsc9x7b2n1dfc9",
"quantity": 1
}
],
"supplierId": "sup_01kv60qgnef2kt3pvqgwmkbzfr",
"locationId": "stz_01kv60qgs4e4nbjhzradnqtj0h",
"latitude": 43.6532,
"longitude": -79.3832,
"address": {
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"unitNumber": "4B"
},
"capacity": 1,
"notes": []
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clientId: 'cli_01kv8p20m1gnqvxl92xln6awk8',
bookingStartUtc: '2026-07-09T13:30:00.000Z',
bookingEndUtc: '2026-07-09T14:00:00.000Z',
bookingTz: 'America/Toronto',
locationType: 'TRAVEL_ZONE',
services: [
{
serviceId: 'srv_01kv60qg12e82acr78edfnjhvv',
offeringId: 'off_01kv60qge5eh59ap0gw0pqrrys',
businessModelType: 'SINGLE_BOOKING',
orderId: 'ord_01kx16ek2jf4r9da74adf6m4h0',
orderItemId: 'oi_01kx16ek2kf2fsc9x7b2n1dfc9',
quantity: 1
}
],
supplierId: 'sup_01kv60qgnef2kt3pvqgwmkbzfr',
locationId: 'stz_01kv60qgs4e4nbjhzradnqtj0h',
latitude: 43.6532,
longitude: -79.3832,
address: {
addressOneLine: '10 Main St, Toronto, ON M5V 1A1, Canada',
streetNumber: '10',
streetName: 'Main St',
city: 'Toronto',
state: 'ON',
country: 'CA',
zipCode: 'M5V 1A1',
unitNumber: '4B'
},
capacity: 1,
notes: []
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/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://apiv2.gomarketbox.com/v1/projects/{projectId}/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([
'clientId' => 'cli_01kv8p20m1gnqvxl92xln6awk8',
'bookingStartUtc' => '2026-07-09T13:30:00.000Z',
'bookingEndUtc' => '2026-07-09T14:00:00.000Z',
'bookingTz' => 'America/Toronto',
'locationType' => 'TRAVEL_ZONE',
'services' => [
[
'serviceId' => 'srv_01kv60qg12e82acr78edfnjhvv',
'offeringId' => 'off_01kv60qge5eh59ap0gw0pqrrys',
'businessModelType' => 'SINGLE_BOOKING',
'orderId' => 'ord_01kx16ek2jf4r9da74adf6m4h0',
'orderItemId' => 'oi_01kx16ek2kf2fsc9x7b2n1dfc9',
'quantity' => 1
]
],
'supplierId' => 'sup_01kv60qgnef2kt3pvqgwmkbzfr',
'locationId' => 'stz_01kv60qgs4e4nbjhzradnqtj0h',
'latitude' => 43.6532,
'longitude' => -79.3832,
'address' => [
'addressOneLine' => '10 Main St, Toronto, ON M5V 1A1, Canada',
'streetNumber' => '10',
'streetName' => 'Main St',
'city' => 'Toronto',
'state' => 'ON',
'country' => 'CA',
'zipCode' => 'M5V 1A1',
'unitNumber' => '4B'
],
'capacity' => 1,
'notes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings"
payload := strings.NewReader("{\n \"clientId\": \"cli_01kv8p20m1gnqvxl92xln6awk8\",\n \"bookingStartUtc\": \"2026-07-09T13:30:00.000Z\",\n \"bookingEndUtc\": \"2026-07-09T14:00:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"TRAVEL_ZONE\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kv60qg12e82acr78edfnjhvv\",\n \"offeringId\": \"off_01kv60qge5eh59ap0gw0pqrrys\",\n \"businessModelType\": \"SINGLE_BOOKING\",\n \"orderId\": \"ord_01kx16ek2jf4r9da74adf6m4h0\",\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"quantity\": 1\n }\n ],\n \"supplierId\": \"sup_01kv60qgnef2kt3pvqgwmkbzfr\",\n \"locationId\": \"stz_01kv60qgs4e4nbjhzradnqtj0h\",\n \"latitude\": 43.6532,\n \"longitude\": -79.3832,\n \"address\": {\n \"addressOneLine\": \"10 Main St, Toronto, ON M5V 1A1, Canada\",\n \"streetNumber\": \"10\",\n \"streetName\": \"Main St\",\n \"city\": \"Toronto\",\n \"state\": \"ON\",\n \"country\": \"CA\",\n \"zipCode\": \"M5V 1A1\",\n \"unitNumber\": \"4B\"\n },\n \"capacity\": 1,\n \"notes\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"cli_01kv8p20m1gnqvxl92xln6awk8\",\n \"bookingStartUtc\": \"2026-07-09T13:30:00.000Z\",\n \"bookingEndUtc\": \"2026-07-09T14:00:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"TRAVEL_ZONE\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kv60qg12e82acr78edfnjhvv\",\n \"offeringId\": \"off_01kv60qge5eh59ap0gw0pqrrys\",\n \"businessModelType\": \"SINGLE_BOOKING\",\n \"orderId\": \"ord_01kx16ek2jf4r9da74adf6m4h0\",\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"quantity\": 1\n }\n ],\n \"supplierId\": \"sup_01kv60qgnef2kt3pvqgwmkbzfr\",\n \"locationId\": \"stz_01kv60qgs4e4nbjhzradnqtj0h\",\n \"latitude\": 43.6532,\n \"longitude\": -79.3832,\n \"address\": {\n \"addressOneLine\": \"10 Main St, Toronto, ON M5V 1A1, Canada\",\n \"streetNumber\": \"10\",\n \"streetName\": \"Main St\",\n \"city\": \"Toronto\",\n \"state\": \"ON\",\n \"country\": \"CA\",\n \"zipCode\": \"M5V 1A1\",\n \"unitNumber\": \"4B\"\n },\n \"capacity\": 1,\n \"notes\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"cli_01kv8p20m1gnqvxl92xln6awk8\",\n \"bookingStartUtc\": \"2026-07-09T13:30:00.000Z\",\n \"bookingEndUtc\": \"2026-07-09T14:00:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"TRAVEL_ZONE\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kv60qg12e82acr78edfnjhvv\",\n \"offeringId\": \"off_01kv60qge5eh59ap0gw0pqrrys\",\n \"businessModelType\": \"SINGLE_BOOKING\",\n \"orderId\": \"ord_01kx16ek2jf4r9da74adf6m4h0\",\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"quantity\": 1\n }\n ],\n \"supplierId\": \"sup_01kv60qgnef2kt3pvqgwmkbzfr\",\n \"locationId\": \"stz_01kv60qgs4e4nbjhzradnqtj0h\",\n \"latitude\": 43.6532,\n \"longitude\": -79.3832,\n \"address\": {\n \"addressOneLine\": \"10 Main St, Toronto, ON M5V 1A1, Canada\",\n \"streetNumber\": \"10\",\n \"streetName\": \"Main St\",\n \"city\": \"Toronto\",\n \"state\": \"ON\",\n \"country\": \"CA\",\n \"zipCode\": \"M5V 1A1\",\n \"unitNumber\": \"4B\"\n },\n \"capacity\": 1,\n \"notes\": []\n}"
response = http.request(request)
puts response.read_body{
"data": {
"projectId": "<string>",
"tenantId": "<string>",
"bookingId": "<string>",
"supplierId": "<string>",
"clientId": "<string>",
"bookingStartUtc": "2023-11-07T05:31:56Z",
"bookingEndUtc": "2023-11-07T05:31:56Z",
"bookingTz": "<string>",
"bookingLocalDate": "<string>",
"bookingLocalStartTime": "<string>",
"bookingLocalEndTime": "<string>",
"bookingLocalEndDate": "<string>",
"locationType": "PHYSICAL",
"locationId": "<string>",
"latitude": 123,
"longitude": 123,
"address": {
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"unitNumber": "4B"
},
"capacity": 1,
"participantCount": 1,
"waitlistCount": 1,
"isGroupBooking": true,
"status": "SCHEDULED",
"statusUpdatedAt": "2023-11-07T05:31:56Z",
"counts": {
"services": 1,
"notes": 1,
"participants": 1
},
"deleted": true,
"version": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>",
"seriesId": "<string>",
"occurrenceLocalDate": "<string>",
"isException": true,
"packageOrderItemId": "<string>",
"locale": "<string>",
"attribution": {
"searchId": "srch_01k7q3x9h4e8rb2d6m0z5a7c1n",
"sessionKey": "sess-example-01",
"surface": "results"
},
"statusUpdatedBy": "<string>",
"statusUpdatedByCapacity": "ADMIN",
"cancellationReason": "<string>",
"cancelledBy": "<string>",
"cancellationInitiatedBy": "CLIENT",
"cancellationReasonCode": "CLIENT_REQUESTED",
"creditTreatment": "RETURN",
"durationOverrideMinutes": 720,
"durationOverrideReason": "<string>"
}
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}Create a new booking
Creates a single booking. Each service line must reference an existing order + order item (orderId + orderItemId) to draw down — create and pay for an order first. Location fields depend on locationType: TRAVEL_ZONE requires locationId, latitude, longitude, and a structured address; PHYSICAL requires only locationId; VIRTUAL requires none. Local-time fields are derived server-side from bookingTz and must not be sent. The order need not be paid (credits exist from order creation), but a CANCELLED order books nothing (409 ORDER_CANCELLED): its cascade has already released its credits.
curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"clientId": "cli_01kv8p20m1gnqvxl92xln6awk8",
"bookingStartUtc": "2026-07-09T13:30:00.000Z",
"bookingEndUtc": "2026-07-09T14:00:00.000Z",
"bookingTz": "America/Toronto",
"locationType": "TRAVEL_ZONE",
"services": [
{
"serviceId": "srv_01kv60qg12e82acr78edfnjhvv",
"offeringId": "off_01kv60qge5eh59ap0gw0pqrrys",
"businessModelType": "SINGLE_BOOKING",
"orderId": "ord_01kx16ek2jf4r9da74adf6m4h0",
"orderItemId": "oi_01kx16ek2kf2fsc9x7b2n1dfc9",
"quantity": 1
}
],
"supplierId": "sup_01kv60qgnef2kt3pvqgwmkbzfr",
"locationId": "stz_01kv60qgs4e4nbjhzradnqtj0h",
"latitude": 43.6532,
"longitude": -79.3832,
"address": {
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"unitNumber": "4B"
},
"capacity": 1,
"notes": []
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings"
payload = {
"clientId": "cli_01kv8p20m1gnqvxl92xln6awk8",
"bookingStartUtc": "2026-07-09T13:30:00.000Z",
"bookingEndUtc": "2026-07-09T14:00:00.000Z",
"bookingTz": "America/Toronto",
"locationType": "TRAVEL_ZONE",
"services": [
{
"serviceId": "srv_01kv60qg12e82acr78edfnjhvv",
"offeringId": "off_01kv60qge5eh59ap0gw0pqrrys",
"businessModelType": "SINGLE_BOOKING",
"orderId": "ord_01kx16ek2jf4r9da74adf6m4h0",
"orderItemId": "oi_01kx16ek2kf2fsc9x7b2n1dfc9",
"quantity": 1
}
],
"supplierId": "sup_01kv60qgnef2kt3pvqgwmkbzfr",
"locationId": "stz_01kv60qgs4e4nbjhzradnqtj0h",
"latitude": 43.6532,
"longitude": -79.3832,
"address": {
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"unitNumber": "4B"
},
"capacity": 1,
"notes": []
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clientId: 'cli_01kv8p20m1gnqvxl92xln6awk8',
bookingStartUtc: '2026-07-09T13:30:00.000Z',
bookingEndUtc: '2026-07-09T14:00:00.000Z',
bookingTz: 'America/Toronto',
locationType: 'TRAVEL_ZONE',
services: [
{
serviceId: 'srv_01kv60qg12e82acr78edfnjhvv',
offeringId: 'off_01kv60qge5eh59ap0gw0pqrrys',
businessModelType: 'SINGLE_BOOKING',
orderId: 'ord_01kx16ek2jf4r9da74adf6m4h0',
orderItemId: 'oi_01kx16ek2kf2fsc9x7b2n1dfc9',
quantity: 1
}
],
supplierId: 'sup_01kv60qgnef2kt3pvqgwmkbzfr',
locationId: 'stz_01kv60qgs4e4nbjhzradnqtj0h',
latitude: 43.6532,
longitude: -79.3832,
address: {
addressOneLine: '10 Main St, Toronto, ON M5V 1A1, Canada',
streetNumber: '10',
streetName: 'Main St',
city: 'Toronto',
state: 'ON',
country: 'CA',
zipCode: 'M5V 1A1',
unitNumber: '4B'
},
capacity: 1,
notes: []
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/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://apiv2.gomarketbox.com/v1/projects/{projectId}/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([
'clientId' => 'cli_01kv8p20m1gnqvxl92xln6awk8',
'bookingStartUtc' => '2026-07-09T13:30:00.000Z',
'bookingEndUtc' => '2026-07-09T14:00:00.000Z',
'bookingTz' => 'America/Toronto',
'locationType' => 'TRAVEL_ZONE',
'services' => [
[
'serviceId' => 'srv_01kv60qg12e82acr78edfnjhvv',
'offeringId' => 'off_01kv60qge5eh59ap0gw0pqrrys',
'businessModelType' => 'SINGLE_BOOKING',
'orderId' => 'ord_01kx16ek2jf4r9da74adf6m4h0',
'orderItemId' => 'oi_01kx16ek2kf2fsc9x7b2n1dfc9',
'quantity' => 1
]
],
'supplierId' => 'sup_01kv60qgnef2kt3pvqgwmkbzfr',
'locationId' => 'stz_01kv60qgs4e4nbjhzradnqtj0h',
'latitude' => 43.6532,
'longitude' => -79.3832,
'address' => [
'addressOneLine' => '10 Main St, Toronto, ON M5V 1A1, Canada',
'streetNumber' => '10',
'streetName' => 'Main St',
'city' => 'Toronto',
'state' => 'ON',
'country' => 'CA',
'zipCode' => 'M5V 1A1',
'unitNumber' => '4B'
],
'capacity' => 1,
'notes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings"
payload := strings.NewReader("{\n \"clientId\": \"cli_01kv8p20m1gnqvxl92xln6awk8\",\n \"bookingStartUtc\": \"2026-07-09T13:30:00.000Z\",\n \"bookingEndUtc\": \"2026-07-09T14:00:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"TRAVEL_ZONE\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kv60qg12e82acr78edfnjhvv\",\n \"offeringId\": \"off_01kv60qge5eh59ap0gw0pqrrys\",\n \"businessModelType\": \"SINGLE_BOOKING\",\n \"orderId\": \"ord_01kx16ek2jf4r9da74adf6m4h0\",\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"quantity\": 1\n }\n ],\n \"supplierId\": \"sup_01kv60qgnef2kt3pvqgwmkbzfr\",\n \"locationId\": \"stz_01kv60qgs4e4nbjhzradnqtj0h\",\n \"latitude\": 43.6532,\n \"longitude\": -79.3832,\n \"address\": {\n \"addressOneLine\": \"10 Main St, Toronto, ON M5V 1A1, Canada\",\n \"streetNumber\": \"10\",\n \"streetName\": \"Main St\",\n \"city\": \"Toronto\",\n \"state\": \"ON\",\n \"country\": \"CA\",\n \"zipCode\": \"M5V 1A1\",\n \"unitNumber\": \"4B\"\n },\n \"capacity\": 1,\n \"notes\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"cli_01kv8p20m1gnqvxl92xln6awk8\",\n \"bookingStartUtc\": \"2026-07-09T13:30:00.000Z\",\n \"bookingEndUtc\": \"2026-07-09T14:00:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"TRAVEL_ZONE\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kv60qg12e82acr78edfnjhvv\",\n \"offeringId\": \"off_01kv60qge5eh59ap0gw0pqrrys\",\n \"businessModelType\": \"SINGLE_BOOKING\",\n \"orderId\": \"ord_01kx16ek2jf4r9da74adf6m4h0\",\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"quantity\": 1\n }\n ],\n \"supplierId\": \"sup_01kv60qgnef2kt3pvqgwmkbzfr\",\n \"locationId\": \"stz_01kv60qgs4e4nbjhzradnqtj0h\",\n \"latitude\": 43.6532,\n \"longitude\": -79.3832,\n \"address\": {\n \"addressOneLine\": \"10 Main St, Toronto, ON M5V 1A1, Canada\",\n \"streetNumber\": \"10\",\n \"streetName\": \"Main St\",\n \"city\": \"Toronto\",\n \"state\": \"ON\",\n \"country\": \"CA\",\n \"zipCode\": \"M5V 1A1\",\n \"unitNumber\": \"4B\"\n },\n \"capacity\": 1,\n \"notes\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"cli_01kv8p20m1gnqvxl92xln6awk8\",\n \"bookingStartUtc\": \"2026-07-09T13:30:00.000Z\",\n \"bookingEndUtc\": \"2026-07-09T14:00:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"TRAVEL_ZONE\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kv60qg12e82acr78edfnjhvv\",\n \"offeringId\": \"off_01kv60qge5eh59ap0gw0pqrrys\",\n \"businessModelType\": \"SINGLE_BOOKING\",\n \"orderId\": \"ord_01kx16ek2jf4r9da74adf6m4h0\",\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"quantity\": 1\n }\n ],\n \"supplierId\": \"sup_01kv60qgnef2kt3pvqgwmkbzfr\",\n \"locationId\": \"stz_01kv60qgs4e4nbjhzradnqtj0h\",\n \"latitude\": 43.6532,\n \"longitude\": -79.3832,\n \"address\": {\n \"addressOneLine\": \"10 Main St, Toronto, ON M5V 1A1, Canada\",\n \"streetNumber\": \"10\",\n \"streetName\": \"Main St\",\n \"city\": \"Toronto\",\n \"state\": \"ON\",\n \"country\": \"CA\",\n \"zipCode\": \"M5V 1A1\",\n \"unitNumber\": \"4B\"\n },\n \"capacity\": 1,\n \"notes\": []\n}"
response = http.request(request)
puts response.read_body{
"data": {
"projectId": "<string>",
"tenantId": "<string>",
"bookingId": "<string>",
"supplierId": "<string>",
"clientId": "<string>",
"bookingStartUtc": "2023-11-07T05:31:56Z",
"bookingEndUtc": "2023-11-07T05:31:56Z",
"bookingTz": "<string>",
"bookingLocalDate": "<string>",
"bookingLocalStartTime": "<string>",
"bookingLocalEndTime": "<string>",
"bookingLocalEndDate": "<string>",
"locationType": "PHYSICAL",
"locationId": "<string>",
"latitude": 123,
"longitude": 123,
"address": {
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"unitNumber": "4B"
},
"capacity": 1,
"participantCount": 1,
"waitlistCount": 1,
"isGroupBooking": true,
"status": "SCHEDULED",
"statusUpdatedAt": "2023-11-07T05:31:56Z",
"counts": {
"services": 1,
"notes": 1,
"participants": 1
},
"deleted": true,
"version": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>",
"seriesId": "<string>",
"occurrenceLocalDate": "<string>",
"isException": true,
"packageOrderItemId": "<string>",
"locale": "<string>",
"attribution": {
"searchId": "srch_01k7q3x9h4e8rb2d6m0z5a7c1n",
"sessionKey": "sess-example-01",
"surface": "results"
},
"statusUpdatedBy": "<string>",
"statusUpdatedByCapacity": "ADMIN",
"cancellationReason": "<string>",
"cancelledBy": "<string>",
"cancellationInitiatedBy": "CLIENT",
"cancellationReasonCode": "CLIENT_REQUESTED",
"creditTreatment": "RETURN",
"durationOverrideMinutes": 720,
"durationOverrideReason": "<string>"
}
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}Authorizations
API key minted in the MarketBox dashboard. Scope is restricted to the projects you select at creation time. Every route needs the key's standard API access (*) except POST /v1/projects/{projectId}/events, which needs events:write; a key without * is refused with 403 CAPABILITY_NOT_GRANTED.
Path Parameters
Body
Booking data