JavaScript
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.addItems("order_123", { items: [ { variant_id: "variant_123", quantity: 1, }, ], }) .then(({ draft_order_preview }) => { console.log(draft_order_preview) })
200
Add an item to a draft order edit.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
The draft order's ID.
The details of the items to add to a draft order.
The items to add to the draft order.
Show child attributes
OK