Skip to main content
My Account is a logged-in experience. Use a session accessor and protect account routes at the framework’s request boundary where possible. Typical structure:

Route protection

A route guard should distinguish authentication state from an upstream API failure.
  • anonymous session → redirect to login or open authentication
  • logged-in session → render account content
  • token/session failure → recover session or require login
  • transient Commerce Engine failure → show retry/error state, not an automatic logout
For SSR frameworks, use the request-bound server accessor. Avoid placing all account data in the root layout; keep it in the protected route boundary.

Identity helpers

Many customer and order SDK methods resolve the current user or customer from the active session:
Do not pass browser-supplied identity parameters when a session-aware overload exists. Auth profile methods can require an explicit user ID:
B2B stores can have multiple users under one customer. Use getUserId() and getCustomerId() according to the operation contract rather than assuming they are always interchangeable.

Profile

Retrieve the current user:
Update editable fields:
Email or phone changes can require a separate OTP verification action. Retrieve the exact current operation contracts before implementing those flows.

Profile UX

  • show which contact methods are verified
  • preserve form input on validation failure
  • disable duplicate submissions
  • update local/session user state from the returned data
  • do not expose internal IDs unnecessarily

Address book

List saved addresses:
Create an address:
Confirm the exact input fields with the LLM-first operation and request type. Country requirements vary. Update and delete using the current operation signatures. After mutation:
  • invalidate the address list
  • preserve default billing/shipping constraints
  • check whether an active subscription or other feature references the address before deletion if the API exposes such a restriction
  • show a confirmation for destructive actions
During checkout, link a saved address ID to the cart rather than copying a stale address object where the operation supports IDs.

Address book lifecycle

Order history

Use pagination and status filters for larger histories. A card should normally show:
  • order number
  • order date
  • current status
  • payable/paid amount and currency
  • a representative item image
  • shipment or payment attention state where relevant
Do not expose order data solely because a user knows an order number; the request-bound session must own the order.

Order detail

Render:
  • ordered items and quantities
  • billing and shipping addresses
  • pricing, discounts, tax, shipping, and payment totals
  • payment state
  • fulfilment and shipment state
  • cancellation/refund state
An order can have multiple shipments:
Show each shipment’s items, status, tracking URL, AWB/tracking number, and estimated delivery when present.

Payment status and retry

A failed payment can remain retryable:
Show Retry only when the response says is_retry_available is true. Use the same provider-specific payment payload rules as checkout and verify the final result through payment-status polling. Do not trust old redirect parameters when rendering order payment state.

Cancellation

Fetch the latest order detail immediately before showing or executing cancellation. Show the action only when is_cancellation_allowed is true.
Retrieve the current cancellation body contract before implementation. If bank transfer is supported, collect and handle bank details through the approved secure flow rather than an improvised text field. After success, invalidate order detail, order history, payment, shipment, and refund queries.

Order history and conditional cancellation

Returns

Customer-initiated storefront returns are not currently the default supported flow described by the Commerce Engine skills. Returns are managed by store administrators through the Admin Portal, while customers can cancel an eligible order before the cancellation window closes. Do not generate a “Request Return” form unless the store has a verified custom return API or workflow. Explain the store’s support route and show refund/return status supplied by the order APIs.

Refunds and payments

Present transaction state without exposing provider secrets or raw sensitive gateway payloads.

Loyalty

A loyalty page can show:
  • current tier
  • available/redeemable balance
  • total earned and redeemed
  • expiry where supplied
  • activity history
Use the returned currency/value rules; do not assume one loyalty point equals one currency unit.

Reviews

List the customer’s existing reviews and eligible purchases:
The response can include submitted reviews and items ready for review. A review submission is a catalog session write and can require product, order, rating, and media context according to the operation contract. Prevent duplicate submissions and show moderation/publishing state where returned.

Notification preferences and profile image

These features use auth profile operations and may require explicit user IDs or multipart uploads.
  • retrieve current preferences before editing
  • separate transactional requirements from optional marketing consent
  • preserve channel-specific consent
  • validate image type/size before upload
  • remove cached profile image after replacement/deletion
Use exact operation contracts instead of inferring multipart field names.

Data fetching and cache boundaries

  • server-render stable account summaries where the framework supports request sessions
  • use client queries for interactive tabs and mutations
  • do not cache one user’s account response globally
  • key caches by operation and authenticated session where necessary
  • remove protected data immediately after logout
  • refetch order/cart state after login because the anonymous cart can merge

Empty and failure states

Keep valid empty states separate from authentication or upstream errors.

Accessibility

  • use headings and landmarks across account sections
  • identify current navigation tab
  • announce mutation success/failure
  • require confirmation for delete/cancel actions
  • return focus after dialogs close
  • make shipment timelines and statuses understandable without colour alone
  • expose tracking links with descriptive labels

Production checklist

Orders skill and exact contracts

Use the orders skill for lifecycle decisions and retrieve exact methods/types from the LLM-first reference.