Customer
The Customer object
idstringoptionalPublic customer identifier.
address_idstringoptionalPublic ID of the customer's default place.
internal_idstringoptionalInternal customer reference.
namestringoptionalCustomer name.
titlestringoptionalCustomer title.
photo_urlstringoptionalCustomer photo URL.
emailstringoptionalCustomer email address.
phonestringoptionalCustomer phone number.
addressstringoptionalDefault address text.
addressesarray of objectsoptionalSaved customer places.
tokenstringoptionalAuth token returned by authentication and customer creation endpoints.
ordersintegeroptionalCount of customer orders for the current storefront or network context.
metaobjectoptionalArbitrary metadata stored with the customer.
slugstringoptionalURL-friendly customer slug.
created_attimestampoptionalTime the customer was created.
updated_attimestampoptionalTime the customer was last updated.
{
"id": "customer_5M8xQp2",
"address_id": "place_9eL2wA1",
"internal_id": null,
"name": "Alex Rivera",
"title": null,
"photo_url": null,
"email": "alex@example.com",
"phone": "+15555550100",
"address": "123 Market Street",
"addresses": [],
"token": "plain-text-token",
"orders": 4,
"meta": {},
"slug": "alex-rivera",
"created_at": "2026-05-07T09:30:00Z",
"updated_at": "2026-05-07T09:30:00Z"
}/v1/customers/loginAuthenticate a Customer ❗
Authenticates a storefront customer with an email or phone identity and password. The response includes the customer profile and an auth token.
identitystringrequiredCustomer email address or phone number.
passwordstringrequiredCustomer password.
namestringoptionalCustomer name used when a contact record must be created for the storefront.
phonestringoptionalCustomer phone used when a contact record must be created for the storefront.
emailstringoptionalCustomer email used when a contact record must be created for the storefront.
/v1/customers/logincurl -X POST https://api.fleetbase.io/v1/customers/login \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"identity": "{{customer_identity}}",
"password": "{{customer_password}}"
}'/v1/customers/login-with-smsAuthenticate a Customer via SMS
Starts SMS authentication for an existing storefront customer. A verification code is sent by SMS; if the text could not be sent (the store has no SMS provider configured, or the SMS guard refused it) and the customer has an email address on file, it is emailed instead. Exchange the code at Verify a SMS code (customers/verify-code) for an auth token. The code expires after ten minutes and can be used once.
phone is in E.164 format, with or without the leading + (no spaces or dashes). Response: { "status": "OK", "method": "sms" }, or "method": "email" when the code was emailed. Errors (400): no customer with this phone, or the code could not be sent. With no email to fall back to, the guard's refusal is returned as 429 or 423.
Endpoints that send a text are limited to five requests a minute per storefront key and client address, and every message passes the platform's SMS guard. A refused send returns 429 with a Retry-After header (a cooldown on that number, or the store's message budget) or 423 (text messages are paused for the store).
phonestringrequiredCustomer phone number to receive the storefront login verification code.
/v1/customers/login-with-smscurl -X POST https://api.fleetbase.io/v1/customers/login-with-sms \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"phone": "{{customer_phone}}"
}'{
"status": "OK",
"method": "sms"
}/v1/customers/verify-codeVerify a SMS code
Verifies a code sent by SMS or email (sign-in or account creation). The response includes the customer profile and auth token when verification succeeds.
A code verifies once. Each wrong guess counts against the newest code issued for the identity; after five the code locks and a new one must be requested. After ten wrong codes for the same identity within fifteen minutes, from any address, the endpoint returns 429 until the window passes.
App store review accounts: when the server sets STOREFRONT_BYPASS_VERIFICATION_CODE and lists the identity in STOREFRONT_REVIEW_ACCOUNTS, that fixed code is accepted for those identities only, without sending a message.
Errors (400): no customer for the identity, or an invalid code.
identitystringrequiredCustomer email address or phone number being verified. A phone number gets a leading + when it's missing.
codestringrequiredVerification code submitted by the customer.
forstringoptionalDefault: storefront_loginVerification purpose. Use storefront_create_customer to continue customer creation.
namestringoptionalCustomer name used when a contact record must be created.
phonestringoptionalCustomer phone used when a contact record must be created.
emailstringoptionalCustomer email used when a contact record must be created.
/v1/customers/verify-codecurl -X POST https://api.fleetbase.io/v1/customers/verify-code \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"identity": "{{customer_identity}}",
"code": "{{verification_code}}"
}'/v1/customersRetrieve a Customer
Retrieves a storefront customer by ID. Only the customer signed in with the Customer-Token header can be retrieved; a storefront key alone is refused with 401.
/v1/customerscurl https://api.fleetbase.io/v1/customers \
-H "Authorization: Bearer flb_live_…" \
-H "Customer-Token: {{customer_token}}"/v1/customers/request-creation-codeSetups a verification request to create a new storefront custome
Sends a verification code to start a storefront customer sign-up. The code is required when creating the customer account; it expires after ten minutes and can be used once.
Returns 422 when an account already exists for the identity (send the customer to sign in instead), or when the phone number is invalid or cannot receive a text message. Asking again for the same identity within sixty seconds returns { "status": "ok" } without sending a second message, so a retry button is safe to offer.
Endpoints that send a text are limited to five requests a minute per storefront key and client address, and every message passes the platform's SMS guard. A refused send returns 429 with a Retry-After header (a cooldown on that number, or the store's message budget) or 423 (text messages are paused for the store).
modeenumrequiredVerification delivery mode. One of email, sms.
identitystringrequiredEmail address or phone number receiving the customer creation code. Phone numbers must be valid mobile numbers in international format; an identity that already has an account is refused with 422.
/v1/customers/request-creation-codecurl -X POST https://api.fleetbase.io/v1/customers/request-creation-code \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"mode": "email",
"identity": "{{creation_code_identity}}"
}'{
"status": "ok"
}/v1/customers/register-deviceRegister customer device
Registers a push notification device token for the authenticated storefront customer. Call it whenever the app receives a new token or a different customer signs in: a token identifies one app install, so it always moves to the customer who registered it most recently. platform must be ios or android (case insensitive); the token is an APNs device token on iOS and an FCM registration token on Android. Returns { "status": "OK", "device": "<device public id>" }, or 400 for a missing token or unsupported platform.
tokenstringrequiredPush notification device token: the APNs device token on iOS, the FCM registration token on Android.
platformenumrequiredDevice platform, case insensitive. os is also accepted as an alias. One of ios, android.
osstringoptionalDevice platform alias used when platform is not provided.
environmentenumoptionalOptional APNs environment that issued an iOS token (sandbox for development builds). When omitted the server tries production and falls back to sandbox. Stored only on Fleetbase versions that record device push metadata. One of production, sandbox.
/v1/customers/register-devicecurl -X POST https://api.fleetbase.io/v1/customers/register-device \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"token": "{{device_token}}",
"platform": "ios"
}'/v1/customers/unregister-deviceUnregister customer device
Removes a push notification device token from the authenticated customer, typically on sign out, so the device stops receiving that customer's notifications. Returns { "status": "OK", "deleted": n }; unregistering a token the customer does not have deletes nothing and is not an error.
tokenstringrequiredThe push notification device token to remove.
/v1/customers/unregister-devicecurl -X POST https://api.fleetbase.io/v1/customers/unregister-device \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"token": "{{device_token}}"
}'/v1/customers/socket-tokenCreate Customer Socket Token
Creates a short-lived token for the authenticated customer to authenticate the realtime (SocketCluster) connection. With it the customer may subscribe to their storefront's channel, their own checkouts (checkout.{id}) and the chats they take part in (chat.{id}, see Order Chat). Fetch a new one before expires_at.
Response: { "token": "<JWT>", "expires_in": 900, "expires_at": "2026-10-12T10:15:00+00:00" }. expires_in is in seconds (900 by default, at most 3600).
Errors: 404 when the server doesn't have socket authentication enabled (clients then connect anonymously), 401 without a valid Customer-Token or for a customer of another company.
/v1/customers/socket-tokencurl -X POST https://api.fleetbase.io/v1/customers/socket-token \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{}'/v1/customers/login-with-appleAuthenticate a Customer with Apple
Authenticates a storefront customer with Apple Sign-In. Fleetbase verifies the Apple identity token, creates or updates the user, and returns the storefront customer with an auth token.
identityTokenstringrequiredApple identity token to verify.
authorizationCodestringrequiredApple authorization code issued during sign-in.
emailstringoptionalCustomer email address provided by Apple.
phonestringoptionalCustomer phone number.
namestringoptionalCustomer display name.
appleUserIdstringoptionalStable Apple user identifier.
/v1/customers/login-with-applecurl -X POST https://api.fleetbase.io/v1/customers/login-with-apple \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"identityToken": "{{apple_identity_token}}",
"authorizationCode": "{{apple_authorization_code}}",
"email": "{{customer_email}}",
"phone": "{{customer_phone}}",
"name": "{{customer_name}}",
"appleUserId": "{{apple_user_id}}"
}'/v1/customers/login-with-facebookAuthenticate a Customer with Facebook
Authenticates a storefront customer with Facebook account data. Fleetbase creates or updates the matching user and returns the storefront customer with an auth token.
emailstringoptionalCustomer email address from Facebook.
namestringoptionalCustomer display name from Facebook.
facebookUserIdstringrequiredStable Facebook user identifier.
/v1/customers/login-with-facebookcurl -X POST https://api.fleetbase.io/v1/customers/login-with-facebook \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"email": "{{customer_email}}",
"name": "{{customer_name}}",
"facebookUserId": "{{facebook_user_id}}"
}'/v1/customers/login-with-googleAuthenticate a Customer with Google
Authenticates a storefront customer with Google Sign-In. Fleetbase verifies the Google ID token, creates or updates the user, and returns the storefront customer with an auth token.
idTokenstringrequiredGoogle ID token to verify.
clientIdstringrequiredGoogle OAuth client ID expected for the ID token.
/v1/customers/login-with-googlecurl -X POST https://api.fleetbase.io/v1/customers/login-with-google \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"idToken": "{{google_id_token}}",
"clientId": "{{google_client_id}}"
}'/v1/customersQuery customers
Returns the customer signed in with the Customer-Token header. A storefront key alone is refused with 401: it does not list the company's customers.
/v1/customerscurl https://api.fleetbase.io/v1/customers \
-H "Authorization: Bearer flb_live_…" \
-H "Customer-Token: {{customer_token}}"/v1/customersCreate a Customer
Creates a storefront customer after verifying the supplied creation code. The response includes the customer profile and an auth token.
codestringrequiredVerification code from customers/request-creation-code.
namestringrequiredCustomer's name.
identitystringoptionalEmail address or phone number the code was sent to. Defaults to email, then phone; at least one of the three is required.
emailstringoptionalCustomer email address. Must be unique among the company's customers.
phonestringoptionalCustomer phone number. Must be unique among the company's customers.
photostringoptionalProfile photo, as a file public ID or a base64 image.
/v1/customerscurl -X POST https://api.fleetbase.io/v1/customers \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"name": "{{customer_name}}",
"email": "{{new_customer_identity}}",
"code": "{{verification_code}}"
}'/v1/customers/stripe-ephemeral-keyGet Stripe Ephemeral Key
Creates a Stripe ephemeral key for the authenticated storefront customer. Fleetbase creates the Stripe customer first when the customer does not already have one.
/v1/customers/stripe-ephemeral-keycurl -X POST https://api.fleetbase.io/v1/customers/stripe-ephemeral-key \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{}'/v1/customers/stripe-setup-intentGet Stripe Setup Intent
Creates a Stripe SetupIntent for the authenticated storefront customer. Use the returned client secret to collect or update a saved payment method.
/v1/customers/stripe-setup-intentcurl -X POST https://api.fleetbase.io/v1/customers/stripe-setup-intent \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{}'/v1/customers/account-closureStart Account Closure
Starts storefront account closure for the authenticated customer. Fleetbase sends a verification code to the linked phone number, or to the linked email address when the text could not be sent (no SMS provider configured, or the SMS guard refused it). The code expires after ten minutes and can be used once.
Endpoints that send a text are limited to five requests a minute per storefront key and client address, and every message passes the platform's SMS guard. A refused send returns 429 with a Retry-After header (a cooldown on that number, or the store's message budget) or 423 (text messages are paused for the store).
/v1/customers/account-closurecurl -X POST https://api.fleetbase.io/v1/customers/account-closure \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{}'/v1/customersUpdate a Customer
Updates the authenticated storefront customer's profile. The Customer-Token identity is authoritative and must belong to the customer addressed by customer_id; missing or mismatched customer credentials return 403 Not authorized to update customer. The response returns the customer with the new values applied.
namestringoptionalCustomer's name.
titlestringoptionalCustomer's title.
emailstringoptionalCustomer email address.
phonestringoptionalCustomer phone number. To change a verified number, use request-phone-verification and verify-phone-number.
placestringoptionalPublic ID of one of the customer's places to make it their default address.
photostringoptionalProfile photo, as a file public ID or a base64 image; REMOVE deletes it.
metaobjectoptionalCustom metadata stored on the customer.
/v1/customerscurl -X PUT https://api.fleetbase.io/v1/customers \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"name": "Jane Doe"
}'/v1/customers/confirm-account-closureConfirm Account Closure
Confirms storefront account closure using the verification code sent to the customer. Fleetbase deletes the customer contact and, for customer users, the linked user account.
The code verifies once and locks after five wrong guesses; after ten wrong codes for the customer within fifteen minutes the endpoint returns 429.
codestringrequiredAccount closure verification code sent to the customer.
/v1/customers/confirm-account-closurecurl -X POST https://api.fleetbase.io/v1/customers/confirm-account-closure \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"code": "{{verification_code}}"
}'/v1/customers/request-phone-verificationRequest Phone Verification
Sends a verification code to a new phone number for the authenticated storefront customer. Returns 422 when the number is invalid, cannot receive a text message, or is already assigned to another account. Response: { "status": "ok" }. The code expires after ten minutes and can be used once. For an app store review account (listed in STOREFRONT_REVIEW_ACCOUNTS, with STOREFRONT_BYPASS_VERIFICATION_CODE set), no SMS is sent and the response is { "status": "ok", "method": "bypass" }.
Endpoints that send a text are limited to five requests a minute per storefront key and client address, and every message passes the platform's SMS guard. A refused send returns 429 with a Retry-After header (a cooldown on that number, or the store's message budget) or 423 (text messages are paused for the store).
phonestringrequiredPhone number to verify for the authenticated customer, in international format. Must be a valid mobile number that is not assigned to another account.
/v1/customers/request-phone-verificationcurl -X POST https://api.fleetbase.io/v1/customers/request-phone-verification \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"phone": "{{customer_phone}}"
}'/v1/customers/verify-phone-numberVerify Phone Number
Verifies the customer's pending phone number with the code sent by the phone verification request. The code verifies once and locks after five wrong guesses; after ten wrong codes for the customer within fifteen minutes the endpoint returns 429.
codestringrequiredVerification code sent to the pending phone number.
phonestringoptionalThe phone number being verified. Needed for app store review accounts, whose fixed code sets this number directly.
/v1/customers/verify-phone-numbercurl -X POST https://api.fleetbase.io/v1/customers/verify-phone-number \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"phone": "{{customer_phone}}",
"code": "{{verification_code}}"
}'/v1/customers/placesList a customer saved places
Returns saved places for the authenticated storefront customer. Use these places for delivery addresses and checkout defaults.
/v1/customers/placescurl https://api.fleetbase.io/v1/customers/places \
-H "Authorization: Bearer flb_live_…" \
-H "Customer-Token: {{customer_token}}"/v1/contactsUpdate Contact Customer Alias
Updates the authenticated storefront customer through the legacy contact alias route. The request is handled by the same customer update controller as /customers/{id} and carries the same authorization contract: the Customer-Token must belong to the customer addressed by customer_id, and missing or mismatched customer credentials return 403 Not authorized to update customer.
namestringoptionalCustomer's name.
titlestringoptionalCustomer's title.
emailstringoptionalCustomer email address.
phonestringoptionalCustomer phone number. To change a verified number, use request-phone-verification and verify-phone-number.
placestringoptionalPublic ID of one of the customer's places to make it their default address.
photostringoptionalProfile photo, as a file public ID or a base64 image; REMOVE deletes it.
metaobjectoptionalCustom metadata stored on the customer.
/v1/contactscurl -X PUT https://api.fleetbase.io/v1/contacts \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"name": "{{customer_name}}",
"email": "{{customer_email}}",
"phone": "{{customer_phone}}"
}'/v1/customers/ordersList a customer orders
Returns orders that belong to the authenticated storefront customer. Use pagination and filters to browse the customer order history.
For a network key, a checkout across several stores appears once, as its master order (meta.is_master_order, meta.related_orders); the stores' own orders are left out. Use GET orders/{id}/stores for the per-store breakdown. Order meta can include checkout_id, discount, promotions, payment_status, is_booking, booking_at and booking_has_items.
/v1/customers/orderscurl https://api.fleetbase.io/v1/customers/orders \
-H "Authorization: Bearer flb_live_…" \
-H "Customer-Token: {{customer_token}}"