Search

Are you looking for test card numbers?

Would you like to contact support?

Point-of-sale icon

Cancel a payment

Learn how to cancel an in-progress transaction.

Sometimes your shoppers change their mind about a purchase, or store staff realize they've made a mistake as the shopper is using the terminal.

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

Here we explain how payments can be cancelled from:

Cancel from cash register

While a payment request is in-progress, you can cancel it by making an cancel request from your cash register.

  1. To cancel a payment, make a POST request to a Terminal API endpoint, specifying:

    • MessageHeader object. This follows the standard MessageHeader structure, explained in Terminal API fundamentals:

      • ProtocolVersion: 3.0
      • MessageClass: Service
      • MessageCategory: Abort.
      • MessageType: Request
      • SaleID: Your unique ID for the cash register making the cancel request.
      • ServiceID: Your unique ID for this transaction attempt, consisting of 1-10 alphanumeric characters. This value must be unique within the last 48 hours.
      • POIID: Unique ID of the terminal.¬†This indicates which terminal the payment will be routed to.

    • AbortRequest object with:

      • AbortReason: MerchantAbort
      • MessageReference.MessageCategory: Payment
      • MessageReference.SaleID: Your unique ID of the cash register that made the payment request.
      • MessageReference.ServiceID: The ServiceID of the payment request being cancelled.

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

    {
      "SaleToPOIRequest":{
        "MessageHeader":{
          "ProtocolVersion":"3.0",
          "MessageClass":"Service",
          "MessageCategory":"Abort",
          "MessageType":"Request",
          "SaleID":"POSSystemID12345",
          "ServiceID":"29239",
          "POIID":"V400m-324688179"
        },
        "AbortRequest":{
          "AbortReason":"MerchantAbort",
          "MessageReference":{
            "MessageCategory":"Payment",
            "SaleID":"POSSystemID12345",
            "ServiceID":"21796"
          }    
        }
      }
    }

    For a complete list of fields you can pass in a cancel request, see the AbortRequest API reference.

    No API response is generated for the cancel request. Instead, you receive a 200 OK HTTP response.

    If cancelling was successful:

    • The terminal displays a Cancelled message on the screen.
    • The payment request returns a response containing Result: Failure and ErrorCondition: Aborted.
  2. To double-check the payment was indeed cancelled, make a TransactionStatus request, specifying:

    • MessageHeader object. This follows the standard MessageHeader structure as shown for the AbortRequest above, but has:

      • MessageCategory: TransactionStatus

    • TransactionStatusRequest object with:

      • ReceiptReprintFlag: true
      • DocumentQualifier: Receipt data you wish to receive in the response. Can be one or both of:

        • CashierReceipt: Cashier receipt, including signature data.
        • CustomerReceipt: Shopper receipt.

      • MessageReference: Object with the details of the payment transaction you tried to cancel.

        • SaleID: The SaleID of the cash register that made the payment transaction.
        • ServiceID: The ServiceID of the payment transaction.
        • MessageCategory: Payment

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

    {
      "SaleToPOIRequest": {
        "MessageHeader": {
          "ProtocolVersion": "3.0",
          "MessageClass": "Service",
          "MessageCategory": "TransactionStatus",
          "MessageType": "Request",
          "SaleID": "POSSystemID12345",
          "ServiceID": "29240",
          "POIID": "V400m-324688179"
        },
        "TransactionStatusRequest": {
          "ReceiptReprintFlag": true,
          "DocumentQualifier": [
            "CashierReceipt",
            "CustomerReceipt"
          ],
          "MessageReference": {
            "SaleID": "POSSystemID12345",
            "ServiceID": "21796",
            "MessageCategory": "Payment"
          }
        }
      }
    }

    If the payment was cancelled, you should receive a transaction not found response. The TransactionStatusResponse.Response has an ErrorCondition of NotFound.

Cancel from terminal

To cancel an in-progress payment from a terminal:

  1. Press the button on the terminal keypad.
  2. On the terminal screen, confirm that you want to cancel the transaction.

If this is successful:

  • The terminal displays a Cancelled message on the screen.
  • The payment request returns a response containing Result: Failure and ErrorCondition: Cancel.

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