Skip to main content

Cancel a payment

Find out how to cancel a payment intent that hasn't yet been authorized.

Payment intents can be canceled if they are no longer needed — for instance, if the card issuer declines authorization. Note that cancellation is only possible while the intent is in the Created status

Cancel using the Dojo API

To cancel a payment to your customer, use the endpoint below:

DELETE /payment-intents/{paymentIntentId}

In your request, include:

  • paymentIntentId: identifies the payment being canceled.

For the full specification, see the API reference.

Request example

The next example shows how to cancel a payment intent.

manage-payments/curl/cancel.sh
loading...

Response example

If your request is successful, the response will return information about the canceled payment, and the status will be Canceled.

{
"id": "pi_sandbox_RBMHTJ4fIkmSppDILZVCGw",
"captureMode": "Auto",
"status": "Canceled",
"paymentMethods": [
"Card"
],
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"totalAmount": {
"value": 1000,
"currencyCode": "GBP"
},
"createdAt": "2022-02-21T14:39:21.6050276Z",
"updatedAt": "2022-02-21T14:39:21.6050277Z"
}