FleetbaseFleetbase

Orders & Checkout

Manage the full Storefront order lifecycle — cart, two-step checkout, payment, Fleet-Ops fulfillment, and the transactional notifications that fire along the way.

Orders & Checkout

The Orders & Checkout system handles the complete purchase lifecycle — from a customer adding items to their cart through to a dispatched Fleet-Ops delivery.

Navigate to Storefront → Orders to view and manage orders.

Storefront orders list — order ID, customer, items, total, status, created time

The Transaction Lifecycle

Cart → /checkouts/before → /checkouts/capture → Fleet-Ops Order → Fulfillment

1. Cart

The customer browses the catalog and adds products to a persistent Cart. The cart stores product selections, variants, addons, and quantities. See Cart.

2. Service Quote

When the customer adds a delivery address, your frontend asks Fleet-Ops for a Service Quote that calculates the delivery fee. See Service Quotes.

3. Checkout (two-step)

When ready to buy, the customer hits POST /storefront/v1/checkouts/before with the cart, service quote, payment gateway, tip, and pickup/delivery flag. Storefront returns a token (and a Stripe clientSecret when applicable). The frontend confirms payment via the gateway SDK, then calls POST /storefront/v1/checkouts/capture with the same token to finalize. See Checkout.

4. Fleet-Ops Fulfillment

The order appears instantly in Fleet-Ops → Operations → Orders. A dispatcher (or the Orchestrator) assigns a driver. The driver picks up from the store location and delivers to the customer's address.

Order Statuses

Storefront orders share their activity flow with the underlying Fleet-Ops OrderConfig. Storefront emits these activity codes as the order progresses:

ActivityTriggered when
createdOrder created from a successful checkout
acceptedMerchant accepts the order
preparingMerchant marks the order as being prepared
ready / pickup_readyOrder is ready for the driver to collect (pickup_ready is used for customer self-pickup)
dispatchedA driver has been assigned and is heading to pickup
started / in transitDriver collected the items and is en route to the customer
completedDelivery confirmed; proof of delivery captured
canceledCancelled by merchant, customer, or dispatcher

Transactional Notifications

Storefront notifies customers automatically as the Fleet-Ops order progresses — by push, in their notifications inbox, and by email. No configuration is required beyond an APNs/FCM notification channel and a registered device.

NotificationFires when
StorefrontOrderAcceptedThe merchant accepts the order (or it is auto-accepted)
StorefrontOrderReadyForPickupA pickup order is dispatched and ready to collect
StorefrontOrderDriverAssignedA driver is assigned to the order
StorefrontOrderEnrouteThe driver starts the order and is en route
StorefrontOrderNearbyThe driver is approaching the dropoff
StorefrontOrderCompletedDelivery is complete
StorefrontOrderUpdatedThe store edited the order or moved a booking and chose to tell the customer — says what changed (or when the booking is now) and what happens to the money (type order_updated)
StorefrontOrderItemUnavailableThe store marked an item unavailable — it will be replaced or removed and the total adjusted (type order_item_unavailable). Sent automatically
StorefrontOrderBalancePaidThe customer paid a balance due through its payment link — a receipt, with anything still left to pay (type order_balance_paid)
StorefrontOrderCanceledThe order was canceled — says why and whether the payment is refunded or given as store credit (type order_canceled)

StorefrontOrderPreparing can be sent with the storefront:send-order-notification command. StorefrontOrderCreated alerts the store's staff (the users configured to be alerted about new orders) by email and SMS.

Managing Orders in the Console

From Storefront → Orders:

  • View all incoming orders in real-time with current status
  • Click an order to open its panel: the next step and when it's due, alerts, the route, the items (with any marked unavailable), the payment, messages with the customer and the order's history — see Managing Orders
  • Edit an order after it was placed, settling any price difference by refund, store credit, payment link or cash on delivery
  • Cancel an order with a reason and a refund
  • Message the customer about their order — see Order Messages
  • Take bookings for bookable services
  • Track the driver's progress on the live map via the Fleet-Ops integration
  • View proof of delivery when the order is complete

Every order carries a payment summary in meta.payment; see Payment Status.

Internal Merchant Endpoints

If you are building a custom merchant terminal (rather than using the Fleetbase Console), Storefront exposes internal endpoints for advancing an order through its lifecycle:

EndpointEffect
POST /storefront/int/v1/orders/{id}/acceptAccept a pending order
POST /storefront/int/v1/orders/{id}/preparingMark as preparing
POST /storefront/int/v1/orders/{id}/readyMark as ready for pickup
POST /storefront/int/v1/orders/{id}/completedMark as completed (used by the merchant for pickup orders)
PATCH /storefront/int/v1/orders/cancelCancel: { "order": "…", "reason": "…", "refund": true }. Refunds or credits what was paid unless refund is false; settlement (refund or store_credit) overrides the method
POST /storefront/int/v1/orders/{id}/edit/preview, PATCH /storefront/int/v1/orders/{id}/editPrice and apply an edit
PATCH /storefront/int/v1/orders/{id}/entities/{entityId}Mark an item unavailable (or available again), or set its note. Marking it unavailable tells the customer; the response's customer_told says whether they were
POST /storefront/int/v1/orders/{id}/balance/linkIssue (or reissue) the payment link for the order's balance due
POST /storefront/int/v1/orders/{id}/balance/checkAsk the gateway whether the balance was paid, and settle it if so: { "paid": true, "charge": {…}, "payment": {…} }
GET /storefront/int/v1/orders/{id}/overviewPayment summary, due time, alerts, customer summary, tracking URL and what an edit may still change
GET /storefront/int/v1/orders/{id}/activityThe order's history, newest first: steps, comments, payment changes, edits and messages

These are authenticated as a Fleetbase user, not via a storefront key.

Integration with Fleet-Ops

When a Storefront checkout completes:

  • The store location (or the food truck GPS position, for mobile stores) becomes the Fleet-Ops order pickup address
  • The customer's delivery address becomes the dropoff address
  • Each cart item is converted to a Fleet-Ops Entity in the order payload
  • Status changes in Fleet-Ops automatically propagate back to the Storefront order via internal listeners

No custom webhooks or sync logic are required — the integration is native.

Orders & Checkout | Fleetbase