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.orderEdit.addItems("order_123", {
items: [
{
variant_id: "variant_123",
quantity: 1
}
]
})
.then(({ order_preview }) => {
console.log(order_preview)
})Add new items to an order edit. These items will have the action ITEM_ADD.
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.orderEdit.addItems("order_123", {
items: [
{
variant_id: "variant_123",
quantity: 1
}
]
})
.then(({ order_preview }) => {
console.log(order_preview)
})Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the order that is being edited.
The details of items to be edited.
The details of items to be edited.
Show child attributes
OK
The preview of an order edit.
A preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
Show child attributes