POST
/
admin
/
inventory-items
/
location-levels
/
batch
import Medusa from "@medusajs/js-sdk"

export const sdk = new Medusa({
  baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
  debug: import.meta.env.DEV,
  auth: {
    type: "session",
  },
})

sdk.admin.inventoryItem.batchInventoryItemsLocationLevels({
  create: [{
    inventory_item_id: "iitem_123",
    location_id: "sloc_123",
    stocked_quantity: 10
  }],
  delete: ["ilvl_123"]
})
.then(({ created, updated, deleted }) => {
  console.log(created, updated, deleted)
})
{
"created": [
{
"id": "<string>",
"inventory_item_id": "<string>",
"location_id": "<string>",
"stocked_quantity": 123,
"reserved_quantity": 123,
"available_quantity": 123,
"incoming_quantity": 123,
"metadata": {}
}
],
"updated": [
{
"id": "<string>",
"inventory_item_id": "<string>",
"location_id": "<string>",
"stocked_quantity": 123,
"reserved_quantity": 123,
"available_quantity": 123,
"incoming_quantity": 123,
"metadata": {}
}
],
"deleted": [
"<string>"
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The inventory levels to manage.

Response

200
application/json

OK

The result of managing inventory levels.