GET
/
admin
/
inventory-items
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.list()
.then(({ inventory_items, count, limit, offset }) => {
  console.log(inventory_items)
})
{
"limit": 123,
"offset": 123,
"count": 123,
"inventory_items": [
{
"id": "<string>",
"sku": "<string>",
"origin_country": "<string>",
"hs_code": "<string>",
"requires_shipping": true,
"mid_code": "<string>",
"material": "<string>",
"weight": 123,
"length": 123,
"height": 123,
"width": 123,
"title": "<string>",
"description": "<string>",
"thumbnail": "<string>",
"metadata": {},
"location_levels": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"inventory_item_id": "<string>",
"location_id": "<string>",
"stocked_quantity": 123,
"reserved_quantity": 123,
"incoming_quantity": 123,
"metadata": {},
"inventory_item": {},
"available_quantity": 123
}
]
}
]
}

Authorizations

Authorization
string
header
required

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

Query Parameters

fields
string

Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

offset
number

The number of items to skip when retrieving a list.

limit
number

Limit the number of items returned in the list.

order
string

The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.

q
string

The inventory item's q.

id

The inventory item's ID.

sku

The inventory item's sku.

origin_country

The inventory item's origin country.

mid_code

The inventory item's mid code.

hs_code

The inventory item's hs code.

material

The inventory item's material.

requires_shipping
boolean

The inventory item's requires shipping.

weight
object

Filter the inventory item's weight.

length
object

Filter the inventory item's length.

height
object

Filter by the inventory item's height.

width
object

Filter by the inventory item's width.

location_levels
object

Filter by the inventory item's associated location IDs.

$and
$and · object[]

Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.

$or
$or · object[]

Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.

with_deleted
boolean

Whether to include deleted records in the result.

Response

200
application/json

OK

The paginated list of inventory items.