curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/orders/{orderId}/package-bookings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"orderItemId": "oi_01kx16ek2kf2fsc9x7b2n1dfc9",
"idempotencyKey": "a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"atomicity": "all_or_nothing",
"sessions": [
{
"supplierId": "sup_01kx16ejb3fz2g5h8k1m4p7r9t",
"bookingStartUtc": "2026-11-03T20:00:00.000Z",
"bookingEndUtc": "2026-11-03T20:30:00.000Z",
"bookingTz": "America/Toronto",
"locationType": "VIRTUAL",
"services": [
{
"serviceId": "srv_01kx16ej8wfp0b4v3x1q7m2d5c",
"offeringId": "off_01kx16ej9af1c3s8t6y2w4n7hb"
}
],
"locationId": "loc_01kx16ejc7fq4r6s9v2x5z8b1d",
"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"
}
}
],
"slateId": "slate_01kx16ejsqffc9rbgdcc591w2p",
"slotIds": [
"slot_01kx16ejsrfs7tf3edy19wdsf8"
]
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/orders/{orderId}/package-bookings"
payload = {
"orderItemId": "oi_01kx16ek2kf2fsc9x7b2n1dfc9",
"idempotencyKey": "a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"atomicity": "all_or_nothing",
"sessions": [
{
"supplierId": "sup_01kx16ejb3fz2g5h8k1m4p7r9t",
"bookingStartUtc": "2026-11-03T20:00:00.000Z",
"bookingEndUtc": "2026-11-03T20:30:00.000Z",
"bookingTz": "America/Toronto",
"locationType": "VIRTUAL",
"services": [
{
"serviceId": "srv_01kx16ej8wfp0b4v3x1q7m2d5c",
"offeringId": "off_01kx16ej9af1c3s8t6y2w4n7hb"
}
],
"locationId": "loc_01kx16ejc7fq4r6s9v2x5z8b1d",
"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"
}
}
],
"slateId": "slate_01kx16ejsqffc9rbgdcc591w2p",
"slotIds": ["slot_01kx16ejsrfs7tf3edy19wdsf8"]
}
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({
orderItemId: 'oi_01kx16ek2kf2fsc9x7b2n1dfc9',
idempotencyKey: 'a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b',
atomicity: 'all_or_nothing',
sessions: [
{
supplierId: 'sup_01kx16ejb3fz2g5h8k1m4p7r9t',
bookingStartUtc: '2026-11-03T20:00:00.000Z',
bookingEndUtc: '2026-11-03T20:30:00.000Z',
bookingTz: 'America/Toronto',
locationType: 'VIRTUAL',
services: [
{
serviceId: 'srv_01kx16ej8wfp0b4v3x1q7m2d5c',
offeringId: 'off_01kx16ej9af1c3s8t6y2w4n7hb'
}
],
locationId: 'loc_01kx16ejc7fq4r6s9v2x5z8b1d',
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'
}
}
],
slateId: 'slate_01kx16ejsqffc9rbgdcc591w2p',
slotIds: ['slot_01kx16ejsrfs7tf3edy19wdsf8']
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/orders/{orderId}/package-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}/orders/{orderId}/package-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([
'orderItemId' => 'oi_01kx16ek2kf2fsc9x7b2n1dfc9',
'idempotencyKey' => 'a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b',
'atomicity' => 'all_or_nothing',
'sessions' => [
[
'supplierId' => 'sup_01kx16ejb3fz2g5h8k1m4p7r9t',
'bookingStartUtc' => '2026-11-03T20:00:00.000Z',
'bookingEndUtc' => '2026-11-03T20:30:00.000Z',
'bookingTz' => 'America/Toronto',
'locationType' => 'VIRTUAL',
'services' => [
[
'serviceId' => 'srv_01kx16ej8wfp0b4v3x1q7m2d5c',
'offeringId' => 'off_01kx16ej9af1c3s8t6y2w4n7hb'
]
],
'locationId' => 'loc_01kx16ejc7fq4r6s9v2x5z8b1d',
'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'
]
]
],
'slateId' => 'slate_01kx16ejsqffc9rbgdcc591w2p',
'slotIds' => [
'slot_01kx16ejsrfs7tf3edy19wdsf8'
]
]),
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}/orders/{orderId}/package-bookings"
payload := strings.NewReader("{\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"idempotencyKey\": \"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b\",\n \"atomicity\": \"all_or_nothing\",\n \"sessions\": [\n {\n \"supplierId\": \"sup_01kx16ejb3fz2g5h8k1m4p7r9t\",\n \"bookingStartUtc\": \"2026-11-03T20:00:00.000Z\",\n \"bookingEndUtc\": \"2026-11-03T20:30:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"VIRTUAL\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kx16ej8wfp0b4v3x1q7m2d5c\",\n \"offeringId\": \"off_01kx16ej9af1c3s8t6y2w4n7hb\"\n }\n ],\n \"locationId\": \"loc_01kx16ejc7fq4r6s9v2x5z8b1d\",\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 }\n ],\n \"slateId\": \"slate_01kx16ejsqffc9rbgdcc591w2p\",\n \"slotIds\": [\n \"slot_01kx16ejsrfs7tf3edy19wdsf8\"\n ]\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}/orders/{orderId}/package-bookings")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"idempotencyKey\": \"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b\",\n \"atomicity\": \"all_or_nothing\",\n \"sessions\": [\n {\n \"supplierId\": \"sup_01kx16ejb3fz2g5h8k1m4p7r9t\",\n \"bookingStartUtc\": \"2026-11-03T20:00:00.000Z\",\n \"bookingEndUtc\": \"2026-11-03T20:30:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"VIRTUAL\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kx16ej8wfp0b4v3x1q7m2d5c\",\n \"offeringId\": \"off_01kx16ej9af1c3s8t6y2w4n7hb\"\n }\n ],\n \"locationId\": \"loc_01kx16ejc7fq4r6s9v2x5z8b1d\",\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 }\n ],\n \"slateId\": \"slate_01kx16ejsqffc9rbgdcc591w2p\",\n \"slotIds\": [\n \"slot_01kx16ejsrfs7tf3edy19wdsf8\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/orders/{orderId}/package-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 \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"idempotencyKey\": \"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b\",\n \"atomicity\": \"all_or_nothing\",\n \"sessions\": [\n {\n \"supplierId\": \"sup_01kx16ejb3fz2g5h8k1m4p7r9t\",\n \"bookingStartUtc\": \"2026-11-03T20:00:00.000Z\",\n \"bookingEndUtc\": \"2026-11-03T20:30:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"VIRTUAL\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kx16ej8wfp0b4v3x1q7m2d5c\",\n \"offeringId\": \"off_01kx16ej9af1c3s8t6y2w4n7hb\"\n }\n ],\n \"locationId\": \"loc_01kx16ejc7fq4r6s9v2x5z8b1d\",\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 }\n ],\n \"slateId\": \"slate_01kx16ejsqffc9rbgdcc591w2p\",\n \"slotIds\": [\n \"slot_01kx16ejsrfs7tf3edy19wdsf8\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"orderId": "<string>",
"orderItemId": "<string>",
"packageOrderItemId": "<string>",
"atomicity": "all_or_nothing",
"created": [
{
"sessionIndex": 1,
"bookingId": "<string>",
"allocationId": "<string>"
}
],
"failed": [
{
"sessionIndex": 1,
"reason": "<string>"
}
],
"quantityRemaining": 1
}{
"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 N package sessions atomically (or best-effort) from one PACKAGE order item
Books all sessions of a package against one PACKAGE order item. Provide exactly one source: slateId (book a whole slate — recommended; the server resolves times/supplier/location and fills the travel-zone location itself), slotIds (cherry-pick), or sessions (explicit). Booking does NOT require the order to be paid — credits exist from order creation — but a CANCELLED order books nothing (409 ORDER_CANCELLED), as package-slate refuses to plan from its credits. Note: this response is NOT wrapped in a envelope, and created[].sessionIndex is 0-based. Returns 409 with freshSuggestions if a chosen slot went stale — regenerated from the stale slate’s request but planned from THIS order item (its remaining sessions, offering and expiry), so they can be booked here; null when this item has nothing left to plan — or with code SLOT_HELD/SLOT_BOOKED naming the blocking claim if the requested time is taken. Every session must book the order item’s own service and offering (400 ORDER_ITEM_SERVICE_MISMATCH); asking for more sessions than remain is 400 ORDER_ITEM_QUANTITY_UNAVAILABLE (409 with the same code only when a concurrent booking used them first). A session starting after the credit’s expiresAt is 409 PACKAGE_EXPIRED (all_or_nothing refuses the whole call; best_effort reports it in failed[]); reusing an idempotencyKey with a different body is 409 IDEMPOTENCY_KEY_CONFLICT.
curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/orders/{orderId}/package-bookings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"orderItemId": "oi_01kx16ek2kf2fsc9x7b2n1dfc9",
"idempotencyKey": "a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"atomicity": "all_or_nothing",
"sessions": [
{
"supplierId": "sup_01kx16ejb3fz2g5h8k1m4p7r9t",
"bookingStartUtc": "2026-11-03T20:00:00.000Z",
"bookingEndUtc": "2026-11-03T20:30:00.000Z",
"bookingTz": "America/Toronto",
"locationType": "VIRTUAL",
"services": [
{
"serviceId": "srv_01kx16ej8wfp0b4v3x1q7m2d5c",
"offeringId": "off_01kx16ej9af1c3s8t6y2w4n7hb"
}
],
"locationId": "loc_01kx16ejc7fq4r6s9v2x5z8b1d",
"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"
}
}
],
"slateId": "slate_01kx16ejsqffc9rbgdcc591w2p",
"slotIds": [
"slot_01kx16ejsrfs7tf3edy19wdsf8"
]
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/orders/{orderId}/package-bookings"
payload = {
"orderItemId": "oi_01kx16ek2kf2fsc9x7b2n1dfc9",
"idempotencyKey": "a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"atomicity": "all_or_nothing",
"sessions": [
{
"supplierId": "sup_01kx16ejb3fz2g5h8k1m4p7r9t",
"bookingStartUtc": "2026-11-03T20:00:00.000Z",
"bookingEndUtc": "2026-11-03T20:30:00.000Z",
"bookingTz": "America/Toronto",
"locationType": "VIRTUAL",
"services": [
{
"serviceId": "srv_01kx16ej8wfp0b4v3x1q7m2d5c",
"offeringId": "off_01kx16ej9af1c3s8t6y2w4n7hb"
}
],
"locationId": "loc_01kx16ejc7fq4r6s9v2x5z8b1d",
"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"
}
}
],
"slateId": "slate_01kx16ejsqffc9rbgdcc591w2p",
"slotIds": ["slot_01kx16ejsrfs7tf3edy19wdsf8"]
}
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({
orderItemId: 'oi_01kx16ek2kf2fsc9x7b2n1dfc9',
idempotencyKey: 'a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b',
atomicity: 'all_or_nothing',
sessions: [
{
supplierId: 'sup_01kx16ejb3fz2g5h8k1m4p7r9t',
bookingStartUtc: '2026-11-03T20:00:00.000Z',
bookingEndUtc: '2026-11-03T20:30:00.000Z',
bookingTz: 'America/Toronto',
locationType: 'VIRTUAL',
services: [
{
serviceId: 'srv_01kx16ej8wfp0b4v3x1q7m2d5c',
offeringId: 'off_01kx16ej9af1c3s8t6y2w4n7hb'
}
],
locationId: 'loc_01kx16ejc7fq4r6s9v2x5z8b1d',
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'
}
}
],
slateId: 'slate_01kx16ejsqffc9rbgdcc591w2p',
slotIds: ['slot_01kx16ejsrfs7tf3edy19wdsf8']
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/orders/{orderId}/package-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}/orders/{orderId}/package-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([
'orderItemId' => 'oi_01kx16ek2kf2fsc9x7b2n1dfc9',
'idempotencyKey' => 'a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b',
'atomicity' => 'all_or_nothing',
'sessions' => [
[
'supplierId' => 'sup_01kx16ejb3fz2g5h8k1m4p7r9t',
'bookingStartUtc' => '2026-11-03T20:00:00.000Z',
'bookingEndUtc' => '2026-11-03T20:30:00.000Z',
'bookingTz' => 'America/Toronto',
'locationType' => 'VIRTUAL',
'services' => [
[
'serviceId' => 'srv_01kx16ej8wfp0b4v3x1q7m2d5c',
'offeringId' => 'off_01kx16ej9af1c3s8t6y2w4n7hb'
]
],
'locationId' => 'loc_01kx16ejc7fq4r6s9v2x5z8b1d',
'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'
]
]
],
'slateId' => 'slate_01kx16ejsqffc9rbgdcc591w2p',
'slotIds' => [
'slot_01kx16ejsrfs7tf3edy19wdsf8'
]
]),
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}/orders/{orderId}/package-bookings"
payload := strings.NewReader("{\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"idempotencyKey\": \"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b\",\n \"atomicity\": \"all_or_nothing\",\n \"sessions\": [\n {\n \"supplierId\": \"sup_01kx16ejb3fz2g5h8k1m4p7r9t\",\n \"bookingStartUtc\": \"2026-11-03T20:00:00.000Z\",\n \"bookingEndUtc\": \"2026-11-03T20:30:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"VIRTUAL\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kx16ej8wfp0b4v3x1q7m2d5c\",\n \"offeringId\": \"off_01kx16ej9af1c3s8t6y2w4n7hb\"\n }\n ],\n \"locationId\": \"loc_01kx16ejc7fq4r6s9v2x5z8b1d\",\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 }\n ],\n \"slateId\": \"slate_01kx16ejsqffc9rbgdcc591w2p\",\n \"slotIds\": [\n \"slot_01kx16ejsrfs7tf3edy19wdsf8\"\n ]\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}/orders/{orderId}/package-bookings")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"idempotencyKey\": \"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b\",\n \"atomicity\": \"all_or_nothing\",\n \"sessions\": [\n {\n \"supplierId\": \"sup_01kx16ejb3fz2g5h8k1m4p7r9t\",\n \"bookingStartUtc\": \"2026-11-03T20:00:00.000Z\",\n \"bookingEndUtc\": \"2026-11-03T20:30:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"VIRTUAL\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kx16ej8wfp0b4v3x1q7m2d5c\",\n \"offeringId\": \"off_01kx16ej9af1c3s8t6y2w4n7hb\"\n }\n ],\n \"locationId\": \"loc_01kx16ejc7fq4r6s9v2x5z8b1d\",\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 }\n ],\n \"slateId\": \"slate_01kx16ejsqffc9rbgdcc591w2p\",\n \"slotIds\": [\n \"slot_01kx16ejsrfs7tf3edy19wdsf8\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/orders/{orderId}/package-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 \"orderItemId\": \"oi_01kx16ek2kf2fsc9x7b2n1dfc9\",\n \"idempotencyKey\": \"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b\",\n \"atomicity\": \"all_or_nothing\",\n \"sessions\": [\n {\n \"supplierId\": \"sup_01kx16ejb3fz2g5h8k1m4p7r9t\",\n \"bookingStartUtc\": \"2026-11-03T20:00:00.000Z\",\n \"bookingEndUtc\": \"2026-11-03T20:30:00.000Z\",\n \"bookingTz\": \"America/Toronto\",\n \"locationType\": \"VIRTUAL\",\n \"services\": [\n {\n \"serviceId\": \"srv_01kx16ej8wfp0b4v3x1q7m2d5c\",\n \"offeringId\": \"off_01kx16ej9af1c3s8t6y2w4n7hb\"\n }\n ],\n \"locationId\": \"loc_01kx16ejc7fq4r6s9v2x5z8b1d\",\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 }\n ],\n \"slateId\": \"slate_01kx16ejsqffc9rbgdcc591w2p\",\n \"slotIds\": [\n \"slot_01kx16ejsrfs7tf3edy19wdsf8\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"orderId": "<string>",
"orderItemId": "<string>",
"packageOrderItemId": "<string>",
"atomicity": "all_or_nothing",
"created": [
{
"sessionIndex": 1,
"bookingId": "<string>",
"allocationId": "<string>"
}
],
"failed": [
{
"sessionIndex": 1,
"reason": "<string>"
}
],
"quantityRemaining": 1
}{
"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
Order item + sessions + atomicity
Idempotency key that makes retry attempts safe; reusing it returns the original result. A slateId/slotIds retry must arrive within the slate's resolvable window; after that it is refused like a stale slate.
1"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b"
Response
Package bookings created