curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "Emma",
"lastName": "Bishop",
"phone": "+14165550134"
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me"
payload = {
"firstName": "Emma",
"lastName": "Bishop",
"phone": "+14165550134"
}
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({firstName: 'Emma', lastName: 'Bishop', phone: '+14165550134'})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me', 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",
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([
'firstName' => 'Emma',
'lastName' => 'Bishop',
'phone' => '+14165550134'
]),
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"
payload := strings.NewReader("{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\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")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me")
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 \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\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>"
}
}{
"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"
}{
"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"
}Onboard the authenticated client to a project
Idempotently registers the signed-in end user as a CLIENT of the project: ensures a ProjectUsers membership, creates Stripe’s own Customer object on the project’s connected account (when Stripe is configured, stored as stripeCustomerId), and writes the ClientProfile. Requires both an API key (x-api-key) and a client user JWT (Authorization: Bearer). Returns 201 on first onboarding, 200 if the client was already onboarded.
The body is optional; a call with no body (or {}) onboards without touching the name or phone. Send firstName, lastName and/or phone to record what your checkout collected: each provided field ALWAYS overwrites the value already stored, on every path (first onboarding, claiming an existing profile by email, or already onboarded), and is also copied to the client’s Stripe customer. A blank or null field counts as not provided and never clears a stored value; use PATCH /clients/me to clear the phone.
Without names, the client is recorded under the names from their sign-in. A Google sign-in supplies real names, but an email/password sign-up has only the email address, so the client would appear under the part of it before the @. Names are trimmed and must be at most 80 characters. They are the client’s record in this project only; they do not rename the person’s MarketBox account. The phone is validated and stored in E.164 form (+14165550134). Send it as E.164, or as a national North American (NANP) number such as (416) 555-0134; numbers outside North America must start with + and the country code, or they are rejected. An invalid number is a 400 and nothing is written.
curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "Emma",
"lastName": "Bishop",
"phone": "+14165550134"
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me"
payload = {
"firstName": "Emma",
"lastName": "Bishop",
"phone": "+14165550134"
}
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({firstName: 'Emma', lastName: 'Bishop', phone: '+14165550134'})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me', 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",
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([
'firstName' => 'Emma',
'lastName' => 'Bishop',
'phone' => '+14165550134'
]),
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"
payload := strings.NewReader("{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\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")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me")
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 \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\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>"
}
}{
"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"
}{
"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.