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.draftOrder.retrieve("order_123")
.then(({ draft_order }) => {
console.log(draft_order)
})Retrieve a draft order by its ID. You can expand the draft order’s relations or select the fields that should be returned using the query parameters.
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.draftOrder.retrieve("order_123")
.then(({ draft_order }) => {
console.log(draft_order)
})Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The draft order's ID.
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.
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.
OK
The draft order's details.
The draft order's details.
Show child attributes