Skip to main content

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:

mutation CustomerCancelOrder($orderId: ID!) {
customerCancelOrder(orderId: $orderId) {
id
customerPoNumber
orderNumber
status
createdAt
billingAddress
deliverySelection {
carrierName
serviceLevelName
speedName
currency
fee
label
}
}
}

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.