Want to cancel an authorized payment?
If you are using delayed capture or manual capture instead of automatic capture, you can cancel an authorization. Sometimes your shoppers change their mind in mid-purchase, or store staff realize they have made a mistake while the shopper is using the terminal. You can then send a request to abort the in-progress transaction. When this request is received before the transaction is approved on the terminal, the payment is cancelled. Here we explain how you can cancel in-progress transactions from:- Your POS app by sending a Terminal API abort request.
- The terminal.
Requirements
Before you begin, take into account the following requirements.Cancel from your POS app
While a payment request is in progress, you can cancel it by making an abort request from your POS app. If you cancel before the shopper presents the card, the payment prompt disappears from the terminal display.You can also cancel after the shopper presents the card, as long as the payment is not completed yet. For example, after presenting the card but before entering the PIN. The terminal then shows Cancelled. After the payment is completed, you cannot use an abort request to cancel the payment.
-
Make a Terminal API abort request, specifying:
-
The standard
SaleToPOIRequest.MessageHeaderobject, withMessageClassset to Service andMessageCategoryset to Abort.
ServiceIDof 21796. Abort an in-progress payment -
The standard
-
Check the responses:
-
A successful abort request returns a response with a
200 OKHTTP status code and no body. -
The payment request returns a response containing:
Result: FailureErrorCondition: Aborted
-
A successful abort request returns a response with a
-
To double-check the payment was indeed cancelled, make a transaction status request, including:
-
The TransactionStatusRequest.MessageReference object with:
ServiceID21796, which you tried to cancel. Check the transaction status of the payment -
The TransactionStatusRequest.MessageReference object with:
-
Check the response: If the payment was cancelled, the TransactionStatusResponse has a
RepeatedResponseMessageBodywith anErrorConditionof Aborted.
Cancel when you do not know the ServiceID
In case of a communication or technical issue, the payment or card acquisition request can remain in-progress. When this happens, the terminal cannot be used until the request times out on its own, usually after 150 seconds. Because you haven’t received the response yet, you do not have theServiceID required to cancel the request.
You can get the ServiceID of the original request by sending a transaction status request with an empty TransactionStatusRequest object. You can then follow up with request to cancel the payment or card acquisition request.
Sending a transaction status request with an empty TransactionStatusRequest object is only supported for payment and card acquisition requests that are still in progress.
To get the ServiceID of the original request:
-
Make a Terminal API transaction status request, specifying:
-
The standard
SaleToPOIRequest.MessageHeaderobject, withMessageClassset to Service andMessageCategoryset to TransactionStatus.Get ServiceID of the in-progress payment request
-
The standard
-
From the TransactionStatusResponse, save the following:
-
ServiceID: The unique ID of the original payment or card acquisition request. -
SaleID: Your unique ID for the system where you send this request from. -
MessageCategory: Can bePaymentorCardAcquisition.
-
-
Follow up with a request to cancel the in-progress payment or card acquisition using the
ServiceIDfrom the transaction status response.
Cancel from the terminal
To cancel an in-progress payment on a terminal:- On the terminal keypad, select the Cancel key

In case of a terminal without a keypad, on the display select the Cancel icon
- The terminal shows a Cancelled message on the display.
-
The payment request returns a response containing:
-
Result: Failure -
ErrorCondition: Cancel
-
Canceling a signature on the display
In a Terminal API integration with a terminal that is configured to let shoppers draw their signature on the display, the transaction is already authorized when the signature prompt appears. Therefore, the terminal always approves the signature even when the shopper selects Cancel
on the signature screen. See Signature for more information.
