{"title":"Cancel an in-progress transaction","category":"default","creationDate":1694572200,"content":"<div class=\"additional-info-block output-inline\">\n<h5 class=\"article__heading additional-info-block__title\">Want to cancel an authorized payment?<\/h5><div class=\"additional-info-block__body\"><p>If you are using <a href=\"\/point-of-sale\/capturing-payments#delayed-capture\">delayed capture<\/a> or <a href=\"\/point-of-sale\/capturing-payments#manual-capture\">manual capture<\/a> instead of automatic capture, you can cancel an authorization.<\/p><\/div><\/div>\n\n<p>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.<\/p>\n<p>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.<\/p>\n<p>Here we explain how you can cancel in-progress transactions from:<\/p>\n<ul>\n<li><a href=\"#cancel-from-register\">Your POS app<\/a> by sending a Terminal API abort request.<\/li>\n<li><a href=\"#cancel-from-terminal\">The terminal<\/a>.<\/li>\n<\/ul>\n<h2>Requirements<\/h2>\n<p>Before you begin, take into account the following requirements.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">A <a href=\"\/point-of-sale\/get-started\">Terminal API integration<\/a> or <a href=\"\/point-of-sale\/standalone\">Standalone solution<\/a> with payment terminals.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"cancel-from-register\">Cancel from your POS app<\/h2>\n<p>While a payment request is in progress, you can cancel it by making an abort request from your POS app.<\/p>\n<p>If you cancel before the shopper presents the card, the payment prompt disappears from the terminal display.<br \/>\nYou 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 <strong>Cancelled<\/strong>.<\/p>\n<div class=\"notices green\">\n<p>After the payment is completed, you cannot use an abort request to cancel the payment.<\/p>\n<\/div>\n<ol>\n<li>\n<p>Make a <a href=\"\/point-of-sale\/design-your-integration\/terminal-api\">Terminal API<\/a> abort request, specifying:<\/p>\n<ul>\n<li>\n<p>The standard <a href=\"\/point-of-sale\/design-your-integration\/terminal-api#request-message-header\">\n  <code>SaleToPOIRequest.MessageHeader<\/code>\n<\/a> object, with <code>MessageClass<\/code> set to <span translate=\"no\"><strong>Service<\/strong><\/span> and <code>MessageCategory<\/code> set to <span translate=\"no\"><strong>Abort<\/strong><\/span>.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>ProtocolVersion<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><strong>3.0<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageClass<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Service<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageCategory<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Abort<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageType<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Request<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>ServiceID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (<code>POIID<\/code>) being used.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>SaleID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your unique ID for the POS system component to send this request from.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>POIID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The unique ID of the terminal to send this request to. Format: <em>[device model]-[serial number]<\/em>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/abort\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">AbortRequest<\/a> object with:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>AbortReason<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>MerchantAbort<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageReference<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">An object with: <ul><li markdown=\"1\"><code>MessageCategory<\/code>: <span translate=\"no\"><strong>Payment<\/strong><\/span><\/li> <li markdown=\"1\"><code>SaleID<\/code>: your unique ID of the POS system component that made the payment request.<\/li> <li markdown=\"1\"><code>ServiceID<\/code>: The <code>ServiceID<\/code> of the transaction request being cancelled.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ul>\n<p>The example shows how to cancel an in-progress payment with a <code>ServiceID<\/code> of <strong>21796<\/strong>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Abort an in-progress payment'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"SaleToPOIRequest\\\":{\\n      \\\"MessageHeader\\\":{\\n         \\\"ProtocolVersion\\\":\\\"3.0\\\",\\n         \\\"MessageClass\\\":\\\"Service\\\",\\n         \\\"MessageCategory\\\":\\\"Abort\\\",\\n         \\\"MessageType\\\":\\\"Request\\\",\\n         \\\"SaleID\\\":\\\"POSSystemID12345\\\",\\n         \\\"ServiceID\\\":\\\"29239\\\",\\n         \\\"POIID\\\":\\\"V400m-324688179\\\"\\n      },\\n      \\\"AbortRequest\\\":{\\n         \\\"AbortReason\\\":\\\"MerchantAbort\\\",\\n         \\\"MessageReference\\\":{\\n            \\\"MessageCategory\\\":\\\"Payment\\\",\\n            \\\"SaleID\\\":\\\"POSSystemID12345\\\",\\n            \\\"ServiceID\\\":\\\"21796\\\"\\n         }\\n      }\\n   }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Check the responses:<\/p>\n<ul>\n<li>\n<p>A successful abort request returns a response with a <code>200 OK<\/code> HTTP status code and no body.<\/p>\n<\/li>\n<li>\n<p>The <a href=\"\/point-of-sale\/basic-tapi-integration\/make-a-payment\/#make-a-payment\">payment request<\/a> returns a response containing:<\/p>\n<ul>\n<li><code>Result<\/code>: <span translate=\"no\"><strong>Failure<\/strong><\/span><\/li>\n<li><code>ErrorCondition<\/code>: <span translate=\"no\"><strong>Aborted<\/strong><\/span><\/li>\n<\/ul>\n<!-- list separator -->\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>To double-check the payment was indeed cancelled, <a href=\"\/point-of-sale\/basic-tapi-integration\/verify-transaction-status\">make a transaction status request<\/a>, including:<\/p>\n<ul>\n<li>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/transactionstatus#request-MessageReference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">TransactionStatusRequest.MessageReference<\/a> object with:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>SaleID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The <code>SaleID<\/code> of the POS system component that made the payment you tried to cancel.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>ServiceID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The <code>ServiceID<\/code> of the payment you tried to cancel.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageCategory<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Set to <span translate=\"no\"><strong>Payment<\/strong><\/span>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- list separator -->\n<\/li>\n<\/ul>\n<p>The example shows how to check the transaction status of a payment with <code>ServiceID<\/code> <strong>21796<\/strong>, which you tried to cancel.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Check the transaction status of the payment'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"SaleToPOIRequest\\\":{\\n      \\\"MessageHeader\\\":{\\n         \\\"ProtocolVersion\\\":\\\"3.0\\\",\\n         \\\"MessageClass\\\":\\\"Service\\\",\\n         \\\"MessageCategory\\\":\\\"TransactionStatus\\\",\\n         \\\"MessageType\\\":\\\"Request\\\",\\n         \\\"SaleID\\\":\\\"POSSystemID12345\\\",\\n         \\\"ServiceID\\\":\\\"29240\\\",\\n         \\\"POIID\\\":\\\"V400m-324688179\\\"\\n      },\\n      \\\"TransactionStatusRequest\\\":{\\n         \\\"ReceiptReprintFlag\\\":true,\\n         \\\"DocumentQualifier\\\":[\\n            \\\"CashierReceipt\\\",\\n            \\\"CustomerReceipt\\\"\\n         ],\\n         \\\"MessageReference\\\":{\\n            \\\"SaleID\\\":\\\"POSSystemID12345\\\",\\n            \\\"ServiceID\\\":\\\"21796\\\",\\n            \\\"MessageCategory\\\":\\\"Payment\\\"\\n         }\\n      }\\n   }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Check the response: If the payment was cancelled, the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/transactionstatus#responses-200-Response\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">TransactionStatusResponse<\/a> has a <code>RepeatedResponseMessageBody<\/code> with an <code>ErrorCondition<\/code> of <span translate=\"no\"><strong>Aborted<\/strong><\/span>.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"get-service-id\">Cancel when you do not know the ServiceID<\/h3>\n<p>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 <code>ServiceID<\/code> required to cancel the request.<\/p>\n<p>You can get the <code>ServiceID<\/code> of the original request by sending a transaction status request with an empty <code>TransactionStatusRequest<\/code> object. You can then follow up with request to cancel the <a href=\"\/point-of-sale\/basic-tapi-integration\/cancel-a-transaction#cancel-from-register\">payment<\/a> or <a href=\"\/point-of-sale\/card-acquisition#cancel-in-progress\">card acquisition<\/a> request.<\/p>\n<div class=\"notices yellow\">\n<p>Sending a transaction status request with an empty <code>TransactionStatusRequest<\/code> object is only supported for payment and card acquisition requests that are still in progress.<\/p>\n<\/div>\n<p>To get the <code>ServiceID<\/code> of the original request:<\/p>\n<ol>\n<li>\n<p>Make a Terminal API <a href=\"\/point-of-sale\/basic-tapi-integration\/verify-transaction-status\">transaction status request<\/a>, specifying:<\/p>\n<ul>\n<li>\n<p>The standard <a href=\"\/point-of-sale\/design-your-integration\/terminal-api#request-message-header\">\n  <code>SaleToPOIRequest.MessageHeader<\/code>\n<\/a> object, with <code>MessageClass<\/code> set to <span translate=\"no\"><strong>Service<\/strong><\/span> and <code>MessageCategory<\/code> set to <span translate=\"no\"><strong>TransactionStatus<\/strong><\/span>.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>ProtocolVersion<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><strong>3.0<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageClass<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Service<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageCategory<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>TransactionStatus<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageType<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Request<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>SaleID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your unique ID for the POS system component to send this request from.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>ServiceID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (<code>POIID<\/code>) being used.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>POIID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The unique ID of the terminal to send this request to. Format: <em>[device model]-[serial number]<\/em>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/transactionstatus\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">TransactionStatusRequest<\/a>: An empty object.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Get ServiceID of the in-progress payment request'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"SaleToPOIRequest\\\":{\\n      \\\"MessageHeader\\\":{\\n         \\\"ProtocolVersion\\\":\\\"3.0\\\",\\n         \\\"MessageClass\\\":\\\"Service\\\",\\n         \\\"MessageCategory\\\":\\\"TransactionStatus\\\",\\n         \\\"MessageType\\\":\\\"Request\\\",\\n         \\\"ServiceID\\\":\\\"29245\\\",\\n         \\\"SaleID\\\":\\\"POSSystemID12345\\\",\\n         \\\"POIID\\\":\\\"V400m-324688179\\\"\\n      },\\n      \\\"TransactionStatusRequest\\\":{\\n      }\\n   }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>From the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/transactionstatus#responses-200-Response\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">TransactionStatusResponse<\/a>, save the following:<\/p>\n<ul>\n<li><code>ServiceID<\/code>: The unique ID of the original payment or card acquisition request.<\/li>\n<li><code>SaleID<\/code>: Your unique ID for the system where you send this request from.<\/li>\n<li>\n<p><code>MessageCategory<\/code>: Can be <code>Payment<\/code> or <code>CardAcquisition<\/code>.<\/p>\n<!-- list-separator -->\n<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'ServiceID of the in-progress payment request'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"SaleToPOIResponse\\\":{\\n      \\\"MessageHeader\\\":{\\n         \\\"ProtocolVersion\\\":\\\"3.0\\\",\\n         \\\"MessageClass\\\":\\\"Service\\\",\\n         \\\"MessageCategory\\\":\\\"TransactionStatus\\\",\\n         \\\"MessageType\\\":\\\"Response\\\",\\n         \\\"ServiceID\\\":\\\"29245\\\",\\n         \\\"SaleID\\\":\\\"POSSystemID12345\\\",\\n         \\\"POIID\\\":\\\"V400m-324688179\\\"\\n      },\\n      \\\"TransactionStatusResponse\\\":{\\n         \\\"MessageReference\\\":{\\n            \\\"MessageCategory\\\":\\\"Payment\\\",\\n            \\\"SaleID\\\":\\\"POSSystemID12345\\\",\\n            \\\"ServiceID\\\":\\\"816\\\"\\n         },\\n         \\\"Response\\\":{\\n            \\\"AdditionalResponse\\\":\\\"...\\\",\\n            \\\"ErrorCondition\\\":\\\"InProgress\\\",\\n            \\\"Result\\\":\\\"Failure\\\"\\n         }\\n      }\\n   }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Follow up with a request to cancel the in-progress <a href=\"\/point-of-sale\/basic-tapi-integration\/cancel-a-transaction#cancel-from-register\">payment<\/a> or <a href=\"\/point-of-sale\/card-acquisition#cancel-in-progress\">card acquisition<\/a> using the <code>ServiceID<\/code> from the transaction status response.<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"cancel-from-terminal\">Cancel from the terminal<\/h2>\n<p>To cancel an in-progress payment on a terminal:<\/p>\n<ul>\n<li>On the terminal keypad, select the <em>Cancel<\/em> key <strong><img alt=\"\" src=\"\/images\/e\/b\/5\/8\/6\/eb5864c171bd3eac47d4a415a1f7e5dc0b075c28-cancel2x.png\" \/><\/strong><br \/>\nIn case of a terminal without a keypad, on the display select the <em>Cancel<\/em> icon <img style=\"width: 60px;\" alt=\"\" src=\"\/user\/pages\/reuse\/image-library\/buttons\/cancel-icon\/nav-cancel.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/li>\n<\/ul>\n<p>If this is successful:<\/p>\n<ul>\n<li>The terminal shows a <strong>Cancelled<\/strong> message on the display.<\/li>\n<li>\n<p>The <a href=\"\/point-of-sale\/basic-tapi-integration\/make-a-payment\/#make-a-payment\">payment request<\/a> returns a response containing:<\/p>\n<ul>\n<li><code>Result<\/code>: <span translate=\"no\"><strong>Failure<\/strong><\/span><\/li>\n<li>\n<p><code>ErrorCondition<\/code>: <span translate=\"no\"><strong>Cancel<\/strong><\/span><\/p>\n<!-- list separator -->\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Canceling a signature on the display<\/h3>\n<p>In a Terminal API integration with a terminal that is configured to let shoppers draw their <em>signature on the display<\/em>, the transaction is already authorized when the signature prompt appears. Therefore, the terminal always approves the signature even when the shopper selects <strong>Cancel<\/strong> <strong><img alt=\"\" src=\"\/images\/e\/b\/5\/8\/6\/eb5864c171bd3eac47d4a415a1f7e5dc0b075c28-cancel2x.png\" \/><\/strong> on the signature screen. See <a href=\"\/point-of-sale\/cardholder-verification-methods#signature\">Signature<\/a> for more information.<\/p>\n<h2>Handling failed cancel requests<\/h2>\n<p>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 <a href=\"\/point-of-sale\/basic-tapi-integration\/refund-payment\">Refund a completed payment<\/a>.<\/p>\n<h2>See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/point-of-sale\/basic-tapi-integration\"\n                        target=\"_self\"\n                        >\n                    Implement the payment flow\n                <\/a><\/li><li><a href=\"\/point-of-sale\/standalone\/standalone-use\"\n                        target=\"_self\"\n                        >\n                    Use a standalone terminal\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/point-of-sale\/basic-tapi-integration\/cancel-a-transaction","articleFields":{"description":"Learn how to cancel a transaction while it is in-progress.","id":"28875227","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"13-09-2023 04:31","feedback_component":true,"filters_component":false},"algolia":{"url":"https:\/\/docs.adyen.com\/point-of-sale\/basic-tapi-integration\/cancel-a-transaction","title":"Cancel an in-progress transaction","content":"\nWant to cancel an authorized payment?If you are using delayed capture or manual capture instead of automatic capture, you can cancel an authorization.\n\nSometimes your shoppers change their mind in mid-purchase, or store staff realize they have made a mistake while the shopper is using the terminal.\nYou 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.\nHere we explain how you can cancel in-progress transactions from:\n\nYour POS app by sending a Terminal API abort request.\nThe terminal.\n\nRequirements\nBefore you begin, take into account the following requirements.\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nA Terminal API integration or Standalone solution with payment terminals.\n\n\n\nCancel from your POS app\nWhile a payment request is in progress, you can cancel it by making an abort request from your POS app.\nIf you cancel before the shopper presents the card, the payment prompt disappears from the terminal display.\nYou 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.\n\nAfter the payment is completed, you cannot use an abort request to cancel the payment.\n\n\n\nMake a Terminal API abort request, specifying:\n\n\nThe standard \n  SaleToPOIRequest.MessageHeader\n object, with MessageClass set to Service and MessageCategory set to Abort.\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nProtocolVersion\n\n3.0\n\n\nMessageClass\n\nService\n\n\nMessageCategory\n\nAbort\n\n\nMessageType\n\nRequest\n\n\nServiceID\n\nYour 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.\n\n\nSaleID\n\nYour unique ID for the POS system component to send this request from.\n\n\nPOIID\n\nThe unique ID of the terminal to send this request to. Format: [device model]-[serial number].\n\n\n\n\n\n\n\nThe  AbortRequest object with:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nAbortReason\n\nMerchantAbort\n\n\nMessageReference\n\nAn object with: MessageCategory: Payment SaleID: your unique ID of the POS system component that made the payment request. ServiceID: The ServiceID of the transaction request being cancelled.\n\n\n\n\n\nThe example shows how to cancel an in-progress payment with a ServiceID of 21796.\n\n\n\n\n\nCheck the responses:\n\n\nA successful abort request returns a response with a 200 OK HTTP status code and no body.\n\n\nThe payment request returns a response containing:\n\nResult: Failure\nErrorCondition: Aborted\n\n\n\n\n\n\nTo double-check the payment was indeed cancelled, make a transaction status request, including:\n\n\nThe  TransactionStatusRequest.MessageReference object with:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nSaleID\n\nThe SaleID of the POS system component that made the payment you tried to cancel.\n\n\nServiceID\n\nThe ServiceID of the payment you tried to cancel.\n\n\nMessageCategory\n\nSet to Payment.\n\n\n\n\n\n\nThe example shows how to check the transaction status of a payment with ServiceID 21796, which you tried to cancel.\n\n\n\n\n\nCheck the response: If the payment was cancelled, the  TransactionStatusResponse has a RepeatedResponseMessageBody with an ErrorCondition of Aborted.\n\n\nCancel when you do not know the ServiceID\nIn 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.\nYou 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.\n\nSending a transaction status request with an empty TransactionStatusRequest object is only supported for payment and card acquisition requests that are still in progress.\n\nTo get the ServiceID of the original request:\n\n\nMake a Terminal API transaction status request, specifying:\n\n\nThe standard \n  SaleToPOIRequest.MessageHeader\n object, with MessageClass set to Service and MessageCategory set to TransactionStatus.\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nProtocolVersion\n\n3.0\n\n\nMessageClass\n\nService\n\n\nMessageCategory\n\nTransactionStatus\n\n\nMessageType\n\nRequest\n\n\nSaleID\n\nYour unique ID for the POS system component to send this request from.\n\n\nServiceID\n\nYour 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.\n\n\nPOIID\n\nThe unique ID of the terminal to send this request to. Format: [device model]-[serial number].\n\n\n\n\n\n\n\n TransactionStatusRequest: An empty object.\n\n\n\n\n\n\n\nFrom the  TransactionStatusResponse, save the following:\n\nServiceID: The unique ID of the original payment or card acquisition request.\nSaleID: Your unique ID for the system where you send this request from.\n\nMessageCategory: Can be Payment or CardAcquisition.\n\n\n\n\n\n\n\n\nFollow up with a request to cancel the in-progress payment or card acquisition using the ServiceID from the transaction status response.\n\n\nCancel from the terminal\nTo cancel an in-progress payment on a terminal:\n\nOn the terminal keypad, select the Cancel key \nIn case of a terminal without a keypad, on the display select the Cancel icon \n\nIf this is successful:\n\nThe terminal shows a Cancelled message on the display.\n\nThe payment request returns a response containing:\n\nResult: Failure\n\nErrorCondition: Cancel\n\n\n\n\n\nCanceling a signature on the display\nIn 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.\nHandling failed cancel requests\nIf 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.\nSee also\n\n\n                    Implement the payment flow\n                \n                    Use a standalone terminal\n                \n","type":"page","locale":"en","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"In-person payments","lvl2":"Implement the payment flow","lvl3":"Cancel an in-progress transaction"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/point-of-sale","lvl2":"https:\/\/docs.adyen.com\/point-of-sale\/basic-tapi-integration","lvl3":"\/point-of-sale\/basic-tapi-integration\/cancel-a-transaction"},"levels":4,"category":"In-person payments","category_color":"green","tags":["Cancel","in-progress","transaction"]},"articleFiles":{"abort-payment-request.json":"<p alt=\"\">abort-payment-request.json<\/p>"}}
