Terminal-2 icon

Cancel an in-progress transaction

Learn how to cancel a transaction while it is in-progress.

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've made a mistake while the shopper is using the terminal.

A cancel request lets either a shopper or store staff abort an in-progress transaction. When the cancel request is received before a payment is Approved, the payment is cancelled.

Here we explain how you can cancel transactions from:

Cancel from your POS app

While a PaymentRequest is in progress, you can cancel it by making an AbortRequest from your POS app.

  1. Make a POST request to a Terminal API endpoint, specifying:

    • MessageHeader: the standard SaleToPOIRequest.MessageHeader object. Specify:

      Parameter Required Description
      ProtocolVersion -white_check_mark- 3.0
      MessageClass -white_check_mark- Service
      MessageCategory -white_check_mark- Abort
      MessageType -white_check_mark- Request
      ServiceID -white_check_mark- Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (POIID) being used.
      SaleID -white_check_mark- Your unique ID for the POS system component to send this request from.
      POIID -white_check_mark- The unique ID of the terminal to send this request to. Format: [device model]-[serial number].
    • AbortRequest: The request body with:

      Parameter Required Description
      AbortReason -white_check_mark- MerchantAbort
      MessageReference -white_check_mark- An object with:
      • MessageCategory: Payment
      • SaleID: your unique ID of the POS system component that made the payment request.
      • ServiceID: The ServiceID of the payment request being cancelled.

    For more details see the AbortRequest API reference.

    The example below shows how to make a request to cancel an in-progress payment with a ServiceID of 21796.

    A successful AbortRequest returns a response with a 200 OK HTTP status code and no body.

    The payment request returns a response containing:

    • Result: Failure
    • ErrorCondition: Aborted

    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 isn't 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 the AbortRequest to cancel the payment.

  2. To double-check the payment was indeed cancelled, make a TransactionStatusRequest , specifying:

    • MessageReference. This includes:

      • SaleID: The SaleID of the POS system component that made the payment you tried to cancel.
      • ServiceID: The ServiceID of the payment you tried to cancel.
      • MessageCategory: Payment

    The example below shows how to check the transaction status of a payment with ServiceID 21796, which you tried to cancel.

    If the payment was cancelled, you should receive a successful transaction status response with a RepeatedResponseMessageBody that has an ErrorCondition of 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 the ServiceID 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:

  1. Make a POST request to a Terminal API endpoint, specifying:

    • MessageHeader: the standard SaleToPOIRequest.MessageHeader object. Specify:

      Parameter Required Description
      ProtocolVersion -white_check_mark- 3.0
      MessageClass -white_check_mark- Service
      MessageCategory -white_check_mark- TransactionStatus
      MessageType -white_check_mark- Request
      SaleID -white_check_mark- Your unique ID for the POS system component to send this request from.
      ServiceID -white_check_mark- Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (POIID) being used.
      POIID -white_check_mark- The unique ID of the terminal to send this request to. Format: [device model]-[serial number].
  2. 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 be Payment or CardAcquisition.

  3. Follow up with a request to cancel the in-progress payment or card acquisition.

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

If this is successful:

  • 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.

Handling failed cancel requests

If your cancel request failed (and the payment was Approved), you will need to refund the payment. For more information on refunding a payment, see Refund a completed payment.

Next steps