XM

Inventory - Bulk Insert

Path:

POST /inventory/bulk-insert

Through this endpoint, we enable you to easily update your inventory, in bulk.

Headers

x-site-context:"accountid":"5ecc2162660df800074c232f"

Consumes

  • application/json

Produces

  • application/json

Parameters

Type: body

Name: Item details

Required: true

Sample Request

[
{
"sku": "1597422",
"totalQuantity": 30,
"reservedQuantity": 5,
"locationId": 175,
"type": "Stock",
"channelId": 12
},
{
"sku": "1597422",
"totalQuantity": 100,
"reservedQuantity": 5,
"locationId": 179,
"type": "Stock",
"channelId": 12
}
]

Response

Response Code: 200

Message: OK

Description: You will see this message when the inventory is successfully updated.

Sample

{
"_id": "5f11b4c886d5fa0008af5e12",
"messages": [
"Import Inventory job started: Fri Jul 17 2020 14:25:12 GMT+0000 (Coordinated Universal Time)",
"2 row(s) found",
"1 Inventory Item(s) found",
"Successfully saved 1 items ",
"Successfully finished API Inventory Bulk Upload: Fri Jul 17 2020 14:25:12 GMT+0000 (Coordinated Universal Time)"
],
"keyId": "api-1594995912406",
"type": "api",
"status": "FINISHED",
"totalItems": 1,
"totalItemsUploaded": 1,
"totalRows": 2,
"totalRowsErrors": 0,
"createdAt": "2020-07-17T14:25:12.493Z",
"updatedAt": "2020-07-17T14:25:12.692Z",
"__v": 0
}

Response Code: 400

Message: Bad Request

Description: You will see this message when the SKU number is incorrect.

Sample

{
"code": "INVENTORY_INSERT_FAILED",
"message": "Inventory insert failed: Row 1: Cannot find \"sku\" 1597422A."
}

Response Code: 400

Message: Bad Request

Description: You will see this message when the "Location ID" is incorrect.

Sample

{
"code": "INVENTORY_INSERT_FAILED",
"message": "Inventory insert failed: Row 1: Cannot find \"Location Id\" 106."
}

Changelog

  • Last updated - July 2020