curl --request DELETE \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId} \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <api-key>'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}"
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}', 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/{addressId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
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>"
}
}{
"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"
}Remove one of the caller's addresses
Deletes one saved address and returns the client profile as it now stands. The removal is permanent — there is no soft delete — but bookings already placed against that address are unaffected, since they captured it at the time.
Deleting the default is allowed and quietly reassigns it: the oldest remaining address is promoted, and defaultAddressId is dropped entirely when nothing is left. So a client can silently end up defaulting to an address you did not choose, and a client with no addresses left has no pricing region to fall back on — read defaultAddressId off the returned profile rather than assuming it survived. An unknown addressId is a 404.
curl --request DELETE \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId} \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <api-key>'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}"
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}', 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/{addressId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me/addresses/{addressId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
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>"
}
}{
"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.