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.order.createFulfillment("order_123", {
items: [
{
id: "orli_123",
quantity: 1
}
]
})
.then(({ order }) => {
console.log(order)
})Create a fulfillment for an order. The creation fails if the order is canceled.
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.order.createFulfillment("order_123", {
items: [
{
id: "orli_123",
quantity: 1
}
]
})
.then(({ order }) => {
console.log(order)
})Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The 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.
The fulfillment's details.
The items to fulfill.
Show child attributes
The ID of the location to fulfill the items from. If not provided, the location associated with the shipping option of the order's shipping method is used.
The order's metadata. Can hold custom key-value pairs.
Whether to send the customer a notification about the created fulfillment.
Pass additional custom data to the API route. This data is passed to the underlying workflow under the additional_data parameter.
OK
An order's details.
The order's details.
Show child attributes