paymentCancel
Withdraw a payment the shopper abandoned in the provider's component, such as a closed PayPal sheet, and release its cart. Only a payment the provider has not taken money for can be withdrawn; one it already settled answers PAYMENT_IN_PROGRESS.
Arguments
| Argument | Type | Description |
|---|---|---|
target | PaymentTargetInput! | The cart or order the payment was created against |
paymentId | ID! | The payment PaymentSdkAction named |
Returns
| Field | Type | Description |
|---|---|---|
success | Boolean! | Whether the payment was withdrawn and its cart released |
paymentErrors | [PaymentCancelError!] | Error details if the payment could not be withdrawn |
Example
mutation PaymentCancel($target: PaymentTargetInput!, $paymentId: ID!) { paymentCancel(target: $target, paymentId: $paymentId) { success paymentErrors { __typename ... on PaymentError { code message } ... on ValidationError { message } } }}{ "target": { "id": "id-1", "type": "CART" }, "paymentId": "id-1"}{ "data": { "paymentCancel": { "success": true, "paymentErrors": [ { "__typename": "PaymentError", "code": "TARGET_NOT_FOUND", "message": "Example" } ] } }}The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.
Served by
| @evolve-framework/commercetools | Resolved |
| @evolve-framework/medusa | Not resolved |
| @evolve-framework/sfcc | Not resolved |
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/feature-cart:
ExpressPaymentCancel

