reallocateSalesOrder
Requires permission sales:sales_order:allocate.
Release and re-run warehouse allocation for a confirmed order, honoring any manual splits. A shortage never rejects the call; it appears as BACKORDER rows.
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 ReallocateSalesOrder($id: ID!) {
reallocateSalesOrder(id: $id) {
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 ReallocateSalesOrder($id: ID!) {\n reallocateSalesOrder(id: $id) {\n id\n batchNumber\n serialNumber\n createdAt\n baseQuantity\n quantity\n warehouse {\n id\n code\n name\n }\n }\n}",
"variables": {
"id": "id"
}
}
EOF
Variables:
{
"id": "id"
}
Response:
{
"data": {
"reallocateSalesOrder": [
{
"id": "id",
"batchNumber": "string",
"serialNumber": "string",
"createdAt": "2025-01-15T00:00:00Z",
"baseQuantity": 0,
"quantity": 0,
"warehouse": {
"id": "id",
"code": "string",
"name": "string"
}
}
]
}
}
reallocateSalesOrder(
id: ID!
): [SalesOrderItemAllocation!]!
Arguments
reallocateSalesOrder.id ● ID! non-null scalar
The ID of the sales order.
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.