FleetbaseFleetbase

Customer

Customers represent storefront shoppers and their authentication context. Use customer endpoints to create accounts, authenticate with SMS or social providers, manage devices, addresses, orders, and account closure.

The Customer object

A storefront customer is a FleetOps contact exposed through the Storefront API with customer-specific identifiers, saved addresses, and an optional auth token.
Attributes
idstringoptional

Public customer identifier.

address_idstringoptional

Public ID of the customer's default place.

internal_idstringoptional

Internal customer reference.

namestringoptional

Customer name.

titlestringoptional

Customer title.

photo_urlstringoptional

Customer photo URL.

emailstringoptional

Customer email address.

phonestringoptional

Customer phone number.

addressstringoptional

Default address text.

addressesarray of objectsoptional

Saved customer places.

tokenstringoptional

Auth token returned by authentication and customer creation endpoints.

ordersintegeroptional

Count of customer orders for the current storefront or network context.

metaobjectoptional

Arbitrary metadata stored with the customer.

slugstringoptional

URL-friendly customer slug.

created_attimestampoptional

Time the customer was created.

updated_attimestampoptional

Time the customer was last updated.

The Customer object
{
  "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"
}
POST/v1/customers/login

Authenticate a Customer ❗

Authenticates a storefront customer with an email or phone identity and password. The response includes the customer profile and an auth token.

Body parameters
identitystringrequired

Customer email address or phone number.

passwordstringrequired

Customer password.

namestringoptional

Customer name used when a contact record must be created for the storefront.

phonestringoptional

Customer phone used when a contact record must be created for the storefront.

emailstringoptional

Customer email used when a contact record must be created for the storefront.

POST/v1/customers/login
curl -X POST https://api.fleetbase.io/v1/customers/login \
  -H "Authorization: Bearer flb_live_…"
POST/v1/customers/login-with-sms

Authenticate a Customer via SMS

Starts SMS authentication for an existing storefront customer. The customer receives a verification code that can be exchanged for an auth token.

Body parameters
phonestringrequired

Customer phone number to receive the storefront login verification code.

POST/v1/customers/login-with-sms
curl -X POST https://api.fleetbase.io/v1/customers/login-with-sms \
  -H "Authorization: Bearer flb_live_…"
POST/v1/customers/verify-code

Verify a SMS code

Verifies a storefront SMS or creation code. The response includes the customer profile and auth token when verification succeeds.

Body parameters
identitystringrequired

Customer email address or phone number being verified.

codestringrequired

Verification code submitted by the customer.

forstringoptionalDefault: storefront_login

Verification purpose. Use storefront_create_customer to continue customer creation.

namestringoptional

Customer name used when a contact record must be created.

phonestringoptional

Customer phone used when a contact record must be created.

emailstringoptional

Customer email used when a contact record must be created.

POST/v1/customers/verify-code
curl -X POST https://api.fleetbase.io/v1/customers/verify-code \
  -H "Authorization: Bearer flb_live_…"
GET/v1/customers

Retrieve a Customer

Retrieves a storefront customer by ID.

GET/v1/customers
curl https://api.fleetbase.io/v1/customers \
  -H "Authorization: Bearer flb_live_…"
POST/v1/customers/request-creation-code

Setups a verification request to create a new storefront custome

Sends a verification code for storefront customer creation. The code is required when creating the customer account.

Body parameters
modeenumrequired

Verification delivery mode. One of email, sms.

identitystringrequired

Email address or phone number receiving the customer creation code.

POST/v1/customers/request-creation-code
curl -X POST https://api.fleetbase.io/v1/customers/request-creation-code \
  -H "Authorization: Bearer flb_live_…"
POST/v1/customers/register-device

Register customer device

Registers a device token for the authenticated storefront customer. Use this to enable push notifications for the customer device.

Body parameters
tokenstringrequired

Push notification device token.

platformstringoptional

Device platform. os is also accepted as an alias.

osstringoptional

Device platform alias used when platform is not provided.

POST/v1/customers/register-device
curl -X POST https://api.fleetbase.io/v1/customers/register-device \
  -H "Authorization: Bearer flb_live_…" \
  -H "customer-token: "
POST/v1/customers/login-with-apple

Authenticate 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.

Body parameters
identityTokenstringrequired

Apple identity token to verify.

authorizationCodestringrequired

Apple authorization code issued during sign-in.

emailstringoptional

Customer email address provided by Apple.

phonestringoptional

Customer phone number.

namestringoptional

Customer display name.

appleUserIdstringoptional

Stable Apple user identifier.

POST/v1/customers/login-with-apple
curl -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}}"
}'
POST/v1/customers/login-with-facebook

Authenticate 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.

Body parameters
emailstringoptional

Customer email address from Facebook.

namestringoptional

Customer display name from Facebook.

facebookUserIdstringrequired

Stable Facebook user identifier.

POST/v1/customers/login-with-facebook
curl -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}}"
}'
POST/v1/customers/login-with-google

Authenticate 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.

Body parameters
idTokenstringrequired

Google ID token to verify.

clientIdstringrequired

Google OAuth client ID expected for the ID token.

POST/v1/customers/login-with-google
curl -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}}"
}'
GET/v1/customers

Query customers

Returns storefront customers for the current company. Use query and pagination parameters to find matching customer records.

GET/v1/customers
curl https://api.fleetbase.io/v1/customers \
  -H "Authorization: Bearer flb_live_…"
POST/v1/customers

Create a Customer

Creates a storefront customer after verifying the supplied creation code. The response includes the customer profile and an auth token.

Body parameters
namestringrequired

Display name for the resource.

emailstringoptional

Email address for the person or customer.

phonestringoptional

Phone number for the person or customer.

identitystringrequired

Email address or phone number used for authentication.

passwordstringoptional

Password used to authenticate the customer.

codestringrequired

Verification or status code.

POST/v1/customers
curl -X POST https://api.fleetbase.io/v1/customers \
  -H "Authorization: Bearer flb_live_…"
POST/v1/customers/stripe-ephemeral-key

Get 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.

POST/v1/customers/stripe-ephemeral-key
curl -X POST https://api.fleetbase.io/v1/customers/stripe-ephemeral-key \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/v1/customers/stripe-setup-intent

Get 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.

POST/v1/customers/stripe-setup-intent
curl -X POST https://api.fleetbase.io/v1/customers/stripe-setup-intent \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/v1/customers/account-closure

Start Account Closure

Starts storefront account closure for the authenticated customer. Fleetbase sends a verification code to the linked phone number or email address.

POST/v1/customers/account-closure
curl -X POST https://api.fleetbase.io/v1/customers/account-closure \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{}'
PUT/v1/customers/{id}

Update a Customer

Updates a storefront customer profile. The response returns the customer with the new values applied.

Body parameters
namestringoptional

Display name for the resource.

emailstringoptional

Email address for the person or customer.

phonestringoptional

Phone number for the person or customer.

identitystringoptional

Email address or phone number used for authentication.

passwordstringoptional

Password used to authenticate the customer.

codestringoptional

Verification or status code.

PUT/v1/customers/{id}
curl -X PUT https://api.fleetbase.io/v1/customers/{id} \
  -H "Authorization: Bearer flb_live_…"
POST/v1/customers/confirm-account-closure

Confirm 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.

Body parameters
codestringrequired

Account closure verification code sent to the customer.

POST/v1/customers/confirm-account-closure
curl -X POST https://api.fleetbase.io/v1/customers/confirm-account-closure \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "{{verification_code}}"
}'
POST/v1/customers/request-phone-verification

Request Phone Verification

Sends a verification code to a new phone number for the authenticated storefront customer. Fleetbase rejects numbers already assigned to another user.

Body parameters
phonestringrequired

Phone number to verify for the authenticated customer.

POST/v1/customers/request-phone-verification
curl -X POST https://api.fleetbase.io/v1/customers/request-phone-verification \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "{{customer_phone}}"
}'
POST/v1/customers/verify-phone-number

Verify Phone Number

Verifies the customer's pending phone number with the code sent by the phone verification request.

Body parameters
codestringrequired

Verification code sent to the pending phone number.

POST/v1/customers/verify-phone-number
curl -X POST https://api.fleetbase.io/v1/customers/verify-phone-number \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "{{customer_phone}}",
  "code": "{{verification_code}}"
}'
GET/v1/customers/places

List a customer saved places

Returns saved places for the authenticated storefront customer. Use these places for delivery addresses and checkout defaults.

GET/v1/customers/places
curl https://api.fleetbase.io/v1/customers/places \
  -H "Authorization: Bearer flb_live_…"
PUT/v1/contacts

Update Contact Customer Alias

Updates a storefront customer through the legacy contact alias route. The request is handled by the same customer update controller as /customers/{id}.

Body parameters
namestringoptional

Display name for the resource.

emailstringoptional

Email address for the person or customer.

phonestringoptional

Phone number for the person or customer.

identitystringoptional

Email address or phone number used for authentication.

passwordstringoptional

Password used to authenticate the customer.

codestringoptional

Verification or status code.

PUT/v1/contacts
curl -X PUT https://api.fleetbase.io/v1/contacts \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "{{customer_name}}",
  "email": "{{customer_email}}",
  "phone": "{{customer_phone}}"
}'
GET/v1/customers/orders

List a customer orders

Returns orders that belong to the authenticated storefront customer. Use pagination and filters to browse the customer order history.

GET/v1/customers/orders
curl https://api.fleetbase.io/v1/customers/orders \
  -H "Authorization: Bearer flb_live_…"
Customer | Fleetbase