EZ Inventory Update: JSON Feed Format Now Supported
JSON data feed format is now supported in EZ Inventory!
This allows you to upload a JSON file or use a web feed/REST API endpoint that returns JSON data as a data source when updating the inventory quantity of products/variants in your Shopify store.
The JSON data just needs to have a list of products and you can specify the specific key that contains this data in the app. If the data structure has a variants subfield, our app can support this as well.
Below are a couple of examples of supported data structures.
Example 1: List of Products
{
"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"
}
]
}
Example 2: List of Products with Variants
{
"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"
}
]
}
Our app also supports using formulas for pulling the quantity. So if your feed has a more complex structure for the quantity field, such as a list/array of quantities/stock levels for different warehouse locations, we could also parse this.
For example, the field containing the quantities in your feed may look something like this:
{
"status": "success",
"timestamp": "2023-05-24T10:15:30Z",
"data": [
{
"product_id": "12345",
"name": "Example Product 1",
"stock_levels": [
{
"location": "Warehouse A",
"quantity": 30
},
{
"location": "Warehouse B",
"quantity": 20
}
],
"price": 19.99,
"category": "Electronics"
},
...
}
If you want to use the quantity from the Warehouse B location, you could use a formula like this:
[i.quantity for i in load_json_data({{ stock_levels }}) if i.location == "Warehouse B"][0]
We can help you come up with the formulas as well if you need any assistance with this.
At the time of writing, below are all supported feed/file formats:
- Character-delimited text files such as CSV, TSV, and TXT.
- Excel XLS or XLSX files.
- XML
- JSON
We hope you find this useful!