cancelPaymentCheckout
Requires a customer (portal or buyer app) session.
Abandon an online checkout the buyer backed out of: verifies the session with the PSP (a session that turns out PAID is captured normally and reported with paid: true, never cancelled), best-effort voids the hosted link, then cancels the AWAITING_PAYMENT order. Idempotent — an order already terminal returns its current state.
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 CancelPaymentCheckout($orderId: ID!) {
cancelPaymentCheckout(orderId: $orderId) {
cancelled
orderId
orderStatus
paid
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CancelPaymentCheckout($orderId: ID!) {\n cancelPaymentCheckout(orderId: $orderId) {\n cancelled\n orderId\n orderStatus\n paid\n }\n}",
"variables": {
"orderId": "id"
}
}
EOF
Variables:
{
"orderId": "id"
}
Response:
{
"data": {
"cancelPaymentCheckout": {
"cancelled": true,
"orderId": "id",
"orderStatus": "string",
"paid": true
}
}
}
cancelPaymentCheckout(
orderId: ID!
): MobileCancelCheckout!
Arguments
cancelPaymentCheckout.orderId ● ID! non-null scalar
The ID of the order.
Type
MobileCancelCheckout object
Result of cancelPaymentCheckout: what happened to the abandoned checkout. paid: true means the PSP reported the session SUCCEEDED after all — the order was NOT cancelled and the client must route to the success screen.