What should I enter for the "Product List Key" when setting up a JSON data feed?

In the Data Feed settings, when you select "JSON" for the Format, you'll see an option for Product List Key.

This is only required if your JSON data has a key associated with the main product data.

Example 1:

{
  "status": "success",
  "timestamp": "2023-05-24T10:15:30Z",
  "data": [
    {
      "product_id": "12345",
      "name": "Example Product 1",
      "stock_quantity": 50,
      "price": 19.99,
      "category": "Electronics"
    },
    {
      "product_id": "67890",
      "name": "Example Product 2",
      "stock_quantity": 100,
      "price": 9.99,
      "category": "Home & Kitchen"
    },
    {
      "product_id": "54321",
      "name": "Example Product 3",
      "stock_quantity": 0,
      "price": 29.99,
      "category": "Clothing"
    }
  ]
}

In the above example, the Product List Key is: data

Example 2:

[
  {
    "product_id": "12345",
    "name": "Example Product 1",
    "stock_quantity": 50,
    "price": 19.99,
    "category": "Electronics"
  },
  {
    "product_id": "67890",
    "name": "Example Product 2",
    "stock_quantity": 100,
    "price": 9.99,
    "category": "Home & Kitchen"
  },
  {
    "product_id": "54321",
    "name": "Example Product 3",
    "stock_quantity": 0,
    "price": 29.99,
    "category": "Clothing"
  }
]

The example above displays the list of products directly without any parent key.  So in this case, you would simply leave the Product List Key option blank.

Example 3:

{
  "status": "success",
  "timestamp": "2023-05-24T10:15:30Z",
  "products": [
    {
      "product_id": "12345",
      "name": "Example Product 1",
      "variants": [
        {
          "variant_id": "3392401",
          "color": "Blue",
          "size": "Small",
          "stock_quantity": 10,
          "price": 19.99
        },
        {
          "variant_id": "67890",
          "color": "Red",
          "size": "Medium",
          "stock_quantity": 20,
          "price": 24.99
        },
      ],
      "category": "Clothing"
    },
    {
      "product_id": "67890",
      "name": "Example Product 2",
      "variants": [
        {
          "variant_id": "00123456",
          "color": "Silver",
          "size": "One Size",
          "stock_quantity": 15,
          "price": 14.99
        }
      ],
      "category": "Accessories"
    }
  ]
}

In this example, the Product List Key is: products.variants

Since each product has variants and the quantity is associated with each variant, we'd want to specify here to use products.variants.

When mapping fields to this variants subfield, you'll also need to prefix the field with variants. in the Field Mapping section.  For example, you would use variants.variant_id for the Variant Field and variants.stock_quantiy for the Quantity Field.


App: EZ Inventory

Tags: data feeds, json inventory feed