Skip to main content

JSON feed path mappings

As part of the process for importing product feeds in JSON, CSV and XML formats, you need to specify the JSON path for product attributes including name, description and image. On this page we explain how to determine which JSON path values to use.

How to determine "Products" JSON path
Link copied!

  • Open a JSON Path evaluator such as the JSON Path online evaluator to determine the JSON paths for your feed.
  • Paste a sample of your complete JSON file feed into the evaluator.
  • Construct a JSON Path string to return your products as an array.

Sample JSON
Link copied!

{
"products": [
{
"id": "123",
"name": "Product A"
},
{
"id": "456",
"name": "Product B"
}
]
}

Enter $.products[*] as the JSON path into the evaluator. This returns the following:


[
{
"id": "123",
"name": "Product A"
},
{
"id": "456",
"name": "Product B"
}
]

$.products[*] should be entered as the path to the products array when configuring the feed.

How to determine file feed product property JSON Paths
Link copied!

Each product requires a JSON Path mapping of four key properties: ID/SKU, Name, Description, Images. Note that the "Images JSON Path" can return a string an array of strings.

  • Open a JSON Path evaluator such as the JSON Path online evaluator to determine the JSON paths for your feed.
  • Paste a "Product" sample from your JSON file feed into the evaluator.
  • Construct a JSON Path string for each of the required mapping properties.

An example product data structure is shown below.

{
"id": "123",
"name": "Product A",
"description": "Product A description"
"images": [
{
"url": "https://cdn.media.amplience.net/s/willow/079310"
}
]
}

From this you can determine the following JSON path mappings. The values returned by the JSON path evaluator are also shown.

PropertyJSON pathValue
ID/SKU$.id123
Name$.nameProduct A
Description$.descriptionProduct A description
Images$.images[*].urlhttps://cdn.media.amplience.net/s/willow/079310

How to determine non-JSON file feed JSON Paths
Link copied!

All file feeds that are not from a JSON source will be converted to JSON to retrieve the required product data. To determine what the JSON Path mappings need to be you will need to convert your feed to JSON.

Use the output of the conversion tool to determine the JSON paths as explained in How to determine "Products" JSON path and How to determine file feed product property JSON Paths.