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.createShipment(
"order_123",
"ful_123",
{
items: [
{
id: "fulit_123",
quantity: 1
}
]
}
)
.then(({ order }) => {
console.log(order)
})Create a shipment for an order’s fulfillment.
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.createShipment(
"order_123",
"ful_123",
{
items: [
{
id: "fulit_123",
quantity: 1
}
]
}
)
.then(({ order }) => {
console.log(order)
})Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
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 shipment's details.
The items to create shipment for.
Show child attributes
The shipment's metadata. Can hold custom key-value pairs.
The labels to create for the shipment.
Show child attributes
Whether to send the customer a notification about the created shipment.
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