XM
Members
Upload Inventory
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
POST https://{baseurl}/inventory/bulk-insert
Copied!
Enables you to maintain your inventory up-to-date by facilitating bulk add or update action to the inventory. You may add one or multiple items to the inventory or update one or multiple existing items in the inventory. To check the current stock of items, the Retrieve Inventory for Multiple Items API is recommended. And, to check stock level of a single item, the Retrieve Inventory of Single Item API is recommended."

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: The item details to be added/updated to the inventory.
Required: true

Sample Request

1
[
2
{
3
"sku": "123456",
4
"totalQuantity": 30003,
5
"reservedQuantity":0,
6
"locationId": 104,
7
"type": "Stock",
8
"channelId": 12
9
},
10
11
{
12
"itemId": "1000000213",
13
"totalQuantity": 10000,
14
"reservedQuantity":0,
15
"locationId": 104,
16
"type": "Transit",
17
"channelId": 12,
18
"transitOrderDate": "2020-05-05",
19
"transitStockDate": "2020-05-05",
20
"transitRef": "WO-20000"
21
}
22
]
Copied!

SampleResponse

Response Code: 200
Message: OK
Description: You will see this message when the inventory is successfully updated.
1
{
2
"_id": "5fa087827899ae0007ce1ff0",
3
"messages": [
4
"Import Inventory job started: Mon Nov 02 2020 22:26:10 GMT+0000 (Coordinated Universal Time)",
5
"2 row(s) found",
6
"1 Inventory Item(s) found",
7
"Successfully saved 1 items ",
8
"Successfully finished API Inventory Bulk Upload: Mon Nov 02 2020 22:26:10 GMT+0000 (Coordinated Universal Time)"
9
],
10
"keyId": "api-1604355970096",
11
"type": "api",
12
"status": "FINISHED",
13
"totalItems": 1,
14
"totalItemsUploaded": 1,
15
"totalRows": 2,
16
"totalRowsErrors": 0,
17
"createdAt": "2020-11-02T22:26:10.175Z",
18
"updatedAt": "2020-11-02T22:26:10.448Z",
19
"__v": 0
20
}
Copied!
Response Code: 400
Message: Bad Request
Description: You will see this message when the location ID doesn't exist in the system.
Sample
1
{
2
"code": "INVENTORY_INSERT_FAILED",
3
"message": "Inventory insert failed: Row 1: Cannot find \"Location Id\" 999."
4
}
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 1mo ago
Copy link
Contents
Change Log