> ## Documentation Index
> Fetch the complete documentation index at: https://developer.jtl-software.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateSalesOrderDeliveryCommandRequestInput

> Delivers a sales order: reserves the stock, posts the stock outflow and creates the delivery notes with their packages in one transaction. Without 'lineItems' all open quantities are delivered; with 'lineItems' only the given quantities (a partial delivery). When 'allowPartialDelivery' is false (the default), an order that cannot be delivered completely is refused; when it is true, what is in stock is delivered. Stock is taken from 'warehouseIds' in the given order, or from all warehouses that deliver by their delivery priority. Drop-shipping and fulfillment line items get their own delivery notes, and 'oneDeliveryNotePerWarehouse' splits the rest per warehouse. Without 'packages' every delivery note gets one package with the shipping method of the sales order. A package with 'shippedAt' is created as shipped, 'markAsShipped' marks all new packages of own warehouses as shipped now, and 'createShippingLabels' requests a label for every new package whose shipping method is mapped to a shipping service (see CreatePackageShippingLabel). A label that fails does not undo the delivery: its result is in 'shippingLabelResults'. Invoices are not created by this call. A refused action reports 'errorCode' (the main reason) and 'blockers' (all reasons, each with 'code' and 'message'). errorCode is one of: SALES_ORDER_NOT_FOUND (the sales order was not found); SALES_ORDER_LINE_ITEM_NOT_FOUND (a line item does not belong to the sales order); SALES_ORDER_LINE_ITEM_REFERENCED_TWICE (a line item is given twice); CLIENT_ID_NOT_UNIQUE (two packages carry the same client identifier); QUANTITY_EXCEEDS_OPEN_QUANTITY (a quantity is larger than the open quantity of its line item); SERIAL_NUMBERS_INVALID (serial numbers are missing, too few, unknown or given for an item without serial numbers); WAREHOUSE_NOT_FOUND (a given warehouse was not found or does not deliver); SHIPPING_METHOD_NOT_FOUND (a referenced shipping method was not found or is not active); TRACKING_NUMBER_INVALID (the tracking number is empty, longer than 255 characters or does not match the rule of the shipping method); SHIPPING_DATE_OUT_OF_RANGE (the shipping date is outside the supported range); SHIPPING_METHOD_MISSING (a package or the sales order has no shipping method); SALES_ORDER_ALREADY_DELIVERED (the sales order has no open quantity); SALES_ORDER_BLOCKED (the sales order is on hold, not paid, its customer is blocked or shipping is locked; the blockers name the reasons); SALES_ORDER_NOT_FULLY_DELIVERABLE (the order cannot be delivered completely and partial delivery is not allowed); NO_ELIGIBLE_WAREHOUSE (no warehouse can deliver the sales order); DELIVERY_NOT_COMPLETED (the delivery failed and was rolled back). - Request



**Kind**: `input`

## Fields

**`salesOrderId`**: `ID!` (required)

The ID of the sales order.

---

**`lineItems`**: `[DeliveryLineItemInput]`

The line items and quantities to deliver. Omit to deliver all open quantities. Every sales order line item at most once.

---

**`allowPartialDelivery`**: `Boolean`

Whether what is in stock is delivered when the order cannot be delivered completely. Defaults to false.

---

**`warehouseIds`**: `[ID]`

The warehouses to take the stock from, in this order. Defaults to all warehouses that deliver, by their delivery priority.

---

**`oneDeliveryNotePerWarehouse`**: `Boolean`

Whether one delivery note per warehouse is created instead of one per sales order. Defaults to false.

---

**`packages`**: `[DeliveryPackageInput]`

The packages. Omit for one package per delivery note with the shipping method of the sales order.

---

**`markAsShipped`**: `Boolean`

Whether all new packages of own warehouses are marked as shipped now, which completes the shipping (see MarkPackageShipped). Defaults to false.

---

**`createShippingLabels`**: `Boolean`

Whether a label is requested for every new package whose shipping method is mapped to a shipping service. Defaults to false.

---

**`disableAutomaticWorkflows`**: `Boolean`

Suppresses the automatic workflow triggers of this call. Defaults to false when omitted.

---

**`idempotencyKey`**: `String`

Client-supplied idempotency key. When provided, a repeated request with the same key and payload replays the original result instead of re-executing the mutation.

