Skip to content

Create Shipment

Ships one or more order items from a chosen inventory source. The same eligibility checks as the admin Shipment screen apply (the order must not be closed or marked fraud). Each item's requested quantity is validated against its still-shippable quantity, qty_to_ship, AND against the inventory available at the chosen source before the shipment is created.

For composite products (bundle, configurable, grouped), the requested quantity is split across the line's component items, and each component's own shippable quantity and stock at the chosen source are validated — so a shipment can't be created for more component stock than is physically available.

Endpoint

EndpointMethod
/api/admin/orders/{orderId}/shipmentsPOST

Request body

FieldTypeRequiredNotes
sourceintegeryesInventory source id all items ship from.
itemsarray of { orderItemId, inventorySourceId, quantity }yesAt least one entry with quantity > 0.
carrierTitlestringnoFree-form carrier label (e.g. UPS).
trackNumberstringnoTracking number.

Errors

HTTPLang keyMessage
422bagistoapi::app.admin.order.actions.shipment.closedClosed orders cannot be shipped.
422bagistoapi::app.admin.order.actions.shipment.fraudFraud orders cannot be shipped.
422bagistoapi::app.admin.order.actions.shipment.nothing-to-shipThere is nothing to ship on this order.
422bagistoapi::app.admin.order.actions.shipment.no-permissionYou do not have permission to ship orders.
422bagistoapi::app.admin.order.actions.shipment.source-requiredInventory source is required.
422bagistoapi::app.admin.order.actions.shipment.items-requiredAt least one item with a positive quantity is required.
422bagistoapi::app.admin.order.actions.shipment.qty-exceedsRequested quantity (:requested) exceeds available quantity (:available) for SKU :sku.
422bagistoapi::app.admin.order.actions.shipment.inventory-insufficientInventory at the selected source is insufficient for SKU :sku.
422bagistoapi::app.admin.order.actions.shipment.failedCould not create the shipment.

Sample 422 response

json
{
    "type": "/errors/422",
    "title": "Bad Request",
    "status": 422,
    "detail": "Inventory at the selected source is insufficient for SKU WS-12-S."
}

Released under the MIT License.