Skip to content

Document customer API + Order Configs + service_quote on customer orders#7

Open
roncodes wants to merge 5 commits into
mainfrom
feature/customer-api-v1
Open

Document customer API + Order Configs + service_quote on customer orders#7
roncodes wants to merge 5 commits into
mainfrom
feature/customer-api-v1

Conversation

@roncodes
Copy link
Copy Markdown
Member

Summary

Documents the new FleetOps customer API surface added in fleetbase/fleetops#249:

New `Customers` folder

16 endpoints covering verification-code signup, email/password + SMS login, password reset, profile management, logout, push-device registration, customer-scoped orders, and saved places.

  • Customer `object.yaml` documents the new `company` sub-object on every `/v1/customers/...` response (id, name, currency, country, phone — currency resolved through `Utils::getCompanyTransactionCurrency`).
  • `Create a Customer` accepts a canonical `place` field (existing public_id OR inline Place fillable shape).
  • `Create a Customer Order` documents the canonical Fleet-Ops Order shape — same fields `POST /v1/orders` accepts from an operator (type, scheduled_at, notes, meta, payload OR pickup/dropoff/return/waypoints/entities). Includes the new optional `service_quote` field for booking against a quoted rate.

New `Order Configs` folder (order 8500)

  • `Query Order Configs` — `GET /v1/order-configs`
  • `Retrieve an Order Config` — `GET /v1/order-configs/{id}` (accepts uuid, public_id, namespace, or short key like `transport`)
  • `object.yaml` documents the public-safe shape with the activity flow projection (`{code, status, complete, color, ...}` per activity).

Convention adherence

All shapes are canonical Fleet-Ops field names — no client-portal aliases. The Customer object example was also cleaned of the stale `meta.origin` note since the API no longer writes to the customer's `meta` (it's client-owned).

Validation

```bash
node scripts/validate-collections.js

Validated 5 Postman Native Git collections and 3 environments.

```

Companion PRs

  • fleetbase/fleetops#249 — the API additions these docs describe.
  • `fleetbase/ultrasal.com` — reference Next.js portal consuming this surface end-to-end.

🤖 Generated with Claude Code

roncodes and others added 5 commits May 21, 2026 16:01
Documents the new B2C customer surface added to FleetOps Api/v1 (see
fleetbase/fleetops PR feature/customer-api-v1) — 16 endpoints covering
verification-code signup, email/password + SMS login, password reset,
profile management, logout, push-device registration, customer-scoped
orders, and saved places.

All requests target the existing `{{base_url}}/{{namespace}}/customers/...`
pattern. Authenticated endpoints declare a `Customer-Token: {{customer_token}}`
header that the create / login / verify-code responses populate via their
afterResponse scripts.

Folder placed between Contacts (4000) and Drivers (7000) at order=5000.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The endpoint now accepts (optional) `name` and `phone` so the verification
email is personalized and the pending user row carries real values from
step 1 of the signup wizard. Matches fleetbase/fleetops#feature/customer-api-v1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ses)

Updates Create a Customer + Create a Customer Order docs to reflect the
canonical Fleet-Ops shapes that the controller now strictly enforces:

- Create a Customer accepts `place` as either an existing Place public_id
  or an inline Place object using the standard Place fillable shape
  (name, street1, street2, city, province, postal_code, neighborhood,
  district, building, country, phone, meta). No line1/state/zip aliases.

- Create a Customer Order documents the canonical Order create shape —
  the same fields `POST /v1/orders` accepts from an operator: type /
  order_config / scheduled_at / notes / meta / internal_id, and either a
  `payload` (object or public_id) or top-level pickup / dropoff / return /
  waypoints / entities. No top-level item/value/mode/delivery/category
  aliases. customer_uuid is forced from the Customer-Token.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two doc additions paired with fleetbase/fleetops feature/customer-api-v1:

1. New "Order Configs" folder under Fleetbase API (order 8500, sitting
   between Orders at 8000 and Organizations) documenting the new
   read-only public resource:
     - GET /v1/order-configs        — list
     - GET /v1/order-configs/{id}   — find by uuid|public_id|namespace|key
   Includes a `.resources/object.yaml` documenting the projected shape
   (id/key/name/namespace + flow[] with canonical activity keys).

2. Customer object.yaml gains the `company` sub-object documenting the
   public-safe projection of the API credential's tenant: id, name,
   currency, country, phone. Currency resolution falls back through
   companies.currency → ledger base_currency → "USD" via the canonical
   Utils::getCompanyTransactionCurrency helper.

Also dropped the stale `meta.origin = "fleetops_customer_portal"` note
from the Customer object example, since the API no longer writes to
meta on the customer surface — meta is client-owned storage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pairs with fleetbase/fleetops feature/customer-api-v1 which now accepts
`service_quote` on the customer order create, resolving via the canonical
ServiceQuote::resolveFromRequest and consuming the quote via
$order->purchaseServiceQuote() to lock pricing onto the Order's
PurchaseRate. Mirrors OrderController::create's behaviour.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant