Import and export functionality in Composable Commerce uses the key
field as the identifier for resources. If your resources do not have a key
, they cannot be updated via import and their references may be broken in exported files.
As the key
value is optional, resources within your Composable Commerce Project may lack them.
This app sets boilerplate key
values to resources, which enables you to fully use the import and export functions within Composable Commerce.
Note
The boilerplate key
values use the format: {resourceType}_{resourceId}.
For example: category_512a4466-6876-4c41-add8-1406c6c68da3
- Clone this repository.
- Install the dependencies using the command:
npm install
- Create a commercetools Composable Commerce API Client that can manage:
- Cart Discounts
- Categories
- Customers
- Customer Groups
- Discount Codes
- Products
- Standalone Prices
- Tax Categories
- Download the Environment Variables (.env) for this API Client.
- Rename the downloaded file
.env
, and copy it to the cloned repository.