salesOrderAllocationPlan
Requires at least one of the permissions sales:sales_order:allocate or sales:sales_order:read.
Where Confirm would take each sales order line's stock from if the order were confirmed now, including stock it would take from a warehouse other than the one the line names. Nothing is reserved. Needs the sales order read or allocate permission.
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
query SalesOrderAllocationPlan($input: SalesOrderAllocationPlanInput!) {
salesOrderAllocationPlan(input: $input) {
key
lineWarehouseId
source
switchedQuantity
lineWarehouse {
id
code
name
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query SalesOrderAllocationPlan($input: SalesOrderAllocationPlanInput!) {\n salesOrderAllocationPlan(input: $input) {\n key\n lineWarehouseId\n source\n switchedQuantity\n lineWarehouse {\n id\n code\n name\n }\n }\n}",
"variables": {
"input": {
"lines": [
{
"key": "string",
"productId": "id",
"quantity": 0
}
]
}
}
}
EOF
Variables:
{
"input": {
"lines": [
{
"key": "string",
"productId": "id",
"quantity": 0
}
]
}
}
Response:
{
"data": {
"salesOrderAllocationPlan": [
{
"key": "string",
"lineWarehouseId": "id",
"source": "AUTO",
"switchedQuantity": 0,
"lineWarehouse": {
"id": "id",
"code": "string",
"name": "string"
}
}
]
}
}
salesOrderAllocationPlan(
input: SalesOrderAllocationPlanInput!
): [SalesOrderLineAllocationPlan!]!
Arguments
salesOrderAllocationPlan.input ● SalesOrderAllocationPlanInput! non-null input
The order lines and the customer.
Type
SalesOrderLineAllocationPlan object
Where Confirm would take one sales order line's stock from, if the order were confirmed now. Nothing is reserved.