Skip to main content

Integrating with Advanced Commerce (GrapheneHC)

You can integrate Commerce with Advanced Commerce (GrapheneHC) using the Integrations Hub in Commerce Manager. This means you can synchronize Commerce data such as products, prices, images, categories, custom attributes, and variations with your Advanced Commerce (GrapheneHC) storefront, giving you advanced searching and merchandising capabilities.

The following diagram shows how Elastic Path data is sent to an Advanced Commerce (GrapheneHC) storefront.

Advanced Commerce (GrapheneHC Integration) diagram

When a catalog is published, the integration automatically sends the data from Commerce to an Advanced Commerce (GrapheneHC) storefront.

For more information, watch a video.

Advanced Commerce (GrapheneHC) Integration Templates

The Advanced Commerce (GrapheneHC) Integration uses templates to create the data from your Commerce store in your Advanced Commerce (GrapheneHC) storefront. The templates use JSONata as their query language.

Product Template

The Product Template creates/updates products in Advanced Commerce (GrapheneHC), including any configured locales. You can edit the template, depending on your requirements. The Product Template must conform to the Advanced Commerce products schema.

Prices are created/updated in all currencies, in addition to any sale prices you have configured for your products.

If you have multiple currencies, in prices, you must provide the catalog ID for each currency you created in Advanced Commerce (GrapheneHC). For example:

$key & "_" & $uppercase($product.meta.catalog_id)

See Prerequisites.

If you only have one currency, you can remove this and the catalog defaults to the language configured in the Product Template.

In features, you can configure the product attributes you want to display in your Advanced Commerce (GrapheneHC) storefront. The following example fetches product_weight and product_height from the products(dimensions) template.

"features": [
{
"hierarchy": [
"weight",
$number($product.attributes.extensions.$.'products(dimensions)'.$.'product-weight')
]
},
{
"hierarchy": [
"height",
$number($product.attributes.extensions.$.'products(dimensions)'.$.'product-height')
]
}
] ~> $filter(function($v, $i, $a) {
$count($v.hierarchy) > 1
})

Category Template

The Category template creates/updates your hierarchies, nodes, and products associated with those nodes (including any configured locales) in Advanced Commerce (GrapheneHC). You can edit this template, depending on your requirements.

The Category template must conform to the Advanced Commerce categories schema.

Definition Template

The Definition template creates/updates Product Experience Manager variations and options in Advanced Commerce (GrapheneHC). You can edit the template, depending on your requirements. The Definitions template must conform to the Advanced Commerce definition schema.

Collecting Your Setup Information

Before you begin configuring your integration in Commerce Manager, you need to collect the necessary setup information from Advanced Commerce (GrapheneHC) and Commerce Manager.

Collecting Advanced Commerce (GrapheneHC) Setup Information

Collect the following setup information from Advanced Commerce (GrapheneHC).

OptionDescription
API Base URLYour Advanced Commerce API Base URL, for example, https//{{domainKey}}.api-{{location}}.advancedcommerce.services. Contact your Advanced Commerce team.
API KeyYour Advanced Commerce API Key.
API SecretYour Advanced Commerce Secret.

Collecting Commerce Manager Setup Information

To create a new application key, go to SYSTEM > Application Keys.

Commerce API KeyDescription
Token URLYour Commerce API Token URL. For example, https://useast.api.elasticpath.com/oauth/access_token. See Regions and URLs.
Client IDYour Commerce Client ID.
Client SecretYour Commerce Client Secret.
note

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.

Prerequisites

  • Ensure that you have collected your setup Information.

  • In Commerce Manager, ensure that you have created the data that you want to synchronize with Advanced Commerce (GrapheneHC).

  • In Advanced Commerce (GrapheneHC), ensure that you have created the following:

    • The currencies available for the products in your Commerce store catalog. Create the currencies using your Commerce catalog ID. When the catalog ID is passed in the Product Template, Advanced Commerce (GrapheneHC) displays the prices in the currencies you have configured for your catalog.
    • An Advanced Commerce (GrapheneHC) storefront for each Commerce catalog you want to publish. As part of the integration, you need to map your catalog to your Advanced Commerce (GrapheneHC) storefront ID. See Configuring the Integration.
    • The languages available for the products in your Commerce catalog.

Configuring the Integration

Now that you've met the prerequisites, let's begin with configuring the integration.

  1. In Commerce Manager, go to COMPOSER > Integrations Hub.
  2. Under Search Integrations, click Advanced Commerce (GrapheneHC) Integration.
  3. Click Configure. The Advanced Commerce (GrapheneHC) integration guides you through the steps you need to follow to complete the integration.
  4. Click Next. The Connection page is displayed.
  5. On the Connection page, do the following:
    1. Complete the Commerce Connection credential details:
      • Client-ID - Your Commerce Client ID.
      • Client-Secret - Your Commerce Client Secret.
      • Token URL - Your Commerce API Token URL
    2. Click Connect. The authorization is successfully completed.
    3. Complete the Advanced Commerce (GrapheneHC) Connection credentials:
      • API Base URL - Your Advanced Commerce (GrapheneHC) API base URL.
      • API Key - Your Advanced Commerce (GrapheneHC) API key.
      • API Secret - Your Advanced Commerce (GrapheneHC) secret.
  6. Click Edit for each template you want to edit. (#advanced-commerce-graphenehc-integration-templates).
  7. Click Next. The Catalog And Storefront Mapping page is displayed.
  8. From Elastic Path Catalog list, select the catalog you want to display in Advanced Commerce (GrapheneHC).
  9. From Advanced Commerce Storefront ID type the ID of the Advanced Commerce storefront where you want to display your catalog.
  10. Click Add to Catalog and Storefront Mapping to add as many catalogs as you want.
  11. Click Finish. Your integration is enabled.

Troubleshooting the Advanced Commerce (GrapheneHC) Integration

You can debug any issues in Executions. Click an execution to see the execution details. The Logs shows the output and any errors or warnings.

Select Retry to initiate an execution again.