Guest Order Lookup for Unregistered Shoppers

Enable guest shoppers to look up their order status, shipment tracking, and other details in Storefront Next for orders placed without authentication or account registration. The self-service order lookup feature reduces support inquiries and costs, and improves the post-purchase shopper experience. To make sure only the order recipient can access the order details, guest shoppers must undergo multi-factor verification via email. Guest order lookup returns read-only order details—guests can’t make changes to the order, such as canceling an order or returning order items, which require authentication. This feature is turned off by default.

Shoppers must provide an email address that isn’t associated with a registered account. To look up an order based on an email tied to a registered account, shoppers must log in to their account.

Important

To view order details as a guest shopper, follow a two-step verification process by performing these steps:

  1. Click Order Lookup in the storefront footer.

  2. Enter the order number and your email address. After submitting these details, you receive a 6-digit one-time verification code in an email.

    The access code expires after 15 minutes. You can request a new code if needed. B2C Commerce sets the expiration time and it isn’t configurable in the storefront.

    Note

  3. Enter the verification code, and view the order details, such as the order status, date, order items, and shipping information.

Guest Order Lookup Configuration 

Configure guest order lookup settings in the app config file, config.server.ts, or by using environment variables.

Configure Guest Order Lookup in the App Config File 

Add these settings to your config.server.ts:

1export const config = {
2  app: {
3    guestOrderLookup: {
4      enabled: true,
5      orderNumberPattern: "^[a-zA-Z0-9-]{6,32}",
6      cooldownSeconds: 60,
7      turnstile: {
8        enabled: true,
9        failOpen: false,
10      },
11    },
12  },
13};

Configure Guest Order Lookup Using Environment Variables 

Override configuration via environment variables:

1PUBLIC__app__guestOrderLookup__enabled=true
2PUBLIC__app__guestOrderLookup__orderNumberPattern='^[a-zA-Z0-9-]{6,32}'
3PUBLIC__app__guestOrderLookup__cooldownSeconds=60
4PUBLIC__app__guestOrderLookup__turnstile__enabled=true
5PUBLIC__app__guestOrderLookup__turnstile__failOpen=false

Configuration Options 

OptionTypeDefaultDescription
enabledbooleanfalseEnable or disable the guest order lookup feature.
orderNumberPatternstring'^[a-zA-Z0-9-]{6,32}'Regex pattern for validating order number format on the form.
cooldownSecondsnumber60Minimum seconds between code requests per IP address.
allowedFieldsstring[]See config.server.tsAllowlist of order fields the server returns to the client after verification.
turnstile.enabledbooleantrueEnable Cloudflare Turnstile bot protection on the verification form.
turnstile.failOpenbooleanfalseWhen true, allow requests through if Turnstile is unreachable.

Routes 

When enabled, these routes are registered:

  • /order-lookup — Request verification code form
  • /order-lookup/verify/:orderNo — Enter verification code form
  • /order-lookup/results/:orderNo — View order details (after verification)

All routes automatically redirect authenticated users to /account/orders.

API Integration 

Guest order lookup uses the guestOrderLookup API call in B2C Commerce API (SCAPI) to fetch order data.

Guest Order Lookup Considerations 

Field-Level Security 

  • Guest order lookup suppresses these fields for security.
    • Cardholder name
    • Full phone number
    • Payment details (beyond masked method)
    • Billing address
    • Detailed financial information

Security 

  • HttpOnly session cookie: After successful verification, the server writes cc-goa_{siteId} with Secure; HttpOnly; SameSite=Strict. The cookie isn’t readable from JavaScript.

Turnstile Bot Protection 

Storefront Next integrates Cloudflare Turnstile on the guest order lookup form. Turnstile is enabled by default (turnstile.enabled: true) and blocks automated requests before they reach SCAPI.

Set turnstile.failOpen: true to allow requests through if the Turnstile service is unreachable. The default (false) blocks requests when Turnstile can’t be reached, which is the more secure posture for production.

No Persistent Storage 

  • No order data or personally-identifiable information persists beyond browser session.
  • Access tokens are short-lived and can’t be reused.
  • All data is cleared on browser close.

Troubleshooting 

Feature Not Visible 

Problem: “Order Lookup” link not appearing

Solution:

  1. Check config.app.guestOrderLookup.enabled is true
  2. Verify configuration is loaded correctly
  3. Clear browser cache and reload

Verification Codes Not Sending 

Problem: Shoppers not receiving verification codes

Solution:

  1. Check email service configuration
  2. Verify SCAPI requestOrderAccessCode endpoint is accessible
  3. Check API logs for errors
  4. Verify shopper’s email address is valid

Order Not Found Errors 

Problem: Valid orders returning “not found”

Solution:

  1. Verify order number format matches configuration regex
  2. Check email address matches order email exactly
  3. Confirm order exists in Commerce Cloud
  4. Verify SCAPI guestOrderLookup endpoint permissions

Cooldown Errors 

Problem: Shoppers receiving errors when requesting a new verification code too quickly

Solution:

  1. Review the cooldownSeconds setting (default: 60 seconds between requests per IP address)
  2. Check if a proxy or load balancer is forwarding the correct client IP address
  3. Consider lowering cooldownSeconds for production if the default is too strict

See Also