Skip to main content

setSalesOrderItemAllocations

Requires permission sales:sales_order:allocate.

Set the warehouse split for one order line. The split quantities must add up to the line quantity and every warehouse must be active. The split is honored at confirmation and reallocation.

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 SetSalesOrderItemAllocations($input: SetSalesOrderItemAllocationsInput!) {
setSalesOrderItemAllocations(input: $input) {
id
batchNumber
serialNumber
createdAt
baseQuantity
quantity
warehouse {
id
code
name
}
}
}

Variables:

{
"input": {
"salesOrderItemId": "id",
"splits": [
{
"quantity": 0,
"warehouseId": "id"
}
]
}
}

Response:

{
"data": {
"setSalesOrderItemAllocations": [
{
"id": "id",
"batchNumber": "string",
"serialNumber": "string",
"createdAt": "2025-01-15T00:00:00Z",
"baseQuantity": 0,
"quantity": 0,
"warehouse": {
"id": "id",
"code": "string",
"name": "string"
}
}
]
}
}
setSalesOrderItemAllocations(
input: SetSalesOrderItemAllocationsInput!
): [SalesOrderItemAllocation!]!

Arguments​

setSalesOrderItemAllocations.input ● SetSalesOrderItemAllocationsInput! non-null input​

The order line and its warehouse split.

Type​

SalesOrderItemAllocation object​

The part of a sales order line that is filled from one warehouse. The quantities of a line's allocations add up to the line.