When using Salesforce Commerce API (SCAPI) with the Shopper Login and API Access Service (SLAS), a guest shopper's customer_id may be reassigned to a newly registered user if the guest session token is not rotated after checkout. As a result, the registered user can retrieve orders that were originally placed as a guest — causing unintended cross-account order data exposure.
This issue occurs when:
POST /orders using SCAPIcustomer_id to the new registered profile when the guest session has not been rotatedTo prevent guest order data from appearing in a shopper's registered account, merchants must rotate the guest session immediately after a guest order is placed. The root cause is that SLAS can reassign an existing guest customer_id to a newly registered user if the session is not rotated at checkout - so the fix is to request a fresh guest token the moment order confirmation is received.
Important: The solution below assumes session rotation is executed immediately after POST /orders succeeds - before any further storefront activity and before any registration flow begins. Additional trigger points are covered at the end of this section. If rotation is deferred, the guest customer_id may still be reassigned during registration.
Follow the flow below to implement session rotation:
Trigger: POST /orders succeeds (order confirmed). Execute Steps 1 and 2 immediately.
POST /shopper/auth/v1/organizations/{organizationId}/oauth2/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&channel_id={siteId}
Response: new access_token, refresh_token.
Replace the stored access_token and refresh_token with the values returned in Step 1. All subsequent SCAPI calls use the new session.
The green box shows Steps 1 and 2 above. The diagram also shows:
POST /orders → order confirmed) - the exact point at which rotation must beginGET /customers/{id}/orders on the new registered profile returns an empty list, confirming the guest orders are cleanly isolatedNote: The ideal trigger points(in order of preference)
POST /orders succeeds. This is the recommended and strongest boundary - execute rotation here whenever possible./logout, but this is not a reliable mitigation on its own, as guests frequently register without explicitly logging out first.005384680

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.