Skip to content

Document order operations: payments, edits, stock, booking slots and comment visibility - #67

Merged
roncodes merged 7 commits into
mainfrom
docs/order-operations
Oct 14, 2026
Merged

roncodes merged 7 commits into
mainfrom
docs/order-operations

Conversation

@roncodes

@roncodes roncodes commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Brings the API specification up to date with the order operations work shipped on 13 Oct 2026: order payments and edits, stock, booking slots, address change requests, and comment visibility. Every request, field, status code and error body was checked against the code (sources below), not only against the change summary.

Driver offers removed. An earlier revision documented driver offers from fleetbase/fleetops#394 (accept/decline endpoints, the offer field, order.offer_* events, fleetops.offer_timeout_minutes). Fleet-Ops removes them in fleetbase/fleetops#398, so this PR no longer documents them. A driver assigned to an order simply has it; only ad hoc orders are offered to nearby drivers, through the existing Start an Order + assign flow, which the Orders folder now explains.

Source Change in this repo
fleetbase/storefront release/v0.4.25: dffc7f6, 249f666, 1eec05e, 505cfff, 038fa19, f444390, b17b646, 77be74d Storefront API. Orders: the Storefront Order object now documents payment / meta.payment (states, amounts, payment_link, store_credit_code, adjustments), meta.booking, meta.cancel_reason, meta.tip_amount / delivery_tip_amount, meta.address_change_request, and per-item meta (note, unavailable, substitute_for, added_by_edit, ...). New Request Address Change (POST orders/{id}/address-change-request). Products: track_inventory, inventory, in_stock; new List Product Booking Slots (GET products/{id}/slots?date=). Checkout: 422 cart_items_unavailable (with items[].available) and booking_slot_unavailable on Before / Before Cash Pickup (and Update Stripe Payment Intent, which is mentioned under Before). Notifications: order_updated (including a moved booking, in the store's time), order_item_unavailable, order_balance_paid, and what an order_canceled body now says. New Balance Paid Callback (`GET
fleetbase/fleetops#394 (→ release/v0.6.72), as amended by fleetbase/fleetops#398 Fleetbase API. reason on Cancel an Order. Update an Order and Update a Payload: the status lock policy, the 422 { error, locked: { field: reason } } response (saved example), entities_mode=replace, cod_amount top level and 0. Entities create/update/delete: the items 422. Orders folder: ad hoc orders (only they are offered to drivers) and the realtime events order.changed, order.driver_unassigned
fleetbase/core-api#306 (fix/driver-channel-and-comment-visibility → release/v1.6.69) Core API. Comments: visibility on create (validated) and on the resource; Query/Retrieve leave internal comments and replies out (404 for an internal comment); comment.created event in the folder description. Chat Channels: participant role / meta, message system / meta, sender: null, Storefront order chat channel meta

⚠️ Depends on unreleased versions, merge order

Possible overlap with #65 and #66

Related Issue

None. Follows the PRs listed above.

Type of Change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Test
  • Chore

Implementation Notes

  • Contract runs on an empty stack: the new requests fall back to a placeholder and assert their refusal unless the environment provides what they need:
    • Request Address Change: {{address_change_order_id}} (an open delivery order of the run's customer), optional {{place_id}}. Otherwise 404.
    • List Product Booking Slots: {{service_product_id}} (a bookable service), optional {{slot_date}} (defaults to today, UTC). Otherwise 404 for the run's non-bookable product.
  • Placeholders only: all IDs in examples are invented, and no tokens or credentials are included. No environment template changes.
  • Saved responses: Fleetbase API gets a saved example (Update an Order 422 locked), as that collection uses them. Storefront responses are described in the request descriptions, as that collection does.
  • Realtime events: documented in folder descriptions, as the Storefront Notifications folder already does: Fleet-Ops Orders (order.changed, order.driver_unassigned) and Core Comments (comment.created).

Validation

  • Tests
  • Lint
  • Build
  • Manual validation
$ npm run postman:lint
Validated 5 Postman Native Git collections and 3 environments.
Linting Fleetbase API...              No issues found. Scanned: 246 | Errors: 0 | Warnings: 0
Linting Fleetbase Core API...         No issues found. Scanned: 24  | Errors: 0 | Warnings: 0
Linting Fleetbase Integrated Vendor Flow... No issues found. Scanned: 7 | Errors: 0 | Warnings: 0
Linting Fleetbase Ledger API...       No issues found. Scanned: 8   | Errors: 0 | Warnings: 0
Linting Fleetbase Storefront API...   No issues found. Scanned: 78  | Errors: 0 | Warnings: 0
  • Every embedded JSON example and body in the changed files parses.
  • The two new Storefront requests were run with the Postman CLI against a local stub that answers 404 JSON. They addressed the placeholder ids, sent the expected bodies (Request Address Change dropped the unset place, and slots sent today's date), and passed with expected_status: 2 requests / 6 assertions / 0 failed.
  • Not run against a live API. The scoped postman:run:* scripts need a running Fleetbase stack with these unreleased versions. The module contract workflows will run them once the releases land.

Documentation Impact

  • No documentation changes needed
  • Documentation updated in fleetbase/fleetbase.io
  • Documentation needed but not included

API Reference Impact

  • No API reference changes needed
  • Updated fleetbase/postman
  • API reference updates required but not included

API reference notes: changes are in postman/collections/Fleetbase Storefront API, Fleetbase API and Fleetbase Core API. After merge, fleetbase.io regenerates its API reference from this repo through the bump-postman workflow.

Documentation Notes

Guide pages in fleetbase/fleetbase.io that should follow (not part of this PR):

Risk

Documentation only. The main risk is merging before the module releases (see above).

Screenshots / Recordings

None.

…d booking slots

- Storefront Order: payment (and meta.payment) with its states and adjustments,
  meta.booking, cancel_reason, tip amounts, address_change_request, and the
  per-item meta the store sets (note, packed_at, unavailable, substitute_for,
  added_by_edit).
- New Request Address Change (POST orders/{id}/address-change-request).
- Product: track_inventory, inventory and in_stock.
- New List Product Booking Slots (GET products/{id}/slots).
- Checkout initialize: 422 cart_items_unavailable and booking_slot_unavailable.
- Notifications: order_updated, and what order_canceled now says.
From fleetbase/fleetops#394 (release v0.6.72):
- New Accept an Order and Decline an Order (POST orders/{id}/accept|decline).
- Cancel an Order takes a reason.
- Update an Order and Update a Payload: the status lock policy and its 422
  locked response, entities_mode=replace, cod_amount at the top level and 0.
- Entities: the 422 when the order's items are locked.
- Order: the offer field; Orders folder: offers and the order.changed,
  order.driver_unassigned and order.offer_* realtime events.
- The collection script honours expected_status, as the Storefront one does,
  so the offer requests can assert their 404 when a run has no offered order.
From fleetbase/core-api#306 (release v1.6.69):
- Comments: visibility on create and on the resource; the public list and
  retrieve leave internal comments and replies out; comment.created event.
- Chat: participant role and meta, message system and meta, null sender,
  and the Storefront order chat channel meta.
Fleet-Ops drops driver offers in fleetbase/fleetops#398. Remove the Accept
an Order and Decline an Order requests and their examples, the offer field
on the Order object, the order.offer_* realtime events and the
offer_timeout_minutes setting. The Orders folder now explains that an
assigned driver simply has the order and only ad hoc orders are offered to
nearby drivers, taken with Start an Order and assign. The expected_status
override added for the offer requests is reverted, as nothing else in the
Fleetbase API collection uses it.
@roncodes roncodes changed the title Document order operations: payments, edits, driver offers, stock, booking slots and comment visibility Document order operations: payments, edits, stock, booking slots and comment visibility Oct 13, 2026
…ilable and order_balance_paid notifications; a moved booking's order_updated
The notification type list names both the activity and chat types from #65 and
the order_updated, order_item_unavailable and order_balance_paid types.
@roncodes
roncodes merged commit 4764bec into main Oct 14, 2026
1 check passed
@roncodes
roncodes deleted the docs/order-operations branch October 14, 2026 07:19
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