Skip to main content

Commerce Node Product Association Import

The Commerce Node Product Association Import is a utility in the Integrations Hub in Commerce Manager that enables you to quickly and easily update Commerce node product association data in your Commerce store. The Commerce Node Product Association Import utility can import node product association data files of any size.

An example of how node product association data is updated is described below.

  1. Create a JSON file with the node product association data you want to import. You can have more than one JSON file, depending on your requirements. See Node Product Association Import Integration File Format.

  2. Configure a Node Product Association Import integration in the store where you want to import the node product association data. This creates the webhooks that consumes the message and JSON files when you send the API request to import the node product association data.

  3. In Postman, run POST {{webhook-url}} request. As part of the request, you must supply the Gzip file URLs for the JSON files you want to process as part of the import. See Using Node Product Association Import Integration Files.

    • The Node Product Association Import integration processes your Gzip files.
    • The node product association data are imported to the store.

Node Product Association Import Integration File Format

The data that you provide to the Node Product Association Import integration must conform to JSON Lines text format and conform to the following model.

NameTypeDescription
slugstringA label for the node that is used in the URL paths. A slug can contain any combination of letters, numbers, periods, hyphens, and underscores. NO spaces or other characters are allowed.
hierarchySlugstringA label for the hierarchy that the node belongs to. It is used in the URL paths. A slug can contain any combination of letters, numbers, periods, hyphens, and underscores. NO spaces or other characters are allowed.
productsstringAn array of product SKUs.

An example of a Node Product Association Import integration file is shown below:

{
"slug": "example-slug",
"hierarchySlug": "example-hierarchy",
"products": [
"test-product-sku-1",
"test-product-sku-2"
]
}

Using Node Product Association Import Integration Files

To invoke the node product association import, you must invoke the webhook created when you configure the Node Product Association Import integration and supply the Gzip file URLs as part of the payload. See Importing your Node Product Association Data. We recommend that URLs are signed with an expiration date. See Sharing objects using presigned URLs.

Body

NameRequiredTypeDescription
gzipFileUrlsRequiredstringAn array of Gzip file URls for the JSON files you want to import in the format https://{path}/associations.jsonl.gz where path is the path to your Gzip file. We recommend aligning the number of products per file with the pageSize, as processing each page requires rereading the file.
fileIndexOptionalintegerThe zero based index of the gzip file to start with. The default is zero. This is useful to restart processing in case of failure.
PageSizeOptionalintegerThe number of products to process from a given file in a paged manner. The default is 100. Tuning may be required to find the optimal page size.
pageOptionalintegerThe number of pages handled during import.

Request Example

{
"gzipFileUrls": [
"https://{path}/associations.jsonl.gz"
],
"fileIndex": 0,
"pageSize": 1000,
"page": 5
}

Prerequisites

  1. You must have a gzipped JSON file configured that defines the node product asssociation data you want to import. See Node Product Association Import Integration File Formats.
  2. The store where you are updating your node product association data must have the nodes and products referenced in the node product association import integration file already defined. The Node Product Association Import does not create the products and nodes as part of the import.

Configuring the Node Product Association Import Integration

Once you have met the Prerequistes, you are ready to configure the node product association import integration in Integrations Hub.

  1. In Commerce Manager, go to the store where you want to import node data.

  2. Go to COMPOSER > Integrations Hub.

  3. Under Store Management & Configuration, click Commerce Node Product Association Import. The Commerce Node Product Association Import integration guides you through the steps you need to follow to complete the integration.

  4. Click Configure. The Trigger details are displayed. URL is the webhook that consumes your Gzip files.

  5. Click Next. The Commerce Configuration page is displayed.

  6. Complete the information in the Commerce Configuration page.

    1. For Log Level, from Value list, select the level of logging.

    2. Click + Add Value to add another level of logging.

    3. Enter:

      • Client-ID - Your Commerce Client ID.

      • Client-Secret - Your Commerce Client Secret.

        You can find this information in **SYSTEM** > **Application Keys** in Commerce Manager when logged in as a user with Seller Admin privileges. See [Application Keys](/docs/commerce-manager/application-keys/application-keys-cm).

        The table below describes the options you can configure.

      OptionDescription
      Keep Alive FlagTurn on the Keep Alive Flag toggle if you want to specify keep alive intervals for this integration.
      Keep Alive IntervalSpecify keep alive interval for this integration. Default value is 10000.
      Throttle IntervalSpecify throttle interval for this integration. Default value is 125. This supports staying within rate limits.
      Throttle LimitSpecify throttle request limit interval for this integration. Default value is 3. This supports staying within rate limits.
      Token URLYour Commerce API Token URL. For example, useast.api.elasticpath.com/oauth/access_token (EU) or useast.api.elasticpath.com/oauth/access_token (US).
  7. Click Connect.

  8. Once you have successfully connected to Commerce, you can configure the following:

    OptionDescription
    Elapsed Execution Time CutoffThe number of seconds to wait before the node product association import is stopped, if page processing has halted for any reason. This may need to be increased if the number of associations being processed for the store is exceptionally large.
    Default Page SizeThe default page size processed when importing.
    Maximum Hierarchy DepthFrom Maximum Hierarchy Depth list, select the depth of parent/child levels you want. The default is 3.
  9. Click Finish. Your integration is enabled. You must enable a Node Product Association Import integration on each store where you want to import your node Product Association data set.

Importing your Node Product Association Data

You can perform the node product association data import using Postman.

  1. Go to a store.
  2. Go to COMPOSER > Integrations Hub.
  3. Under Store Management & Configuration, select Commerce Node Product Association Import. You must have configured a Node Product Association Import integration before you can import any resources into this store. See Configuring the Node Product Asssociation Import Integration.
  4. From Summary > Trigger Details, click Paged Node Product Association Loader to display the webhook.
  5. Select Copy to Clipboard to copy the URL.
  6. Go to Postman.
  7. Open POST {{webhook-url}} where webhook-url is the webhook you copied in step 5.
  8. In Body, add the list of Gzip file URLs for the JSON files you want to import. See Node Product Association Import Integration File Format.
  9. Run POST {{webhook-url}}.
  10. When the import has finished, go to your store to see the resources you just imported.

Troubleshooting the Node Product Association Import 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.

Demo