Define a Local Alias for an On-Demand Sandbox

You can test storefronts using either a global alias or an alias on your local system to access a specific on-demand sandbox.

When considering the use of an alias, keep the following in mind:

To use a global alias, assign a CNAME to the DNS that maps the alias to the IP address of the sandbox. To test on your local system, you can use the Sandbox API to assign a local alias to a sandbox using the following procedure.

Note: Before you define any sandbox aliases, make sure to define a custom host name, such as, in your site’s alias configuration under ‘Merchant Tools > SEO > Aliases’.

Define an on-demand sandbox Alias using the POST /sandboxes/{sandboxId}/aliases method.

  1. To open the Sandbox API user interface, go to B2C Commerce Sandbox API.
  2. Click Authorize.
  3. Enter the API client ID for the Sandbox API.
  4. To dismiss the authorization window and return to the Sandbox API user interface, click Close.
  5. In the Common section of the Sandbox API user interface, click to expand the GET/system method.
  6. Click Try it out.
  7. Click Execute.

  8. Add one of the retrieved inbound IP addresses and the custom hostname in your local hosts file, for example, You need admin rights to edit this file.
  9. In the Sandboxes section of the Sandbox API user interface, click to expand the GET /sandboxes method
  10. Click Try it out.
  11. Click Execute.

  12. From the results, copy the desired Sandbox ID.
  13. In the Sandboxes section of the Sandbox API user interface, click to expand the POST /sandboxes/{sandboxId}/aliases method
  14. Click Try it out.
  15. Register the hostname by (1) editing the alias value, (2) adding the hostname, and (3) specifying the Sandbox ID copied above.

  16. Click Execute.
    The call response generates a cookie and provides a registration URL.
  17. Copy the registration URL from the call response and paste the link into a browser.
    After a short time, the browser redirects to the sandbox alias where you can perform SEO testing.

What if I Don’t Use a Browser?

When testing REST APIs, you typically don’t use default browser access to a site. When using tools like Curl or Postman, you must define a cookie header manually using the hostname and information you obtain from the GET/system API response.

For example,

curl -X GET -k -H 'Cookies:
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.