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.updateShippingMethod("order_123", "sm_123", {
shipping_option_id: "so_123",
})
.then(({ draft_order_preview }) => {
console.log(draft_order_preview)
})
This response does not have an example.
Update an existing shipping method in a draft order edit.
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.updateShippingMethod("order_123", "sm_123", {
shipping_option_id: "so_123",
})
.then(({ draft_order_preview }) => {
console.log(draft_order_preview)
})
This response does not have an example.
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
The draft order's ID.
The ID of the shipping method.
The updates to make on a draft order's shipping method.
OK