You must create a Storefront record and pass the ID to the storefrontId parameter in the environment.ts file while configuring the template.

Prerequisites

  • You must have an active account associated with a price list. For more information on how to create an account, see Creating an Account.
  • You must have an active price list. For more information on creating a price list, see Creating a Price List.

Create a Storefront record

You can use the POST https://<URL_of_the_Instance>/api/revenue-admin/v1/storefronts API or Admin User Interface, to create a storefront record. Use the following minimum required sample payload to create an account:

{
    "Name": "string",
    "DefaultAccount": {
      "Id": "{default account that you created as a prerequisites}",
      "Name": "{name of the account}"
    },
    "DefaultPriceList": {
      "Id": "{price list (associated with account) that you created as a prerequisites}",
      "Name": "{name of the price list}"
    },
    "Channel": "Ecommerce or Partner Commerce as per your business use case.",
  }
CODE

There are different options for adding a Price List to the Storefront record.

  1. Pass the Default Account details that have a price list attached.
  2. Pass the Default Price List details directly.

Suppose both of the above-mentioned options are used while creating a Storefront record, and a default account also has a price list attached. In that case, the Price List associated with the default account takes precedence over the price list added directly.