Skip to content

Document Storefront notifications, promotions and device endpoints - #64

Merged
roncodes merged 1 commit into
mainfrom
docs/storefront-promotions-notifications
Sep 28, 2026
Merged

roncodes merged 1 commit into
mainfrom
docs/storefront-promotions-notifications

Conversation

@roncodes

Copy link
Copy Markdown
Member

Summary

Updates the Fleetbase Storefront API collection for the public (customer-facing) endpoints added or changed in the Storefront notifications and promotions work.

Storefront PR Change in this collection
fleetbase/storefront#103 (notifications inbox) New Notifications folder and Notification object: List Notifications (unread, type, limit, offset), Count Unread Notifications, Retrieve a Notification, Mark a Notification as Read, Mark All Notifications as Read, Delete a Notification, Get / Update Notification Preferences (order_updates, promotions). The folder description also covers the realtime channel contact.{uuid}
fleetbase/storefront#104 (promotions engine) New Promotions folder and Promotion object: Query Promotions (store), Retrieve a Promotion. Cart: Preview Cart Promotions, Apply Promotion Code to Cart (all refusal reasons documented), Remove Promotion Code from Cart, and a new promo_codes field on the Cart object. Checkout: promo_codes / promo_code / discount_code on Before, Before Cash Pickup and Update Stripe Payment Intent, plus the new 400 refusal for unusable codes. Orders: discount and promotions order meta
fleetbase/storefront#102 (push notification fix) Customer: new Unregister customer device. Register customer device now requires platform (ios/android), accepts environment, and documents that a token moves to the latest customer
fleetbase/storefront#105, #106 No changes. Those PRs add only console (int/v1) endpoints, which this repository does not document

While editing it, I also replaced the params of Update Stripe Payment Intent, which described unrelated name/description/status fields, with the parameters the endpoint actually reads.

Related Issue

Follows fleetbase/storefront#102, #103 and #104 (all labelled needs-api-spec).

Type of Change

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

Implementation Notes

  • Run order: the new folders are ordered after Customer (Notifications 4500, Promotions 5700), so {{customer_token}} is already set. Cart promo requests run right after Add Item to Cart (1100–1300).
  • Contract runs on an empty stack: a fresh stack has no notifications, promotions or promo codes. Requests that address one fall back to a placeholder and set expected_status, documenting the refusal contract instead:
    • Retrieve / Mark as Read / Delete a Notification and Retrieve a Promotion expect 404.
    • Apply Promotion Code to Cart expects 400 with cannot be applied.
    • With {{promo_code}} set in an environment, Apply Promotion Code to Cart exercises the success path.
  • Chained variables: List Notifications sets {{notification_id}} and Query Promotions sets {{promotion_id}} when results exist.
  • Environments: no new required variables. promo_code and device_token are optional.

Validation

  • Tests
  • Lint
  • Build
  • Manual validation
npm run postman:lint
Validated 5 Postman Native Git collections and 3 environments.
Linting Fleetbase Storefront API... No issues found. Scanned: 76 | Errors: 0 | Warnings: 0

Not run against a live API. The endpoints aren't in a released Storefront yet. The requests' behavior was checked against the Storefront implementation and its unit tests; the Storefront contract workflow will exercise them once the PRs land.

⚠️ Merge order

Storefront's API Contract (Postman) workflow runs this collection (from main) against the Storefront branch under test. Merge this only after fleetbase/storefront#102, #103 and #104 are merged. Otherwise the new requests would hit routes that don't exist yet and fail the contract check on every other Storefront PR.

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: all changes are in postman/collections/Fleetbase Storefront API.

Documentation Notes

fleetbase/fleetbase.io needs its Storefront API reference regenerated from this collection after merge, plus guide pages for notifications, promotions, promo codes and push setup.

Add the customer notifications inbox (list, unread count, retrieve, mark
read, mark all read, delete, preferences), the public promotions ("deals")
endpoints, the cart promo code endpoints (apply, remove, preview), the
promo_codes checkout parameter, order discount meta, and the customer
unregister-device endpoint with the stricter register-device contract.
@roncodes roncodes added the documentation Improvements or additions to documentation label Sep 27, 2026
@roncodes roncodes mentioned this pull request Sep 28, 2026
7 tasks
@roncodes
roncodes merged commit 3ceeb0a into main Sep 28, 2026
1 check passed
@roncodes
roncodes deleted the docs/storefront-promotions-notifications branch September 28, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant