> ## 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.

# CreateSalesInvoiceFromSalesOrderLineItemsCommandRequestInput

> Creates a partial invoice for selected line items of one sales order. The open quantity of each selected line item is invoiced; a quantity cannot be chosen. Without 'asDraft' the invoice is finalized at once and gets its number. A refusal carries 'blockers' with all reasons, each with a code and a message. Errors: errorCode is SALES_ORDER_NOT_FOUND (no sales order with this ID); errorCode is SALES_ORDER_LINE_ITEM_NOT_FOUND (a line item does not exist or does not belong to the sales order); errorCode is SALES_ORDER_NOT_INVOICEABLE (the order cannot be invoiced; the blockers say why, for example SALES_ORDER_FULLY_INVOICED, NO_OPEN_LINE_ITEMS, NOTHING_DELIVERED, SALES_ORDER_CANCELLED, SALES_ORDER_ARCHIVED, NOT_A_SALES_ORDER, SALES_ORDER_PENDING, SALES_ORDER_STATUS_INVALID, SALES_ORDER_EXTERNALLY_INVOICED, DUPLICATE_OF_INVOICE, SALES_ORDER_READ_ONLY, INVALID_KIT_OR_CONFIGURATION, CUSTOMER_MISSING, BILLING_ADDRESS_MISSING, SHIPMENT_ADDRESS_MISSING, PAYMENT_METHOD_MISSING, SHIPPING_METHOD_MISSING or TAX_SETTING_MISSING). - Request



**Kind**: `input`

## Fields

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

The ID of the sales order.

---

**`salesOrderLineItemIds`**: `[ID]!` (required)

The line items of the sales order to invoice, at least 1, each at most once. They select what one new invoice contains; this is not a batch.

---

**`invoiceOnlyDeliveredQuantity`**: `Boolean`

Whether only the delivered quantities are invoiced for item, free, voucher and gift line items. Defaults to false: all open quantities are invoiced.

---

**`asDraft`**: `Boolean`

Whether the invoice is created as a draft: without a number, editable and not binding until it is finalized. Defaults to false: the invoice is finalized at once and gets its number.

---

**`clientId`**: `String`

A temporary ID chosen by the client. It is not stored and is returned unchanged.

---

**`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.

