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.

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

OperationType
createAdminShipmentMutation

Errors

ConditionLang keyMessage
Order closedbagistoapi::app.admin.order.actions.shipment.closedClosed orders cannot be shipped.
Order fraudbagistoapi::app.admin.order.actions.shipment.fraudFraud orders cannot be shipped.
Nothing to shipbagistoapi::app.admin.order.actions.shipment.nothing-to-shipThere is nothing to ship on this order.
No permissionbagistoapi::app.admin.order.actions.shipment.no-permissionYou do not have permission to ship orders.
Source missingbagistoapi::app.admin.order.actions.shipment.source-requiredInventory source is required.
Items missingbagistoapi::app.admin.order.actions.shipment.items-requiredAt least one item with a positive quantity is required.
Qty exceeds availablebagistoapi::app.admin.order.actions.shipment.qty-exceedsRequested quantity (:requested) exceeds available quantity (:available) for SKU :sku.
Inventory insufficientbagistoapi::app.admin.order.actions.shipment.inventory-insufficientInventory at the selected source is insufficient for SKU :sku.
Save failedbagistoapi::app.admin.order.actions.shipment.failedCould not create the shipment.

Released under the MIT License.