Skip to content

docs(storefront): document Accept-Language and add a locale variable - #72

Merged
roncodes merged 2 commits into
mainfrom
docs/storefront-accept-language
Oct 27, 2026
Merged

roncodes merged 2 commits into
mainfrom
docs/storefront-accept-language

Conversation

@roncodes

Copy link
Copy Markdown
Member

Summary

Storefront v0.4.30 answers in the language of the Accept-Language request header (en, mn, uk). It also stores that language on the signed-in customer, so their order notifications use it (fleetbase/storefront#164). This PR documents that in the Storefront API collection. It also adds a locale variable, so the collection can send the header.

Related Issue

Follows fleetbase/storefront#164 and fleetbase/fleetbase release/v0.7.74 (eb6468e7c, Mongolian and Ukrainian Laravel validation messages).

Type of Change

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

Implementation Notes

Storefront collection description. The collection had no description before. It now has three parts:

  • A one-line intro.
  • Authentication: the store or network key as the bearer token, and Customer-Token for signed-in customer endpoints.
  • Localization, covering:
    • the supported languages
    • regional-code and quality-value matching
    • the English fallback for unsupported or missing headers
    • what gets translated: error and validation messages, and verification SMS and email
    • what doesn't: status codes, error codes, response shapes, merchant content
    • how the stored customer language drives later push, inbox and email notifications

locale collection variable. Empty by default. A collection http:beforeRequest script upserts Accept-Language: {{locale}} only when the variable is set, so existing runs send exactly what they did before.

README. One line under Variable Conventions describes locale.

Request and response payloads are unchanged, and no request files were touched.

Validation

  • Tests
  • Lint
  • Build
  • Manual validation
npm run postman:lint
Validated 5 Postman Native Git collections and 3 environments.
Fleetbase API: No issues found (246 scanned)
Fleetbase Core API: No issues found (24)
Fleetbase Integrated Vendor Flow: No issues found (7)
Fleetbase Ledger API: No issues found (8)
Fleetbase Storefront API: No issues found (87)

I did not run the collection against a live server. The script is a no-op unless locale is set.

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: Accept-Language is optional on every Storefront endpoint. It changes only the language of human-readable text.

Documentation Notes

fleetbase.io's scripts/generate-api-docs.mjs reads each resource folder's .resources/definition.yaml description, not the collection-level one. So the Localization section shows in Postman but won't appear on the generated API reference by itself. fleetbase.io needs one of two things:

  • a short Storefront "Localization" page, or
  • the generator learning to render the collection description.

After either, bump its vendor/postman submodule.

Risk

None for existing runs: the new script does nothing while locale is empty. The behaviour described needs Storefront v0.4.30, so set locale only against a server running it.

Storefront v0.4.30 answers in the request's Accept-Language (en, mn, uk) and
remembers it for the signed-in customer's notifications (fleetbase/storefront#164).
The collection now describes that, and a collection script sends the new
locale variable as Accept-Language when it is set.
@roncodes roncodes added the documentation Improvements or additions to documentation label Oct 27, 2026
The description is also rendered on fleetbase.io, where "this collection" reads oddly.
@roncodes

Copy link
Copy Markdown
Member Author

fleetbase/fleetbase.io#146 renders this collection description as /docs/api/storefront/overview. Its vendor/postman bump follows once this is merged.

@roncodes
roncodes merged commit 387c2e1 into main Oct 27, 2026
1 check passed
@roncodes
roncodes deleted the docs/storefront-accept-language branch October 27, 2026 08:31
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