{"title":"Cancel or refund","category":"default","creationDate":1776961627,"content":"<p>If you want to return the funds to your shopper, but are not certain whether the payment has been <a href=\"\/pt\/online-payments\/classic-integrations\/modify-payments\/capture\">captured<\/a> or not, use the Cancel or Refund functionality.\u00a0<\/p>\n<p>This will either:\u00a0<\/p>\n<ul>\n<li><a href=\"\/pt\/online-payments\/classic-integrations\/modify-payments\/cancel\">Cancel<\/a> the payment \u2013 in case it has not yet been captured.\u00a0<\/li>\n<li><a href=\"\/pt\/online-payments\/classic-integrations\/modify-payments\/refund\">Refund<\/a> the payment \u2013 in case it has already been captured.<\/li>\n<\/ul>\n<p>If you have an Adyen for Platforms integration, note that the <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/Payment\/cancelOrRefund\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/cancelOrRefund<\/a> endpoint does not accept <a href=\"\/pt\/platforms\/online-payments\/split-transactions\/split-refunds\">split instructions<\/a>. If you want to provide instructions on how to split the refund, we recommend that you:<\/p>\n<ol>\n<li>Check if the payment has been captured.<\/li>\n<li>If not captured yet, make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/cancels\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/{paymentPspReference}\/cancels<\/a> call. If already captured, make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/{paymentPspReference}\/refunds<\/a> call.<\/li>\n<\/ol>\n<div class=\"notices yellow\">\n<p>Do not use the <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/Payment\/cancelOrRefund\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/cancelOrRefund<\/a> endpoint for payments that involve <a href=\"\/pt\/online-payments\/capture\">multiple partial captures<\/a>.<\/p>\n<\/div>\n<h2 id=\"cancel-or-refund-a-payment\">Cancel or refund a payment<\/h2>\n<p>To issue a cancel or refund, make a request to the\u00a0<a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/Payment\/cancelOrRefund\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/cancelOrRefund<\/a>\u00a0endpoint. You need to specify:\u00a0<\/p>\n<ul>\n<li><code>merchantAccount<\/code>: The name of your merchant account that is used to process the payment.<\/li>\n<li><code>originalReference<\/code>: The original\u00a0<code>pspReference<\/code>\u00a0of the payment that you want to cancel or refund. This reference is returned in the response to your payment request, and in the\u00a0AUTHORISATION webhook event.<\/li>\n<li><code>reference<\/code>: <div data-component-wrapper=\"tag\">\n    <tag :variant=&quot;success&quot;>\n        Optional\n    <\/tag>\n<\/div>\n Specifies a unique identifier for payment modification. The <code>reference<\/code> field is useful to tag a partial cancel or refund for future reconciliation.<\/li>\n<\/ul>\n<pre><code class=\"language-json\">{\n    \"merchantAccount\" : \"YourMerchantAccount\",\n    \"originalReference\" : \"9313547924770610\",\n    \"reference\" : \"YourModificationReference\"\n}<\/code><\/pre>\n<p>You will receive a <code>\/cancelOrRefund<\/code>\u00a0response containing:\u00a0<\/p>\n<ul>\n<li><code>pspReference<\/code>: The PSP reference\u00a0associated with this\u00a0<code>\/cancelOrRefund<\/code>\u00a0request.<\/li>\n<\/ul>\n<pre><code class=\"language-json\">{\n    \"pspReference\" : \"8863534564726784\",\n    \"response\" : \"[cancelOrRefund-received]\"\n}<\/code><\/pre>\n<h2 id=\"cancel-or-refund-webhook\">CANCEL OR REFUND webhook<\/h2>\n<p>To know whether your request to cancel or refund the payment was successful, you need to receive\u00a0CANCEL_OR_REFUND webhooks.<\/p>\n<p>If you have enabled\u00a0CANCEL_OR_REFUND webhooks, we will send you a\u00a0<a href=\"\/pt\/development-resources\/webhooks\">webhook event<\/a>\u00a0once\u00a0 we have processed your request to cancel or refund the payment. This event contains:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>eventCode<\/code><\/td>\n<td><strong>CANCEL_OR_REFUND<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>originalReference<\/code><\/td>\n<td>The PSP reference of the original payment.<\/td>\n<\/tr>\n<tr>\n<td><code>pspReference<\/code><\/td>\n<td>The PSP reference of the reversal that you can find in the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/reversals\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/{paymentPspReference}\/reversals<\/a> response<\/td>\n<\/tr>\n<tr>\n<td><code>success<\/code><\/td>\n<td>Indicates the outcome of the refund validations. Possible values:  <ul><li> <strong>true<\/strong>: Adyen's validations were successful and we sent the refund request to the card scheme. This usually means that the refund will be processed successfully. However, in rare cases the refund can be rejected by the card scheme, or reversed. For information about these exceptions, see <a href=\"\/pt\/online-payments\/refund#refund-failed\"><strong>REFUND_FAILED<\/strong> webhook<\/a>, and <a href=\"\/pt\/online-payments\/refund#refunded-reversed\"><strong>REFUNDED_REVERSED<\/strong> webhook<\/a>. <\/li><li> <strong>false<\/strong>: the refund validations failed. The webhook includes a <code>reason<\/code> field with a short description of the problem. <a href=\"\/pt\/online-payments\/classic-integrations\/modify-payments\/refund#unsuccessful-refund-request\">Review the reason<\/a>, fix the issue if possible, and resubmit the refund request. <\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example of a webhook message with the CANCEL_OR_REFUND event code'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"live\\\":\\\"false\\\",\\n   \\\"notificationItems\\\":[\\n      {\\n         \\\"NotificationRequestItem\\\":{\\n            \\\"additionalData\\\":{\\n               \\\"modification.action\\\": \\\"refund\\\"\\n            },\\n            \\\"amount\\\":{\\n               \\\"currency\\\": \\\"EUR\\\",\\n               \\\"value\\\": 1025\\n            },\\n            \\\"eventCode\\\":\\\"CANCEL_OR_REFUND\\\",\\n            \\\"eventDate\\\":\\\"2022-02-03T15:14:15.004Z\\\",\\n            \\\"merchantAccountCode\\\":\\\"YOUR_MERCHANT_ACCOUNT\\\",\\n            \\\"originalReference\\\":\\\"VK9DRSLLRCQ2WN82\\\",\\n            \\\"paymentMethod\\\":\\\"mc\\\",\\n            \\\"pspReference\\\":\\\"TF995R5G6L2GWR82\\\",\\n            \\\"reason\\\":\\\"\\\",\\n            \\\"success\\\":\\\"true\\\"\\n         }\\n      }\\n   ]\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>For more information about the included fields, see the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Webhooks\/latest\/post\/CANCEL_OR_REFUND\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">CANCEL_OR_REFUND<\/a> webhook reference.<\/p>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/?classes=codeLabel#\/Payment\/cancelOrRefund\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    API Explorer\n                <\/a><\/li><li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/Webhooks\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    Online payments webhook reference\n                <\/a><\/li><li><a href=\"\/online-payments\/classic-integrations\/modify-payments\/capture\"\n                        target=\"_self\"\n                        >\n                    Capture\n                <\/a><\/li><li><a href=\"\/online-payments\/classic-integrations\/modify-payments\/cancel\"\n                        target=\"_self\"\n                        >\n                    Cancel\n                <\/a><\/li><li><a href=\"\/online-payments\/classic-integrations\/modify-payments\/refund\"\n                        target=\"_self\"\n                        >\n                    Refund\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/online-payments\/classic-integrations\/modify-payments\/cancel-or-refund","articleFields":{"description":"Return the funds to the shopper when you are not sure whether the payment has been captured.","id":"31493919","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"13-03-2020 09:51"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/online-payments\/classic-integrations\/modify-payments\/cancel-or-refund","title":"Cancel or refund","content":"If you want to return the funds to your shopper, but are not certain whether the payment has been captured or not, use the Cancel or Refund functionality.\u00a0\nThis will either:\u00a0\n\nCancel the payment \u2013 in case it has not yet been captured.\u00a0\nRefund the payment \u2013 in case it has already been captured.\n\nIf you have an Adyen for Platforms integration, note that the \/cancelOrRefund endpoint does not accept split instructions. If you want to provide instructions on how to split the refund, we recommend that you:\n\nCheck if the payment has been captured.\nIf not captured yet, make a  \/payments\/{paymentPspReference}\/cancels call. If already captured, make a  \/payments\/{paymentPspReference}\/refunds call.\n\n\nDo not use the \/cancelOrRefund endpoint for payments that involve multiple partial captures.\n\nCancel or refund a payment\nTo issue a cancel or refund, make a request to the\u00a0\/cancelOrRefund\u00a0endpoint. You need to specify:\u00a0\n\nmerchantAccount: The name of your merchant account that is used to process the payment.\noriginalReference: The original\u00a0pspReference\u00a0of the payment that you want to cancel or refund. This reference is returned in the response to your payment request, and in the\u00a0AUTHORISATION webhook event.\nreference: \n    \n        Optional\n    \n\n Specifies a unique identifier for payment modification. The reference field is useful to tag a partial cancel or refund for future reconciliation.\n\n{\n    \"merchantAccount\" : \"YourMerchantAccount\",\n    \"originalReference\" : \"9313547924770610\",\n    \"reference\" : \"YourModificationReference\"\n}\nYou will receive a \/cancelOrRefund\u00a0response containing:\u00a0\n\npspReference: The PSP reference\u00a0associated with this\u00a0\/cancelOrRefund\u00a0request.\n\n{\n    \"pspReference\" : \"8863534564726784\",\n    \"response\" : \"[cancelOrRefund-received]\"\n}\nCANCEL OR REFUND webhook\nTo know whether your request to cancel or refund the payment was successful, you need to receive\u00a0CANCEL_OR_REFUND webhooks.\nIf you have enabled\u00a0CANCEL_OR_REFUND webhooks, we will send you a\u00a0webhook event\u00a0once\u00a0 we have processed your request to cancel or refund the payment. This event contains:\n\n\n\nParameter\nDescription\n\n\n\n\neventCode\nCANCEL_OR_REFUND\n\n\noriginalReference\nThe PSP reference of the original payment.\n\n\npspReference\nThe PSP reference of the reversal that you can find in the  \/payments\/{paymentPspReference}\/reversals response\n\n\nsuccess\nIndicates the outcome of the refund validations. Possible values:   true: Adyen's validations were successful and we sent the refund request to the card scheme. This usually means that the refund will be processed successfully. However, in rare cases the refund can be rejected by the card scheme, or reversed. For information about these exceptions, see REFUND_FAILED webhook, and REFUNDED_REVERSED webhook.  false: the refund validations failed. The webhook includes a reason field with a short description of the problem. Review the reason, fix the issue if possible, and resubmit the refund request. \n\n\n\n\n    \n\nFor more information about the included fields, see the  CANCEL_OR_REFUND webhook reference.\nSee also\n\n\n                    API Explorer\n                \n                    Online payments webhook reference\n                \n                    Capture\n                \n                    Cancel\n                \n                    Refund\n                \n","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Classic integrations for Ecommerce","lvl3":"Modify payments","lvl4":"Cancel or refund"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/online-payments","lvl2":"https:\/\/docs.adyen.com\/pt\/online-payments\/classic-integrations","lvl3":"https:\/\/docs.adyen.com\/pt\/online-payments\/classic-integrations\/modify-payments","lvl4":"\/pt\/online-payments\/classic-integrations\/modify-payments\/cancel-or-refund"},"levels":5,"category":"Online Payments","category_color":"green","tags":["Cancel","refund"]}}
