cancelMobileOrder
Requires a customer (portal or buyer app) session.
Cancels an order the buyer placed. Delegates to the canonical orders.service.ts cancellation — rejects orders already SHIPPED/DELIVERED/CANCELLED/RETURNED, or with an open invoice (backend returns the exact reason).
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 CancelMobileOrder($orderId: ID!) {
cancelMobileOrder(orderId: $orderId) {
id
orderNumber
paymentNumber
salesRepName
status
addressId
amendment {
canChangeAddress
canChangePaymentMethod
canEditItems
lockReason
paymentMethodLockReason
version
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CancelMobileOrder($orderId: ID!) {\n cancelMobileOrder(orderId: $orderId) {\n id\n orderNumber\n paymentNumber\n salesRepName\n status\n addressId\n amendment {\n canChangeAddress\n canChangePaymentMethod\n canEditItems\n lockReason\n paymentMethodLockReason\n version\n }\n }\n}",
"variables": {
"orderId": "id"
}
}
EOF
Variables:
{
"orderId": "id"
}
Response:
{
"data": {
"cancelMobileOrder": {
"id": "id",
"orderNumber": "string",
"paymentNumber": "string",
"salesRepName": "string",
"status": "AWAITING_PAYMENT",
"addressId": "id",
"amendment": {
"canChangeAddress": true,
"canChangePaymentMethod": true,
"canEditItems": true,
"lockReason": "string",
"paymentMethodLockReason": "string",
"version": 0
}
}
}
}
cancelMobileOrder(
orderId: ID!
reason: String
): MobileOrder!
Arguments
cancelMobileOrder.orderId ● ID! non-null scalar
The ID of the order.
cancelMobileOrder.reason ● String scalar
Why the order is cancelled.
Type
MobileOrder object
Order placed via the mobile BFF. v1 is COD only; persisted in Redis until SalesOrder wiring lands.