Use a Unique Host Name Alias

To use a unique hostname alias to access a sandbox, you can create or use an already existing DNS CNAME record that points to the sandbox origin, or you can create a unique hostname alias using the aliases API.

Note: Creating or using an already existing DNS CNAME record provides a global, one-to-one mapping to the sandbox.  For this option, you don’t need to use the aliases API.

If you choose to create a unique hostname alias using the aliases API, you must add a text record containing a unique domainVerificationRecord value to either the DNS sub- or root-domain. Unlike reusing a hostname alias, this option does not require using a registration link or any cookies.

Note: Before defining a sandbox alias, define a custom host name, such as www.merchant.com, in your site’s alias configuration under Merchant Tools > SEO > Aliases.

Define a unique 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.


    The results contain one or more string values.  These values appear as IP addresses surrounded by quotation marks, for example, "3.210.241.243".
  8. To test directly from any local system, add the string value, along with the custom hostname, as an address record, to your DNS subdomain or root domain.
    www.merchant.com  A  3.210.241.243
  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 editing the alias value (1), adding the hostname (2), and specifying the copied Sandbox ID (3), along with a uniqueness value of true.
    {
    "name": "www.merchant.com",
    "unique": true
    }


  16. Click Execute.
  17. Using the domainVerificationRecord value from the response body, add a verification text record to either the DNS subdomain or root domain.
    www.merchant.com  TXT  "sfcc_verification_abcd=8ee12469a9f6cf17af34eea237595d53608475
    f8a04840f03c2434bbbd51288d"
  18. Use the hostname to access the sandbox alias directly and perform SEO testing.