Skip to main content

createExternalShipment

Requires permission sales:shipment:create.

Record a shipment an installed shipping app booked with its carrier. When none of the lines has shipped, the order ships through its own ship command (stock issues once, the order status moves, ship-after-invoice applies); this also needs sales:sales_order:ship. When all of them shipped already, only the booking is recorded and no stock moves. A request mixing the two is refused. No price is ever sent. Needs write_fulfillments.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateExternalShipment($input: AppCreateExternalShipmentInput!) {
createExternalShipment(input: $input) {
id
orderNumber
returnNumber
shipmentNumber
trackingNumber
carrierName
}
}

Variables:

{
"input": {
"items": [
{
"quantity": 0,
"salesOrderItemId": "id"
}
],
"salesOrderId": "id",
"trackingNumber": "string"
}
}

Response:

{
"data": {
"createExternalShipment": {
"id": "id",
"orderNumber": "string",
"returnNumber": "string",
"shipmentNumber": "string",
"trackingNumber": "string",
"carrierName": "string"
}
}
}
createExternalShipment(
input: AppCreateExternalShipmentInput!
): ShipmentListRow!

Arguments​

createExternalShipment.input ● AppCreateExternalShipmentInput! non-null input​

The shipment.

Type​

ShipmentListRow object​

One row of the shipments list.