GET
/
admin
/
products
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.product.list()
.then(({ products, count, limit, offset }) => {
  console.log(products)
})
{
"limit": 123,
"offset": 123,
"count": 123,
"products": [
{}
]
}

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 -.

price_list_id

Filter by a price list's ID to retrieve its associated products.

q
string

Search term to filter a product's searchable properties.

status

Filter by a product status.

sales_channel_id

Filter by a sales channel's ID to retrieve its associated products.

title

Filter by a title.

handle

Filter by a handle.

id

Filter by a product ID.

is_giftcard
boolean

Filter by whether a product is a gift card.

tags
object

Filter by associated tags to retrieve their products.

type_id

Filter by a product type's ID to retrieve its associated products.

category_id

Filter by a product category's ID to retrieve its associated products.

created_at
object

Filter by a product's creation date.

updated_at
object

Filter by a product's update date.

deleted_at
object

Filter by a product's deletion date.

$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.

collection_id

Filter by a product collection ID.

variants
object

Filter the retrieved products' variants.

Response

200
application/json

OK

The paginated list of products.