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:
- GraphQL
- cURL
mutation SetSalesOrderItemAllocations($input: SetSalesOrderItemAllocationsInput!) {
setSalesOrderItemAllocations(input: $input) {
id
batchNumber
serialNumber
createdAt
baseQuantity
quantity
warehouse {
id
code
name
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SetSalesOrderItemAllocations($input: SetSalesOrderItemAllocationsInput!) {\n setSalesOrderItemAllocations(input: $input) {\n id\n batchNumber\n serialNumber\n createdAt\n baseQuantity\n quantity\n warehouse {\n id\n code\n name\n }\n }\n}",
"variables": {
"input": {
"salesOrderItemId": "id",
"splits": [
{
"quantity": 0,
"warehouseId": "id"
}
]
}
}
}
EOF
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.