customerCancelOrder
Requires a customer (portal or buyer app) session.
Cancel one of the buyer's own sales orders (reason optional). Delegates to OrdersService.cancelSalesOrder — the same invoice/status-transition guards as the admin app's cancel action.
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 CustomerCancelOrder($orderId: ID!) {
customerCancelOrder(orderId: $orderId) {
id
customerPoNumber
orderNumber
status
createdAt
billingAddress
deliverySelection {
carrierName
serviceLevelName
speedName
currency
fee
label
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CustomerCancelOrder($orderId: ID!) {\n customerCancelOrder(orderId: $orderId) {\n id\n customerPoNumber\n orderNumber\n status\n createdAt\n billingAddress\n deliverySelection {\n carrierName\n serviceLevelName\n speedName\n currency\n fee\n label\n }\n }\n}",
"variables": {
"orderId": "id"
}
}
EOF
Variables:
{
"orderId": "id"
}
Response:
{
"data": {
"customerCancelOrder": {
"id": "id",
"customerPoNumber": "string",
"orderNumber": "string",
"status": "string",
"createdAt": "2025-01-15T00:00:00Z",
"billingAddress": "string",
"deliverySelection": {
"carrierName": "string",
"serviceLevelName": "string",
"speedName": "string",
"currency": "string",
"fee": 0,
"label": "string"
}
}
}
}
customerCancelOrder(
orderId: ID!
reason: String
): CustomerOrderDetail!
Arguments
customerCancelOrder.orderId ● ID! non-null scalar
The ID of the order.
customerCancelOrder.reason ● String scalar
Why the order is cancelled.
Type
CustomerOrderDetail object
An order as the customer sees it in full.