Get global inventory status
GET
/inventory/list.json
GET
/inventory/list.json
$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/inventory/list.json');
[
{
"sku": "a58",
"uid": 49532,
"quantity": 0,
"unlimited": false,
"has_child": true,
"childs": [
{
"sku": "0000125452",
"quantity": 1005,
"superkey": "40"
},
{
"sku": "0000125453",
"quantity": 1005,
"superkey": "42"
}
]
},
...
{
"sku": "79",
"uid": 49649,
"quantity": null,
"unlimited": false,
"has_child": false
}
]
PUT
/inventory/inventory.json
sku required (string) | Unique id of your post |
quantity required (int) | |
is_child (int) | Accept 1 or 0 as value. If the specified SKU is a product-variant SKu, you must set this field to 1. |
unlimited (int) 0|1 | Only applicable on main product, not on variants. Accept 1 or 0 as value. 1 => Unlimited sell, 0 => selle stock quantities. |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['sku'] = '0000125452';
$payload['quantity'] = 1005;
$payload['is_child'] = 1;
$result = $storeden->put('/inventory/inventory.json', $payload);
{
"is_child": true,
"inventory_updated": 1,
"err": null
}
Send product quantity update to add to product stock quantity
PUT
/inventory/patchInventory.json
sku required (string) | Unique id of your post |
quantity required (int) | |
is_child (int) | Accept 1 or 0 as value. If the specified SKU is a product-variant SKu, you must set this field to 1. |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['sku'] = '0000125452';
$payload['quantity'] = 5;
$payload['is_child'] = 1;
$result = $storeden->put('/inventory/patchInventory.json', $payload);
{
"is_child": true,
"inventory_updated": 1,
"err": null
}
Send bulk update to inventory. Max 250 SKU at time
PUT
/inventory/batchInventory.json
stage[$sku][quantity] required (int) | $sku must be replaced by your item SKU |
stage[$sku][is_child] required (0|1) | Accept 1 or 0 as value. If the specified SKU is a product-variant SKu, you must set this field to 1. |
$storeden = new Storeden\Storeden($config);
$batch = array();
$batch['stage']['Uii']['quantity'] = 19;
$batch['stage']['Uii']['is_child'] = 0;
$batch['stage']['Jok']['quantity'] = 29;
$batch['stage']['Jok']['is_child'] = 0;
$batch['stage']['Kj']['quantity'] = 10000;
$batch['stage']['Kj']['is_child'] = 0;
$_response = $sdk->put('/inventory/batchInventory.json', $batch);
{
"batchId": "e2d09ce2-f80c-4270-9bfb-98ed94972ec0",
"responses": {
"Uii": {
"is_child": false,
"inventory_updated": 0,
"err": null
},
"Jok": {
"is_child": true,
"inventory_updated": 1,
"err": null
},
"Kj": {
"is_child": true,
"inventory_updated": 1,
"err": null
}
}
}