Skip to main content
POST
/
admin
/
orders
/
export
JS SDK
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.order.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

id

The ID of the order to export.

sales_channel_id
string[]

The IDs of the sales channels to export their orders.

A sales channel ID.

region_id

The ID of a region to export orders in it.

customer_id

The ID of a customer to export their orders.

q
string

A search query to filter exported orders by.

created_at
created_at · object

Filter by an order's creation date.

updated_at
updated_at · object

Filter by an order's update date.

limit
number

Limit the number of items returned in the list.

offset
number

The number of items to skip when retrieving a 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 -.

with_deleted
boolean

Whether to include deleted orders in the export.

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.

status

The status of the orders to export.

Available options:
canceled,
completed,
pending,
draft,
archived,
requires_action
$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.

Response

OK

The details of the order 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-orders/:transaction-id