JSON

JSON is a data format commonly used by APIs.

Products List Path

The key information that Stockeo needs to know is where the list of products is located in a JSON structure.

Top level array - empty path

Very often the list of products is at the top level. You can recognize it by the fact that the JSON starts and ends with square brackets [ ].

[{
    "sku": "E0001",
    "qty": 12,
},{
   "sku": "E0002",
   "qty": 23,
}, ... ]

In such a case you can leave the Products List Path empty.

Object property

Sometime the list is placed under an object property. Then you need to specify the property name in the Products List Path.

{
    "total_count": 7532,
    "items": [{
            "sku": "E0001",
            "qty": 12,
        },{
           "sku": "E0002",
           "qty": 23,
        }, 
        ... 
     ]
}

For the example above, the Products List Path should be items.

Nested path

Rarely, the list of products may be nested within an inner object that involves traversing multiple levels of objects to reach the desired data. In such a case you need to specify the full path, that is, a list of properties separated by dots, without any spaces between them.

{
    "status": "success",
    "data": {
        "count": 7532
        "items": [{
                "sku": "E0001",
                "qty": 12,
            },{
               "sku": "E0002",
               "qty": 23,
            }, 
            ... 
        ]
    }
}

For the example above, the Products List Path should be data.items.

Last updated