curl --request PATCH \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"supplierId": "<string>",
"bookingStartUtc": "2023-11-07T05:31:56Z",
"bookingEndUtc": "2023-11-07T05:31:56Z",
"bookingTz": "<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
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId}"
payload = {
"supplierId": "<string>",
"bookingStartUtc": "2023-11-07T05:31:56Z",
"bookingEndUtc": "2023-11-07T05:31:56Z",
"bookingTz": "<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
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
supplierId: '<string>',
bookingStartUtc: '2023-11-07T05:31:56Z',
bookingEndUtc: '2023-11-07T05:31:56Z',
bookingTz: '<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
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId}', 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/{bookingId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'supplierId' => '<string>',
'bookingStartUtc' => '2023-11-07T05:31:56Z',
'bookingEndUtc' => '2023-11-07T05:31:56Z',
'bookingTz' => '<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
]),
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/{bookingId}"
payload := strings.NewReader("{\n \"supplierId\": \"<string>\",\n \"bookingStartUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingEndUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingTz\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\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}")
req, _ := http.NewRequest("PATCH", 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.patch("https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"supplierId\": \"<string>\",\n \"bookingStartUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingEndUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingTz\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"supplierId\": \"<string>\",\n \"bookingStartUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingEndUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingTz\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\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}"
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"
}Reschedule or update a booking
Moves a booking in time, or edits its details. Send UTC times (bookingStartUtc, bookingEndUtc) with bookingTz; the four local-time fields are computed from those and are deliberately NOT accepted here — passing local times directly is how a booking ends up disagreeing with itself across timezones. Rescheduling re-checks supplier availability, so a slot taken in the meantime is rejected rather than double-booked. Returns 409 if the booking changed underneath you. Only a SCHEDULED or STARTED booking can have its time or supplier changed: moving one that has been reported on, settled or cancelled is 422 BOOKING_NOT_AMENDABLE (its other fields can still be edited).
curl --request PATCH \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"supplierId": "<string>",
"bookingStartUtc": "2023-11-07T05:31:56Z",
"bookingEndUtc": "2023-11-07T05:31:56Z",
"bookingTz": "<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
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId}"
payload = {
"supplierId": "<string>",
"bookingStartUtc": "2023-11-07T05:31:56Z",
"bookingEndUtc": "2023-11-07T05:31:56Z",
"bookingTz": "<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
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
supplierId: '<string>',
bookingStartUtc: '2023-11-07T05:31:56Z',
bookingEndUtc: '2023-11-07T05:31:56Z',
bookingTz: '<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
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId}', 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/{bookingId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'supplierId' => '<string>',
'bookingStartUtc' => '2023-11-07T05:31:56Z',
'bookingEndUtc' => '2023-11-07T05:31:56Z',
'bookingTz' => '<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
]),
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/{bookingId}"
payload := strings.NewReader("{\n \"supplierId\": \"<string>\",\n \"bookingStartUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingEndUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingTz\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\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}")
req, _ := http.NewRequest("PATCH", 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.patch("https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"supplierId\": \"<string>\",\n \"bookingStartUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingEndUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingTz\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/bookings/{bookingId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"supplierId\": \"<string>\",\n \"bookingStartUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingEndUtc\": \"2023-11-07T05:31:56Z\",\n \"bookingTz\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\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}"
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 patch