Skip to main content

Commerce Node Import

The Commerce Node Import is a utility in the Integrations Hub in Commerce Manager that enables you to import Commerce node data to your Commerce store. The Commerce Node Import utility can import:

  • Node data files of any size.
  • Localized node names and descriptions.

An example of how node data is imported using a Node Import integration is described below.

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

  2. Configure a Node Import integration in the store where you want to import the node data. This creates the webhooks that consumes the message and JSON files when you send the API request to import the node 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 Import Integration Files.

    • The Node Import integration processes your Gzip files.
    • The nodes are imported to the store.

For more information, watch a video.

Node Import Integration File Format

The data that you provide to the Node 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.
parentSlugstringA label for a parent node that a node belongs to. If this is blank, the node is a parent node. A slug can contain any combination of letters, numbers, periods, hyphens, and underscores. NO spaces or other characters are allowed.
namestringA name for the node.
descriptionstringA description for the node.

The name Object

If your store supports multiple languages, you can localize node names and descriptions. You can have as many locales as you want.

NameTypeDescription
localestringThe language code, for example, "fr-CA" or "en".
valuestringA localized name for the node.

The description Object

If your store supports multiple languages, you can localize node names and descriptions. You can have as many locales as you want.

NameTypeDescription
localestringThe language code, for example, "fr-CA" or "en".
valuestringA localized description for the node.

Using Node Import Integration Files

To invoke the node import, you must invoke the webhook created when you configure the Node Import integration and supply the Gzip file URLs as part of the payload. See Importing your Node 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}/nodes.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 500 and the upper limit depends on the number of custom attributes, files and variations. Tuning may be required to find the optimal page size.
pageOptionalintegerThe number of pages handled during import.

Request Example

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

Prerequisites

  1. The store where you are importing your node data must already have the hierarchies defined. The Node Import does not create hierarchies as part of the import.
  2. You must have a gzipped JSON file configured that defines the node data you want to import. See Node Import Integration File Formats.

Configuring the Node Import Integration

Once you have met the Prerequistes, you are ready to configure the node 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 Import. The Commerce Node 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. 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.

    3. Click Connect. The Integration Hub uses your current store crededentials to automatically connect you to your store.

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

      OptionDescription
      Token URLYour Commerce API Token URL. For example, https://api.motlin.com/oauth/<access_token> (EU) or https://useast.api.elasticpath.com/oauth/<access_token> (US).
      Elapsed Execution Time CutoffThe number of seconds to wait before the node import is stopped, if page processing has halted for any reason. This may need to be increased if the number of nodes being processed for the store is exceptionally large.
      Default Page SizeThe default page size processed when importing.
  7. Click Finish. Your integration is enabled. You must enable a Node integration on each store where you want to import your node data set.

Importing your Node Data

You can perform the node import using Postman.

  1. Go to a store.
  2. Go to COMPOSER > Integrations Hub.
  3. Under Store Management & Configuration, select Commerce Node Import. You must have configured a Node Import integration before you can import any resources into this store. See Configuring the Node Import Integration.
  4. From Summary > Trigger Details, click Paged Node 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 Import Integration File Format.
  9. Run POST {{webhook-url}}.
  10. When the import has finished, if you go to your store, you should see all the resources you just imported.

Troubleshooting the Node 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