Skip to main content
POST
/
admin
/
products
/
export
JS SDK
import Switchyard from "@switchyard/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.export({})
.then(({ transaction_id }) => {
  console.log(transaction_id)
})
{
"transaction_id": "<string>"
}

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.

tags
object

Filter products by their tags.

variants
object

Filter the products' variants.

title

Filter products by their title.

status

Filter products by their status.

Available options:
draft,
proposed,
published,
rejected
id

Filter products by their ID.

sales_channel_id

Filter products by their sales channel ID.

created_at
object

Filter by a product's creation date.

updated_at
object

Filter by a product's update date.

handle

Filter products by their handle.

is_giftcard
boolean

Filter products by whether they are gift cards. Whether the product is a gift card.

collection_id

Filter products by their collection ID.

type_id

Filter products by their type ID.

deleted_at
object

Filter by a product's deletion date.

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 product's q.

category_id

Filter products by their category ID.

limit
number

Limit the number of items returned in the list.

offset
number

The number of items to skip when retrieving a list.

with_deleted
boolean

The product's with deleted.

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

price_list_id

Filter products by the ID of a price list they belong to.

Response

OK

The details of the product export.

transaction_id
string
required

The ID of the workflow execution's transaction. Use it to check the status of the export by sending a GET request to /admin/workflows-executions/export-products/:transaction-id