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.
After the mutation, fetch the full shipment via adminShipment(id:) or the REST GET /api/admin/shipments/{id} endpoint.
Prerequisites
The example targets an order with shippable items. If your order has no items with qty_to_ship > 0 (already fully shipped / not yet invoiced) the mutation returns "At least one item with a positive quantity is required." — pick an order with outstanding qty to ship.
Operation
| Operation | Type |
|---|---|
createAdminShipment | Mutation |
Errors
| Condition | Lang key | Message |
|---|---|---|
Order closed | bagistoapi::app.admin.order.actions.shipment.closed | Closed orders cannot be shipped. |
Order fraud | bagistoapi::app.admin.order.actions.shipment.fraud | Fraud orders cannot be shipped. |
| Nothing to ship | bagistoapi::app.admin.order.actions.shipment.nothing-to-ship | There is nothing to ship on this order. |
| No permission | bagistoapi::app.admin.order.actions.shipment.no-permission | You do not have permission to ship orders. |
| Source missing | bagistoapi::app.admin.order.actions.shipment.source-required | Inventory source is required. |
| Items missing | bagistoapi::app.admin.order.actions.shipment.items-required | At least one item with a positive quantity is required. |
| Qty exceeds available | bagistoapi::app.admin.order.actions.shipment.qty-exceeds | Requested quantity (:requested) exceeds available quantity (:available) for SKU :sku. |
| Inventory insufficient | bagistoapi::app.admin.order.actions.shipment.inventory-insufficient | Inventory at the selected source is insufficient for SKU :sku. |
| Save failed | bagistoapi::app.admin.order.actions.shipment.failed | Could not create the shipment. |

