curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"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"
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses"
payload = {
"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"
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"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>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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'
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses', 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}/clients/me/addresses",
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([
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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}/clients/me/addresses"
payload := strings.NewReader("{\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}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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}/clients/me/addresses")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses")
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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\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}"
response = http.request(request)
puts response.read_body{
"data": {
"entityType": "CLIENT_PROFILE",
"clientId": "<string>",
"projectId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"firstNameNormalized": "<string>",
"lastNameNormalized": "<string>",
"fullNameNormalized": "<string>",
"email": "<string>",
"emailNormalized": "<string>",
"invitationStatus": "NONE",
"stripeCustomerId": "<string>",
"stripeAccountId": "<string>",
"active": true,
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"addresses": [
{
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"id": "<string>",
"unitNumber": "4B",
"source": "BOOKING",
"latitude": 123,
"longitude": 123
}
],
"phone": "<string>",
"defaultAddressId": "<string>",
"externalId": "<string>",
"externalData": {},
"userId": "<string>",
"notes": "<string>",
"lifetimeSpend": 123,
"orderCount": 123,
"lastPurchaseAt": "<string>",
"lastPaymentMethodId": "<string>",
"lastPayment": {
"type": "CARD",
"brand": "<string>",
"last4": "<string>",
"paidAt": "<string>",
"expMonth": 6,
"expYear": 123
},
"defaultLocale": "<string>"
},
"address": {
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"id": "<string>",
"unitNumber": "4B",
"source": "BOOKING"
}
}{
"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"
}Add a service address to the caller's client profile
Saves a service address for the signed-in client. Requires both the API key and the client user JWT, and the caller must already be onboarded — POST /clients/me first, or this is a 404.
The address id is derived from the address content, so this is an upsert, not an append: posting the same address twice returns the same id and leaves one record, while changing so much as a street number creates a second. The first address a client saves silently becomes their default; later ones do not displace it, so use the default route to move it rather than expecting the newest to win.
This matters beyond delivery: the default address is the last-resort source of the pricing region for an order that pins no reservation, location or explicit address. A client with no saved address resolves to no region at all and is priced at the offering’s DEFAULT rule, in the DEFAULT rule’s currency — which is how a client abroad ends up quoted in the wrong currency and rejected. Save the address before the first order.
curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"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"
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses"
payload = {
"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"
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"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>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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'
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses', 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}/clients/me/addresses",
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([
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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}/clients/me/addresses"
payload := strings.NewReader("{\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}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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}/clients/me/addresses")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses")
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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\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}"
response = http.request(request)
puts response.read_body{
"data": {
"entityType": "CLIENT_PROFILE",
"clientId": "<string>",
"projectId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"firstNameNormalized": "<string>",
"lastNameNormalized": "<string>",
"fullNameNormalized": "<string>",
"email": "<string>",
"emailNormalized": "<string>",
"invitationStatus": "NONE",
"stripeCustomerId": "<string>",
"stripeAccountId": "<string>",
"active": true,
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"addresses": [
{
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"id": "<string>",
"unitNumber": "4B",
"source": "BOOKING",
"latitude": 123,
"longitude": 123
}
],
"phone": "<string>",
"defaultAddressId": "<string>",
"externalId": "<string>",
"externalData": {},
"userId": "<string>",
"notes": "<string>",
"lifetimeSpend": 123,
"orderCount": 123,
"lastPurchaseAt": "<string>",
"lastPaymentMethodId": "<string>",
"lastPayment": {
"type": "CARD",
"brand": "<string>",
"last4": "<string>",
"paidAt": "<string>",
"expMonth": 6,
"expYear": 123
},
"defaultLocale": "<string>"
},
"address": {
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"id": "<string>",
"unitNumber": "4B",
"source": "BOOKING"
}
}{
"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.