Skip to main content

Cancel Payments

There may be scenarios in which you need to cancel a payment, such as a customer placing a payment by mistake or an authorized payment that needs to be voided before settlement.

Both Payment Intents and the direct Payments API support cancellation. A succeeded payment cannot be canceled — use the refund flow instead.

Before you start​

Credova account
Sign up or sign in to the Credova Portal.
Secret Key
Authenticates requests from your server. Never send it to the browser.

Cancel a Payment​

Cancel with either Payment Intents or the direct Payments API. Select the tab for the API you use.

A Payment Intent can be canceled from any non-terminal status: requires_payment_method, requires_confirmation, or requires_capture. It cannot be canceled once it has succeeded.

Cancel the Payment Intent​

Call the Cancel Payment Intent endpoint with the intent ID:

Cancel a Payment Intent
curl 'https://api.publicsquare.com/payment_intents/pmt_int_2xNjK7abcdefghij/cancel' \
-X 'POST' \
-H 'X-API-KEY: <SECRET_API_KEY>' \
-H 'Content-Type: application/json'

You should see a response with status: canceled:

Canceled Payment Intent
{
"id": "pmt_int_2xNjK7abcdefghij",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "test",
"status": "canceled",
"amount": 1000,
"currency": "USD",
"cancellation_reason": "requested",
"canceled_date": "2026-04-15T15:10:00Z",
"payment_id": null,
"created_date": "2026-04-15T14:22:10Z",
"modified_date": "2026-04-15T15:10:00Z"
}

Handling Cancellation Errors​

If you attempt to cancel an intent that is already canceled, you will receive a 409 Conflict:

Already Canceled
{
"error": {
"code": "payment_intent_already_canceled",
"message": "This PaymentIntent has already been canceled."
}
}

If a confirm is currently in progress, cancellation will be rejected until the confirm completes. Retry the cancel once the intent transitions out of processing:

Confirm In Progress
{
"error": {
"code": "payment_intent_confirm_in_progress",
"message": "A confirm is currently in progress. Please try again shortly."
}
}

Conclusion​

This guide showed you how to cancel a payment. You can also follow our refund payment guide which will attempt to cancel the payment and fallback to issuing a refund.

Follow these guides to learn more: