staffDeliveryOptions
Requires permission sales:sales_order:create.
Returns live delivery options and prices for a draft sales order, before the order exists. Pass the chosen option's ID to createSalesOrder as its delivery option. Without delivery partners on the plan it answers that none are available, and the manual shipping amount stands. The customer must be in the caller's own book. Requires permission to create sales orders.
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 StaffDeliveryOptions($input: StaffDeliveryOptionsInput!) {
staffDeliveryOptions(input: $input) {
code
available
choiceMode
retryable
freightQuote {
boxCount
freightQuoteAboveKg
maxBoxesPerOrder
packedWeightKg
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query StaffDeliveryOptions($input: StaffDeliveryOptionsInput!) {\n staffDeliveryOptions(input: $input) {\n code\n available\n choiceMode\n retryable\n freightQuote {\n boxCount\n freightQuoteAboveKg\n maxBoxesPerOrder\n packedWeightKg\n }\n }\n}",
"variables": {
"input": {
"customerId": "id",
"lines": [
{
"quantity": 0,
"variantId": "id"
}
],
"shippingAddressId": "id"
}
}
}
EOF
Variables:
{
"input": {
"customerId": "id",
"lines": [
{
"quantity": 0,
"variantId": "id"
}
],
"shippingAddressId": "id"
}
}
Response:
{
"data": {
"staffDeliveryOptions": {
"code": "string",
"available": true,
"choiceMode": "AUTO",
"retryable": true,
"freightQuote": {
"boxCount": 0,
"freightQuoteAboveKg": 0,
"maxBoxesPerOrder": 0,
"packedWeightKg": 0
}
}
}
}
staffDeliveryOptions(
input: StaffDeliveryOptionsInput!
): StaffDeliveryOptions!
Arguments
staffDeliveryOptions.input ● StaffDeliveryOptionsInput! non-null input
The customer, shipping address, order lines, and optional currency and warehouse.
Type
StaffDeliveryOptions object
Live delivery options for a staff draft order. available false: the plan has no delivery partners or none is enabled — keep the manual shipping amount.