Overview
The Cancel Payment Intent endpoint allows you to cancel a pending payment intent before the terminal processes the card payment or the intent expires. Once cancelled, the terminal will be notified and the payment request is withdrawn. Common use cases:- Customer decides not to pay at the terminal
- Order was entered with incorrect amount or details
- User navigates away from the payment screen in your application
- A new payment intent needs to replace an existing one
Authentication
This endpoint requires API key authentication using thex-api-key header.
Cancellation Rules
You can only cancel a payment intent if all of these conditions are met:Status is PENDING
The payment intent must be in
PENDING status. You cannot cancel payment intents that are already CONFIRMED or CANCELLED.If a
terminalCode was provided when creating the payment intent, cancelling it also notifies the terminal that the payment request has been withdrawn.Request Format
POST /payment-intent/{id}/cancel
The unique identifier (UUID) of the payment intent to cancel.
Response Format
The endpoint returns an empty JSON object on success:Examples
Cancel a payment intent
Cancel with error handling
Error Responses
Cannot cancel payment intent - The payment intent is not in
PENDING status.Common reasons:- Payment intent status is
CONFIRMED(already paid) - Payment intent status is
CANCELLED(already cancelled)
Payment intent not found - No payment intent with the specified ID exists in your organization.
Unauthorized - Missing or invalid API key.
What Happens After Cancellation
After a payment intent is successfully cancelled:- Status Change: The status changes from
PENDINGtoCANCELLED - Terminal Notification: The associated terminal (if any) is notified
- Irreversible: The cancellation cannot be undone
- New Intent Required: If payment is still needed, create a new payment intent
Next Steps
Create Payment Intent
Create a new payment intent to replace the cancelled one
API Reference
View the full API reference for the cancel endpoint