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.removeAddedItem(
"order_123",
"orli_123",
)
.then(({ order_preview }) => {
console.log(order_preview)
})Remove an added item in the order edit by the ID of the item’s ITEM_ADD action.
Every item has an actions property, whose value is an array of actions. You can check the action’s name using its action property, and use the value of the id property.
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.removeAddedItem(
"order_123",
"orli_123",
)
.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 ID of the new item's ITEM_ADD action.
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