Customers
The Customer object
idstringoptionalPublic customer identifier. Prefixed customer_ on the public API.
internal_idstringoptionalOptional internal identifier.
namestringoptionalCustomer display name.
titlestringoptionalOptional title.
emailstringoptionalCustomer email address.
phonestringoptionalCustomer phone number (E.164 format).
photo_urlstringoptionalCustomer photo URL.
addressstringoptionalDefault address derived from the linked place, when one is set.
addressesarray of objectsoptionalSaved Place addresses, when the places relation is loaded.
tokenstringoptionalSanctum personal-access-token returned by signup/login/verify-code. Send back on authenticated requests as the Customer-Token header.
orders_countintegeroptionalNumber of non-deleted orders linked to this customer.
companyobjectoptionalPublic-safe projection of the customer's company. Contains the company's public id, name, resolved transaction currency (with fallback through companies.currency → ledger base_currency → "USD"), country, and phone. Useful for portals that need to render currency labels and contact info without making a separate request.
metaobjectoptionalFree-form metadata stored on the contact's meta column. The API does not write to this field — it is client-owned.
slugstringoptionalURL-friendly slug.
created_attimestampoptionalWhen the customer was created.
updated_attimestampoptionalWhen the customer was last updated.
{
"id": "customer_A1b2C3d4E5",
"internal_id": null,
"name": "Jane Customer",
"title": null,
"email": "jane@example.com",
"phone": "+15555550111",
"photo_url": null,
"address": null,
"addresses": [],
"token": "1|f4Wd3jY9aB...",
"orders_count": 0,
"company": {
"id": "company_6zV1KqN9pR",
"name": "ACME Logistics",
"currency": "USD",
"country": "US",
"phone": "+1-555-0100"
},
"meta": {},
"slug": "jane-customer",
"created_at": "2026-05-21T10:00:00.000000Z",
"updated_at": "2026-05-21T10:00:00.000000Z"
}/v1/customers/request-creation-codeRequest Customer Creation Code
Sends an email or SMS verification code to start a customer signup. Required before calling Create a Customer. Optionally include name and phone so the verification email greets the customer by name and the pending user row is pre-seeded with real values.
identitystringrequiredCustomer email address or phone number to send the verification code to.
modestringrequiredChannel to send the code through. One of email or sms.
namestringoptionalCustomer display name. When supplied, the verification email greets the customer by name and the pending user record is seeded with this value (avoids a "Pending Customer" placeholder).
phonestringoptionalPhone number (E.164 recommended). Pre-seeded on the pending user record alongside the email identity.
/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 '{
"identity": "{{customer_identity}}",
"mode": "email",
"name": "{{customer_name}}",
"phone": "{{customer_phone}}"
}'/v1/customersCreate a Customer
Creates a customer account (Contact + linked User) after verifying the code from Request Customer Creation Code. Returns the customer with a Sanctum token — persist this client-side and send it back as the Customer-Token header on authenticated requests.
identitystringrequiredEmail or phone the verification code was requested for.
codestringrequiredVerification code received via email or SMS.
namestringrequiredCustomer display name.
passwordstringrequiredAccount password (minimum 8 characters).
emailstringoptionalEmail address, if different from the identity. Must be unique within the company.
phonestringoptionalPhone number (E.164 recommended). Must be unique within the company.
titlestringoptionalOptional title.
photostringoptionalEither a file_… public id or a base64-encoded data URI.
placestring|objectoptionalOptional default Place for the customer. Either the public_id of an existing Place in this company (place_…), or an inline Place object using the standard Place fields: name, street1, street2, city, province, postal_code, neighborhood, district, building, country, phone, meta. When supplied, the controller creates the Place with the new customer as owner_uuid and sets it as place_uuid on the contact.
metaobjectoptionalFree-form metadata stored on the contact's meta column.
/v1/customerscurl -X POST https://api.fleetbase.io/v1/customers \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"identity": "{{customer_identity}}",
"code": "{{verification_code}}",
"name": "Jane Customer",
"password": "{{customer_password}}",
"phone": "{{$randomPhoneNumber}}",
"place": {
"name": "Home",
"street1": "123 Main Street",
"city": "Kingston",
"province": "Kingston",
"postal_code": "00000",
"country": "JM"
}
}'/v1/customers/loginLogin Customer
Authenticates a customer with email/phone + password. Returns the customer with a Sanctum token to use as Customer-Token.
identitystringrequiredCustomer email or phone number.
passwordstringrequiredCustomer account password.
/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-smsRequest Customer Login SMS
Starts SMS-based passwordless login by sending a verification code to the customer's phone. Falls back to email if SMS delivery fails and an email is on file.
phonestringrequiredCustomer phone number (E.164 recommended). identity is also accepted.
/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}}"
}'/v1/customers/verify-codeVerify Customer Login Code
Verifies the SMS/email code from Request Customer Login SMS and returns the customer with a Sanctum token. When for is fleetops_create_customer this proxies to Create a Customer.
identitystringrequiredEmail or phone the code was sent to.
codestringrequiredVerification code received via SMS or email.
forstringoptionalVerification slug. Defaults to fleetops_customer_login. Set to fleetops_create_customer to complete a signup flow that started with Request Customer Creation Code.
/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}}",
"for": "fleetops_customer_login"
}'/v1/customers/forgot-passwordForgot Customer Password
Sends a password-reset verification code to the customer's email or phone. Always returns { status: ok } regardless of whether the identity matches an account (prevents enumeration).
identitystringrequiredCustomer email or phone number to send the reset code to.
/v1/customers/forgot-passwordcurl -X POST https://api.fleetbase.io/v1/customers/forgot-password \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"identity": "{{customer_identity}}"
}'/v1/customers/reset-passwordReset Customer Password
Verifies the reset code from Forgot Customer Password and sets a new password. All existing tokens for the customer's user are revoked on success.
identitystringrequiredEmail or phone the reset code was sent to.
codestringrequiredReset verification code.
passwordstringrequiredNew password (minimum 8 characters).
/v1/customers/reset-passwordcurl -X POST https://api.fleetbase.io/v1/customers/reset-password \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"identity": "{{customer_identity}}",
"code": "{{verification_code}}",
"password": "{{customer_password}}"
}'/v1/customers/meRetrieve Authenticated Customer
Returns the profile of the customer identified by the Customer-Token header.
/v1/customers/mecurl https://api.fleetbase.io/v1/customers/me \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json" \
-H "Customer-Token: {{customer_token}}"/v1/customers/meUpdate Authenticated Customer
Updates the authenticated customer's profile. Changes to name, email, and phone are mirrored onto the linked user so subsequent logins work.
namestringoptionalNew display name.
titlestringoptionalNew title.
emailstringoptionalNew email. Mirrored to the linked user.
phonestringoptionalNew phone (E.164 recommended). Mirrored to the linked user.
photostringoptionalEither a file_… public id, a base64-encoded data URI, or the literal string REMOVE to clear the photo.
metaobjectoptionalFree-form metadata patch.
/v1/customers/mecurl -X PUT https://api.fleetbase.io/v1/customers/me \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"name": "{{customer_name}}",
"phone": "{{customer_phone}}",
"email": "{{customer_email}}"
}'/v1/customers/logoutLogout Customer
Revokes the Sanctum token used to make this request. The customer's other active sessions are unaffected — use Logout All Customer Sessions to revoke every token for the linked user.
/v1/customers/logoutcurl -X POST https://api.fleetbase.io/v1/customers/logout \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json" \
-H "Customer-Token: {{customer_token}}"/v1/customers/logout-allLogout All Customer Sessions
Revokes every Sanctum token issued to the customer's linked user (sign out everywhere).
/v1/customers/logout-allcurl -X POST https://api.fleetbase.io/v1/customers/logout-all \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json" \
-H "Customer-Token: {{customer_token}}"/v1/customers/register-deviceRegister Customer Device
Registers a push-notification device token against the authenticated customer's linked user.
tokenstringrequiredAPNs / FCM device token to register.
platformstringrequiredDevice platform. One of ios, android, or web. os is accepted as an alias.
/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 "Accept: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"token": "{{push_token}}",
"platform": "ios"
}'/v1/customers/placesList Customer Places
Lists the authenticated customer's saved Places (delivery addresses, etc.).
limitintegeroptionalPage size.
offsetintegeroptionalPage offset.
querystringoptionalFree-text search against Place fields.
/v1/customers/placescurl https://api.fleetbase.io/v1/customers/places \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json" \
-H "Customer-Token: {{customer_token}}"/v1/customers/ordersList Customer Orders
Lists orders owned by the authenticated customer (scoped to orders.customer_uuid).
limitintegeroptionalPage size.
offsetintegeroptionalPage offset.
statusstringoptionalFilter by order status (e.g. created, dispatched, completed).
querystringoptionalFree-text search across order fields.
/v1/customers/orderscurl https://api.fleetbase.io/v1/customers/orders \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json" \
-H "Customer-Token: {{customer_token}}"/v1/customers/ordersCreate a Customer Order
Creates an Order on behalf of the authenticated customer. Accepts the canonical Fleet-Ops Order create shape — the same fields as POST /v1/orders would accept from an operator. The customer's uuid is automatically attached as orders.customer_uuid; any client-supplied customer field is ignored. status is forced to created (customers cannot self-dispatch). The Order lands in the company resolved from the API credential.
typestringoptionalOrder config key (e.g. transport, freight). When omitted, the company's default OrderConfig is used.
order_configstringoptionalExplicit OrderConfig public id, overrides type.
scheduled_attimestampoptionalRequested fulfillment timestamp (ISO 8601).
notesstringoptionalFree-form notes / special handling instructions.
internal_idstringoptionalOptional caller-supplied identifier.
metaobjectoptionalFree-form metadata stored on the order's meta column.
service_quotestringoptionalOptional ServiceQuote reference (uuid or sqte_… public_id) returned by GET /v1/service-quotes. When supplied, the controller resolves the quote via ServiceQuote::resolveFromRequest and consumes it via $order->purchaseServiceQuote() to lock the pricing onto the order's PurchaseRate (same behavior as OrderController::create).
payloadstring|objectoptionalEither an existing Payload public_id, or an inline object with \{ pickup, dropoff, return, waypoints, entities \}. The controller mirrors OrderController::create's payload-building branch — Place sub-objects accept either a public_id or the standard Place fillable shape; entities accept the standard Entity fillable shape.
pickupstring|objectoptionalAccepted only when payload is not provided. Either an existing Place public_id or a Place-shaped object (name, street1, street2, city, province, postal_code, country, phone, meta).
dropoffstring|objectoptionalSame shape as pickup. Accepted only when payload is not provided.
returnstring|objectoptionalSame shape as pickup. Accepted only when payload is not provided.
waypointsarray of strings|objectsoptionalAccepted only when payload is not provided. Each item is either a Place public_id or a Place-shaped object.
entitiesarray of objectsoptionalAccepted only when payload is not provided. Each entity uses the standard Entity field shape: name, description, weight, weight_unit, declared_value, currency, meta. The controller delegates to Payload::setEntities so customer-created orders are indistinguishable from operator-created ones at the data layer.
/v1/customers/orderscurl -X POST https://api.fleetbase.io/v1/customers/orders \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"type": "transport",
"scheduled_at": "2026-05-25T10:00:00Z",
"notes": "Handle with care.",
"pickup": {
"name": "Pickup",
"street1": "4169 N State RD 7",
"city": "Lauderdale Lakes",
"province": "FL",
"postal_code": "33319",
"country": "US"
},
"dropoff": {
"name": "Dropoff",
"city": "Kingston",
"country": "JM"
},
"entities": [
{
"name": "Wireless Headphones",
"description": "Electronics",
"weight": 2.5,
"weight_unit": "lb",
"declared_value": 150,
"currency": "USD"
}
]
}'/v1/customers/ordersRetrieve a Customer Order
Fetches a single order by id, public id, or tracking number. Returns 404 if the order doesn't belong to the authenticated customer.
/v1/customers/orderscurl https://api.fleetbase.io/v1/customers/orders \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json" \
-H "Customer-Token: {{customer_token}}"