XM
Powered By GitBook
Retrieve Inventory of Multiple Items
Path:
1
POST https://{baseurl}/api-inventory/inventory
Copied!
You may need to take stock of items at regular interval and this API retrieves real-time stock information of the requested items. In the response, when the value of the inStock field is true, details of all the locations are listed where the requested item is in stock. If the requested item does not exist in the system or the requested quantity is not available, the inStock field returns false in the success response to indicate the item is not availale for sale.

Headers

Content-Type : application/json
x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }
Parameters
Type: Body
Name: Item details (itemId and quantity) and channel ID.
Required: true

Sample Request -1

1
{
2
"items": [{
3
"itemId":"1000000003",
4
"quantity":4
5
}
6
],
7
"channelId":"12"
8
}
Copied!

Sample Response -1

Response Code: 200
Message: OK
Description: You will see this message when the inventory details are successfully retrieved for the specified items.
1
[
2
{
3
"itemId": 1000000003,
4
"quantityRequested": 4,
5
"stockDate": null,
6
"inStock": true,
7
"fromStockQuantity": 4,
8
"fromStock": [
9
{
10
"locationId": "5efcc26a5ee50d00079ca2ab",
11
"quantityReserved": 0,
12
"quantityAllocated": 9,
13
"stockRemaining": 9,
14
"stockRequest": 4,
15
"channelId": 12
16
}
17
],
18
"fromTransitQuantity": 0,
19
"fromTransit": [],
20
"availableStockQuantity": 9,
21
"availableTransitQuantity": 0,
22
"availableTotal": 9
23
}
24
]
Copied!

Sample Request -2

1
{
2
"items": [
3
{
4
"itemId": "1000000033",
5
"quantity": 10000000
6
},
7
{
8
"itemId": "1000000050",
9
"quantity": 30000
10
}
11
],
12
"channelId": "12"
13
}
Copied!

Sample Response -2

Response Code: 200
Message: OK
Description: You will see this message when the inventory details (with multiple locations) are successfully retrieved for the specified items.
1
[
2
{
3
"itemId": 1000000033,
4
"quantityRequested": 10000000,
5
"stockDate": null,
6
"inStock": false,
7
"fromStockQuantity": 10000,
8
"fromStock": [
9
{
10
"locationId": "60a6e451d5748b0008ac85a0",
11
"quantityReserved": 0,
12
"quantityAllocated": 10000,
13
"stockRemaining": 10000,
14
"stockRequest": 10000,
15
"channelId": 12
16
}
17
],
18
"fromTransitQuantity": 0,
19
"fromTransit": [],
20
"availableStockQuantity": 10000,
21
"availableTransitQuantity": 0,
22
"availableTotal": 10000
23
},
24
{
25
"itemId": 1000000050,
26
"quantityRequested": 30000,
27
"stockDate": null,
28
"inStock": true,
29
"fromStockQuantity": 30000,
30
"fromStock": [
31
{
32
"locationId": "60a5849fea4dcb00082ba853",
33
"quantityReserved": 58,
34
"quantityAllocated": 10000,
35
"stockRemaining": 9942,
36
"stockRequest": 9942,
37
"channelId": 12
38
},
39
{
40
"locationId": "60a6bc40a1a8a70008bf9b39",
41
"quantityReserved": 0,
42
"quantityAllocated": 10000,
43
"stockRemaining": 10000,
44
"stockRequest": 10000,
45
"channelId": 12
46
},
47
{
48
"locationId": "60a6e23ca02bd20008849641",
49
"quantityReserved": 0,
50
"quantityAllocated": 10000,
51
"stockRemaining": 10000,
52
"stockRequest": 10000,
53
"channelId": 12
54
},
55
{
56
"locationId": "60a6e451d5748b0008ac85a0",
57
"quantityReserved": 1,
58
"quantityAllocated": 10000,
59
"stockRemaining": 9999,
60
"stockRequest": 58,
61
"channelId": 12
62
}
63
],
64
"fromTransitQuantity": 0,
65
"fromTransit": [],
66
"availableStockQuantity": 49884,
67
"availableTransitQuantity": 0,
68
"availableTotal": 49884
69
}
70
]
Copied!
Error Code: 500
Message: Internal Server Error
Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

Change Log

    June - 2021
    July - 2020 First updated
Last modified 2mo ago
Copy link
Contents
Change Log