You can quickly and easily integrate Commerce with Constructor.io using the Integrations Hub in Commerce Manager. This enables you to search your Commerce products using Constructor.io.
Whenever you publish a catalog, the full catalog is synced to Constructor.io. This is triggered using events delivered by a webhook.
When a catalog is published, a
catalog-release.updatedevent is triggered.
catalog-release.updatedevent is received by the webhook, the integration begins to execute.
The integration performs the following:
- Retrieves the mapping for Commerce fields to Constructor.io fields.
- Syncs all products to Constructor.io.
Collecting Your Setup Information
Before you begin configuring your Constructor.io integration in Commerce Manager, you need to collect the necessary setup information from Constructor.io and Commerce Manager.
Collect the following information and make sure you have it available, for example, in a text file, before configuring your Constructor.io integration in Commerce Manager. If you leave the Constructor.io Integration in Commerce Manager, the integration is not saved and you must remove the integration and create a new one.
Collecting Constructor.io Setup Information
To collect setup information from Constructor.io:
- Go to Constructor.io.
- Select your username.
- Select Account.
- Select API Integration.
- Select Generate API Token.
Collecting Commerce Manager Setup Information
In Commerce, create an application key for Constuctor.io.
Log in to Commerce Manager as a user with Seller Admin privileges.
Go to SYSTEM > Application Keys.
Select Create New.
Type a name for your application key.
Select Dismiss to view your application key.
To configure the integration, you need to copy the following values:
Commerce API Key Description API Base URL Your Commerce API Base URL. Client ID Your Commerce Client ID. Client Secret Your Commerce Client Secret.
When integrating with third-party providers, we recommend you use the closest region in the third-party service to reduce latency as much as possible. See Regions and URLs table.
Configuring the Integration
Now that you've collected the setup information, let's begin by configuring the integration.
- In Commerce Manager, go to COMPOSER > Integrations Hub.
- Under Search, click the Constructor.io Full Catalog Sync integration.
- Review the Overview page and click Configure. The current version information is displayed.
- Click Configure. The Trigger details are displayed.
- Click Next.
- Enter the setup information you collected previously.
- Click Finish.
The integration starts an execution which:
- Configures a webhook to listen to the
catalog-release.updatedevent, named EPCC Constructor.io Integration.
- Creates a flow for containing field mappings between Commerce and Constructor.io, called Constructor.io Mapping.
Now that you've configured the integration, let's learn how you use it.
Understanding Field Mappings Between Commerce and Constructor.io
To sync the catalog to Constructor.io, you create a map of the data to pass from Commerce to Constructor.io.
The integration uses a flow to contain the fields that you want to pass from Commerce to Constructor.io. The flow contains:
A default set of mapping fields. See the table below.
Some special fields that perform additional transformation work.
main_imagetriggers a lookup of the URL from the file associated to the main image relationship on the product.
taxonomyretrieves the hierarchy and builds a custom Constructor.io-friendly format.
Any other fields that you want, depending on your requirements.
The following table describes the default fields in Commerce Manager and their corresponding fields in Constructor.io.
|Commerce Field||Maps to Constructor.io Field|
|main_image||ep_main_image_url in Constructor.io. You can change the name in Constructor.io but if you also change the field name in Commerce Manager, the URL lookup function is not triggered.|
|taxonomy||ep_categories. This field is used to trigger the creation of a hierarchy in Constructor.io.|
Creating new field mappings
- In Commerce Manager, go to SYSTEM > Flows > Constructor.io Mapping. If you just configured your integration, refresh Commerce Manager to pick up the newly-added flow from the integration.
- Click New Field.
- Create the field mappings you desire by supplying the EPCC field and the Constructor.io field.
- In Constructor.io, create the fields you created in the previous step. Refer to the documentation provided with Constructor.io for more information.