You can use your Commercetools products and categories within Builder with the Commercetools e-commerce plugin.
The plugin provides custom types that you can use to:
- Provide products and categories as inputs for your custom code components.
- Target content based on products or categories instead of URL paths with hard-coded resource handles or IDs.
- Preview products and categories on product detail pages and inside of other content while editing.
For a general overview of what you can do with plugins see Overview of Built-in Plugins for Builder.
To get the most out of this document, you should already have an API Client within your Commercetools account. For more information, see the Commercetools documentation, Create an API Client.
- Go to the Integrations section of Builder.
- On the Commercetools plugin tile, click the Enable button.
- Click the Settings to configure the plugin with your Commercetools account information.
The following video demonstrates this process:
Completing the plugin's setup requires the following information from your Commercetools API Client configuration:
- Project ID
- Client ID
- Secret
- API URL
- Auth URL
- Scopes (optional). See About Scopes below.
- Locale (optional)
The minimum required scope for the plugin to function is view_products:${project name}
, where ${project name}
is your Commercetools project name.
When creating the API Client in Commercetools, make sure to set the appropriate scopes based on your requirements. Note that scopes cannot be modified after the API Client is created. If you need to change the scopes later, you'll have to delete and recreate the API Client.
For more detail on finding this information within Commercetools and setting the correct scopes, visit the Commercetools documentation, View Your API Client Configuration and Scopes.
The commercetools plugin provides eight custom types:
- Commercetools Product:
CommercetoolsProduct
- Commercetools Product Preview:
CommercetoolsProductPreview
- Commercetools Product Handle:
CommercetoolsProductHandle
- Commercetools Products List:
CommercetoolsProductsList
- Commercetools Category:
CommercetoolsCategory
- Commercetools Category Preview:
CommercetoolsCategoryPreview
- Commercetools Category Handle:
CommercetoolsCategoryHandle
- Commercetools Categories List:
CommercetoolsCategoriesList
For more information on the shape of each type's values, refer to E-commerce Custom Types.
Check out the Builder GitHub repo for the plugin's source as well as instructions on how to modify or develop it.
For more information on using built-in plugins, see the following documents: