{"title":"Auto Rescue for SEPA payments","category":"default","creationDate":1776961627,"content":"<p>Besides Auto Rescue for <a href=\"\/pt\/online-payments\/auto-rescue\/cards\">card transactions<\/a>, we support rescuing SEPA transactions. Because SEPA transactions always have <code>eventCode<\/code> <strong>AUTHORISED<\/strong> in the response, these require a different rescue logic compared to card transactions.<\/p>\n<p>We apply our rescue logic on two chargeback reasons for SEPA.<\/p>\n<ul>\n<li><strong>AM04<\/strong>: Insufficient funds<\/li>\n<li><strong>MS03<\/strong>: No reason specified. This code is used in some countries\/regions instead of AM04.<\/li>\n<\/ul>\n<p>Also note that for SEPA payments, we have a maximum of two rescue attempts within the rescue window. The reasons for that are:<\/p>\n<ul>\n<li>The period between the initial transaction and the first decline message is longer than for card transactions. This means we have fewer days left to rescue the transaction.<\/li>\n<li>Because chargebacks are typically fined by the issuing bank, it is important to keep the number of rescue attempts low.<\/li>\n<\/ul>\n<p>On this page, you will learn how to:<\/p>\n<ol>\n<li><a href=\"#step-1-enable-auto-rescue\">Enable Auto Rescue<\/a> for SEPA transactions.<\/li>\n<li><a href=\"#step-2-receive-auto-rescue-updates\">Receive updates on the Auto Rescue process<\/a>.<\/li>\n<\/ol>\n<p>We also explain how you can:<\/p>\n<ul>\n<li><a href=\"#send-a-payment-link\">Send a payment link<\/a> when the Auto Rescue process ends unsuccessfully.<\/li>\n<li><a href=\"#cancel-auto-rescue-process\">Cancel the Auto Rescue process<\/a> for a payment.<\/li>\n<li><a href=\"#test-auto-rescue\">Test how your integration handles Auto Rescue updates<\/a>.<\/li>\n<li><a href=\"#auto-rescue-reports\">Reconcile retry attempts in Adyen generated reports<\/a>.<\/li>\n<\/ul>\n<h2>How it works<\/h2>\n<p><img alt=\"\" src=\"\/user\/pages\/docs\/02.online-payments\/23.auto-rescue\/02.sepa\/autorescue-sepa.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/p>\n<h2 id=\"step-1-enable-auto-rescue\">Step 1: Enable Auto Rescue<\/h2>\n<p>You can enable Auto Rescue for SEPA payments at:<\/p>\n<ul>\n<li><a href=\"#enable-auto-rescue-account-level\">Account level<\/a><\/li>\n<li><a href=\"#enable-auto-rescue-transaction-level\">Transaction level<\/a>.<\/li>\n<\/ul>\n<h3 id=\"enable-auto-rescue-account-level\">Enable at account level<\/h3>\n<p>To enable Auto Rescue for all qualifying SEPA payments, contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> or your Adyen Account Manager to configure this for you.<\/p>\n<div class=\"notices green\">\n<p>The rescue window is set to 42 days. If you want to use a different rescue window, enable Auto Rescue for SEPA payments at transaction level.<\/p>\n<\/div>\n<h3 id=\"enable-auto-rescue-transaction-level\">Enable at transaction level<\/h3>\n<p>To enable Auto Rescue for SEPA payments on transaction level, contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> or your Adyen Account Manager to configure this for you.<\/p>\n<p>When configured, to enable Auto Rescue for a SEPA transaction in your payment request:<\/p>\n<ul>\n<li>Add the <code>autoRescue<\/code> flag.<\/li>\n<li>Submit a unique <code>merchantOrderReference<\/code>. This reference represents a specific billing cycle or subscription and will appear in any <a href=\"#step-2-receive-auto-rescue-updates\">Auto Rescue updates<\/a> or <a href=\"#auto-rescue-reports\">reports<\/a>. You can connect any Auto Rescue retry attempt to the original  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request using this reference.<\/li>\n<\/ul>\n<p>For example:<\/p>\n<ul>\n<li>\n<p>Make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request, and specify:<\/p>\n<ul>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperInteraction\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperInteraction<\/a>&#58; <strong>ContAuth<\/strong><\/li>\n<li><code>autoRescue<\/code>:\u00a0<strong>true<\/strong><\/li>\n<li><code>maxDaysToRescue<\/code>: The rescue window, in days. You can specify between\u00a0<strong>1<\/strong>\u00a0and\u00a0<strong>42<\/strong> days. We recommend using a rescue window of one calendar month (<strong>30 days<\/strong>).<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-reference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">reference<\/a>&#58; Your unique reference for this\u00a0payment request.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-merchantOrderReference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">merchantOrderReference<\/a>&#58; Your unique order reference. For example, a concatenation of a unique shopper reference and the transaction date.<\/li>\n<li><code>paymentMethod.type<\/code>: <strong>sepadirectdebit<\/strong><\/li>\n<li><code>paymentMethod.sepa.ownerName<\/code>: The name on the SEPA bank account. For testing, use a concatenation of <code>chargeback<\/code> and <code>reasonCode<\/code>. See the example below.<\/li>\n<li><code>paymentMethod.sepa.ibanNumber<\/code>: The IBAN of the bank account. Make sure to not encrypt this value.<\/li>\n<\/ul>\n<p>The following example shows how to enable Auto Rescue for a SEPA shopper-not-present transaction submitted to the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> endpoint. In case of a chargeback, Auto Rescue will automatically retry this payment for a maximum of 30 days.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Enable Auto Rescue in payments request'\" :id=\"'enable-auto-rescue-in-payments-request-4562632474'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v68\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n   \\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n   \\&quot;reference\\&quot;:\\&quot;YOUR_MERCHANT_REFERENCE\\&quot;,\\n   \\&quot;merchantOrderReference\\&quot;:\\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;,\\n   \\&quot;shopperInteraction\\&quot;:\\&quot;ContAuth\\&quot;,\\n   \\&quot;amount\\&quot;:{\\n     \\&quot;currency\\&quot;:\\&quot;EUR\\&quot;,\\n     \\&quot;value\\&quot;:1000\\n   },\\n   \\&quot;paymentMethod\\&quot;:{\\n     \\&quot;type\\&quot;:\\&quot;sepadirectdebit\\&quot;,\\n     \\&quot;sepa.ownerName\\&quot;:\\&quot;chargeback:MS03\\&quot;,\\n     \\&quot;sepa.ibanNumber\\&quot;:\\&quot;DE87123456781234567890\\&quot;\\n   },\\n   \\&quot;additionalData\\&quot;:{\\n     \\&quot;autoRescue\\&quot;:\\&quot;true\\&quot;,\\n     \\&quot;maxDaysToRescue\\&quot;:\\&quot;30\\&quot;\\n   }\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v25.0.0\\nimport com.adyen.Client;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.checkout.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.model.RequestOptions;\\nimport com.adyen.service.checkout.*;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount()\\n  .currency(\\&quot;EUR\\&quot;)\\n  .value(1000L);\\n\\nSepaDirectDebitDetails sepaDirectDebitDetails = new SepaDirectDebitDetails()\\n  .type(SepaDirectDebitDetails.TypeEnum.SEPADIRECTDEBIT);\\n\\nPaymentRequest paymentRequest = new PaymentRequest()\\n  .reference(\\&quot;YOUR_MERCHANT_REFERENCE\\&quot;)\\n  .merchantOrderReference(\\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;)\\n  .amount(amount)\\n  .merchantAccount(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;)\\n  .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)\\n  .paymentMethod(new CheckoutPaymentMethod(sepaDirectDebitDetails))\\n  .additionalData(new HashMap&lt;String, String&gt;(Map.of(\\n    \\&quot;autoRescue\\&quot;, \\&quot;true\\&quot;,\\n    \\&quot;maxDaysToRescue\\&quot;, \\&quot;30\\&quot;\\n  )));\\n\\n\\\/\\\/ Make the API call\\nPaymentsApi service = new PaymentsApi(client);\\nPaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey(\\&quot;UUID\\&quot;));&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen PHP API Library v17.4.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Checkout\\\\Amount;\\nuse Adyen\\\\Model\\\\Checkout\\\\CheckoutPaymentMethod;\\nuse Adyen\\\\Model\\\\Checkout\\\\PaymentRequest;\\nuse Adyen\\\\Service\\\\Checkout\\\\PaymentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$amount = new Amount();\\n$amount\\n  -&gt;setCurrency(\\&quot;EUR\\&quot;)\\n  -&gt;setValue(1000);\\n\\n$checkoutPaymentMethod = new CheckoutPaymentMethod();\\n$checkoutPaymentMethod\\n  -&gt;setType(\\&quot;sepadirectdebit\\&quot;);\\n\\n$paymentRequest = new PaymentRequest();\\n$paymentRequest\\n  -&gt;setReference(\\&quot;YOUR_MERCHANT_REFERENCE\\&quot;)\\n  -&gt;setMerchantOrderReference(\\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;)\\n  -&gt;setAmount($amount)\\n  -&gt;setMerchantAccount(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setShopperInteraction(\\&quot;ContAuth\\&quot;)\\n  -&gt;setPaymentMethod($checkoutPaymentMethod)\\n  -&gt;setAdditionalData(\\n    array(\\n      \\&quot;autoRescue\\&quot; =&gt; \\&quot;true\\&quot;,\\n      \\&quot;maxDaysToRescue\\&quot; =&gt; \\&quot;30\\&quot;\\n    )\\n  );\\n\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Make the API call\\n$service = new PaymentsApi($client);\\n$response = $service-&gt;payments($paymentRequest, $requestOptions);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .net API Library v14.4.0\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Checkout;\\nusing Adyen.Service.Checkout;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nvar config = new Config()\\n{\\n    XApiKey = \\&quot;ADYEN_API_KEY\\&quot;,\\n    Environment = Environment.Test\\n};\\nvar client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount\\n{\\n  Currency = \\&quot;EUR\\&quot;,\\n  Value = 1000\\n};\\n\\nSepaDirectDebitDetails sepaDirectDebitDetails = new SepaDirectDebitDetails\\n{\\n  Type = SepaDirectDebitDetails.TypeEnum.Sepadirectdebit\\n};\\n\\nPaymentRequest paymentRequest = new PaymentRequest\\n{\\n  Reference = \\&quot;YOUR_MERCHANT_REFERENCE\\&quot;,\\n  MerchantOrderReference = \\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;,\\n  Amount = amount,\\n  MerchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,\\n  PaymentMethod = new CheckoutPaymentMethod(sepaDirectDebitDetails),\\n  AdditionalData = new Dictionary&lt;string, string&gt;\\n  {\\n\\n    { \\&quot;autoRescue\\&quot;, \\&quot;true\\&quot; },\\n    { \\&quot;maxDaysToRescue\\&quot;, \\&quot;30\\&quot; }\\n  }\\n};\\n\\n\\\/\\\/ Make the API call\\nvar service = new PaymentsService(client);\\nvar response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = \\&quot;UUID\\&quot;});&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v16.2.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst paymentRequest = {\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  reference: \\&quot;YOUR_MERCHANT_REFERENCE\\&quot;,\\n  merchantOrderReference: \\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;,\\n  shopperInteraction: \\&quot;ContAuth\\&quot;,\\n  amount: {\\n    currency: \\&quot;EUR\\&quot;,\\n    value: 1000\\n  },\\n  paymentMethod: {\\n    type: \\&quot;sepadirectdebit\\&quot;,\\n    \\&quot;sepa.ownerName\\&quot; : \\&quot;chargeback:MS03\\&quot;,\\n    \\&quot;sepa.ibanNumber\\&quot; : \\&quot;DE87123456781234567890\\&quot;\\n  },\\n  additionalData: {\\n    autoRescue: \\&quot;true\\&quot;,\\n    maxDaysToRescue: \\&quot;30\\&quot;\\n  }\\n}\\n\\n\\\/\\\/ Make the API call\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v9.3.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Create the request object(s)\\namount := checkout.Amount{\\n  Currency: \\&quot;EUR\\&quot;,\\n  Value: 1000,\\n}\\n\\nsepaDirectDebitDetails := checkout.SepaDirectDebitDetails{\\n  Type: common.PtrString(\\&quot;sepadirectdebit\\&quot;),\\n}\\n\\npaymentRequest := checkout.PaymentRequest{\\n  Reference: \\&quot;YOUR_MERCHANT_REFERENCE\\&quot;,\\n  MerchantOrderReference: common.PtrString(\\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;),\\n  Amount: amount,\\n  MerchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  ShopperInteraction: common.PtrString(\\&quot;ContAuth\\&quot;),\\n  PaymentMethod: checkout.SepaDirectDebitDetailsAsCheckoutPaymentMethod(&amp;sepaDirectDebitDetails),\\n  AdditionalData: &amp;map[string]string{\\n    \\&quot;autoRescue\\&quot;: \\&quot;true\\&quot;,\\n    \\&quot;maxDaysToRescue\\&quot;: \\&quot;30\\&quot;,\\n  },\\n}\\n\\n\\\/\\\/ Make the API call\\nservice := client.Checkout()\\nreq := service.PaymentsApi.PaymentsInput().IdempotencyKey(\\&quot;UUID\\&quot;).PaymentRequest(paymentRequest)\\nres, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.2.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Create the request object(s)\\njson_request = {\\n  \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_MERCHANT_REFERENCE\\&quot;,\\n  \\&quot;merchantOrderReference\\&quot;: \\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;,\\n  \\&quot;shopperInteraction\\&quot;: \\&quot;ContAuth\\&quot;,\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;: 1000\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;sepadirectdebit\\&quot;,\\n    \\&quot;sepa.ownerName\\&quot; : \\&quot;chargeback:MS03\\&quot;,\\n    \\&quot;sepa.ibanNumber\\&quot; : \\&quot;DE87123456781234567890\\&quot;\\n  },\\n  \\&quot;additionalData\\&quot;: {\\n    \\&quot;autoRescue\\&quot;: \\&quot;True\\&quot;,\\n    \\&quot;maxDaysToRescue\\&quot;: \\&quot;30\\&quot;\\n  }\\n}\\n\\n# Make the API call\\nresult = adyen.checkout.payments_api.payments(request=json_request, idempotency_key=\\&quot;UUID\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v9.3.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n  :reference =&gt; 'YOUR_MERCHANT_REFERENCE',\\n  :merchantOrderReference =&gt; 'YOUR_MERCHANT_ORDER_REFERENCE',\\n  :shopperInteraction =&gt; 'ContAuth',\\n  :amount =&gt; {\\n    :currency =&gt; 'EUR',\\n    :value =&gt; 1000\\n  },\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'sepadirectdebit',\\n    :sepa.ownerName =&gt; 'chargeback:MS03',\\n    :sepa.ibanNumber =&gt; 'DE87123456781234567890'\\n  },\\n  :additionalData =&gt; {\\n    :autoRescue =&gt; 'true',\\n    :maxDaysToRescue =&gt; '30'\\n  }\\n}\\n\\n# Make the API call\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v16.2.0\\n\\\/\\\/ Require the parts of the module you want to use\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst amount: Types.checkout.Amount = {\\n  currency: \\&quot;EUR\\&quot;,\\n  value: 1000\\n};\\n\\nconst sepaDirectDebitDetails: Types.checkout.SepaDirectDebitDetails = {\\n  type: Types.checkout.SepaDirectDebitDetails.TypeEnum.Sepadirectdebit\\n};\\n\\nconst paymentRequest: Types.checkout.PaymentRequest = {\\n  reference: \\&quot;YOUR_MERCHANT_REFERENCE\\&quot;,\\n  merchantOrderReference: \\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;,\\n  amount: amount,\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,\\n  paymentMethod: sepaDirectDebitDetails,\\n  additionalData: {\\n    \\&quot;autoRescue\\&quot;: \\&quot;true\\&quot;,\\n    \\&quot;maxDaysToRescue\\&quot;: \\&quot;30\\&quot;\\n  }\\n};\\n\\n\\\/\\\/ Make the API call\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>You will receive a response containing:<\/p>\n<ul>\n<li><code>resultCode<\/code>: <strong>Authorised<\/strong><\/li>\n<\/ul>\n<p><a id=\"payment-response\"><\/a><\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"additionalData\\\": {\\n        \\\"merchantOrderReference\\\": \\\"YOUR_MERCHANT_ORDER_REFERENCE\\\",\\n        \\\"retry.rescueReference\\\": \\\"8815658961765250\\\",\\n        ...\\n    },\\n    \\\"resultCode\\\": \\\"Authorised\\\",\\n    \\\"amount\\\": {\\n        \\\"currency\\\": \\\"EUR\\\",\\n        \\\"value\\\": 1000\\n    },\\n    \\\"merchantReference\\\": \\\"YOUR_MERCHANT_REFERENCE\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>In case the transaction is charged back, you will receive a webhook event containing:<\/p>\n<ul>\n<li><code>eventCode<\/code>:  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Webhooks\/latest\/post\/CHARGEBACK\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">CHARGEBACK<\/a><\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'CHARGEBACK webhook'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"notificationItems\\\": [\\n      {\\n        \\\"NotificationRequestItem\\\": {\\n            \\\"additionalData\\\": {\\n                \\\"chargebackReasonCode\\\": \\\"MS03\\\",\\n                \\\"modificationMerchantReferences\\\":\\\"\\\",\\n                \\\"retry.rescueReference\\\": \\\"8515659468351660\\\",\\n                \\\"merchantOrderReference\\\": \\\"YOUR_MERCHANT_ORDER_REFERENCE\\\",\\n                \\\"retry.rescueScheduled\\\": \\\"true\\\",\\n                \\\"chargebackSchemeCode\\\": \\\"sepadirectdebit\\\",\\n                \\\"defensePeriodEndsAt\\\":\\\"2021-03-05T02:59:46+01:00\\\",\\n                \\\"defendable\\\": \\\"false\\\",\\n                \\\"disputeStatus\\\": \\\"Lost\\\"\\n            },\\n            \\\"amount\\\": {\\n                \\\"currency\\\": \\\"EUR\\\",\\n                \\\"value\\\": 1000\\n            },\\n            \\\"eventCode\\\": \\\"CHARGEBACK\\\",\\n            \\\"eventDate\\\": \\\"2021-03-05T02:59:46+01:00\\\",\\n            \\\"merchantAccountCode\\\": \\\"YOUR_MERCHANT_ACCOUNT\\\",\\n            \\\"merchantReference\\\": \\\"YOUR_REFERENCE\\\",\\n            \\\"originalReference\\\": \\\"8515659468351660\\\",\\n            \\\"paymentMethod\\\": \\\"sepadirectdebit\\\",\\n            \\\"pspReference\\\": \\\"PPKFQ89R6QRXGN82\\\",\\n            \\\"reason\\\": \\\"MS03:NotSpecifiedReasonAgentGenerated\\\",\\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>The Auto Rescue process will attempt to rescue this transaction.<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"step-2-receive-auto-rescue-updates\">Step 2: Receive Auto Rescue updates<\/h2>\n<p>To update you on the Auto Rescue process, we send you a <a href=\"\/pt\/development-resources\/webhooks\">webhook event<\/a>. We send an event when:<\/p>\n<ul>\n<li>A rescue attempt was made, and it was:\n<ul>\n<li><a href=\"#retry-successful\">Successful<\/a><\/li>\n<li><a href=\"#retry-unsuccessful\">Unsuccessful<\/a><\/li>\n<\/ul><\/li>\n<li>The rescue process ended either because the payment was rescued, or the process was unsuccessful.<\/li>\n<\/ul>\n<p>You will receive the webhook 16 days after the rescue attempt.<\/p>\n<div class=\"notices blue\">\n<p>Before using Auto Rescue for live payments, we recommend that you <a href=\"#test-auto-rescue\">test how your integration handles these events<\/a>.<\/p>\n<\/div>\n<h3 id=\"retry-successful\">Retry attempt successful<\/h3>\n<p>If a retry attempt was successful, this means we didn't receive another chargeback within the specified rescue window and the Auto Rescue process ended, you will receive a webhook event with:<\/p>\n<ul>\n<li><code>eventCode<\/code>: <strong>AUTORESCUE<\/strong><\/li>\n<li><code>eventDate<\/code>: The date of the retry attempt.<\/li>\n<li><code>success<\/code>: <strong>true<\/strong><\/li>\n<li><code>reason<\/code>: <strong>retryWindowHasElapsed<\/strong><\/li>\n<\/ul>\n<p>Here's an example of the Auto Rescue process end webhook event.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'AUTORESCUE webhook event for a successful retry'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n  \\\"notificationItems\\\": [\\n    {\\n        \\\"NotificationRequestItem\\\": {\\n            \\\"additionalData\\\": {\\n                \\\"retry.rescueReference\\\": \\\"8815658961765250\\\",\\n                \\\"merchantOrderReference\\\": \\\"YOUR_MERCHANT_ORDER_REFERENCE\\\"\\n            },\\n            \\\"amount\\\": {\\n                \\\"currency\\\": \\\"EUR\\\",\\n                \\\"value\\\": 1000\\n            },\\n            \\\"eventCode\\\": \\\"AUTORESCUE\\\",\\n            \\\"eventDate\\\": \\\"2021-03-06T05:00:46+01:00\\\",\\n            \\\"merchantAccountCode\\\": \\\"YOUR_MERCHANT_ACCOUNT\\\",\\n            \\\"merchantReference\\\": \\\"YOUR_REFERENCE\\\",\\n            \\\"originalReference\\\": \\\"8815658961765250\\\",\\n            \\\"pspReference\\\": \\\"R8QTPCQ8HXSKGK82\\\",\\n            \\\"reason\\\": \\\"retryWindowHasElapsed\\\",\\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>If we received another chargeback but the second retry was successful, the process ends and you will receive a webhook event with:<\/p>\n<ul>\n<li><code>eventCode<\/code>: <strong>AUTORESCUE<\/strong><\/li>\n<li><code>eventDate<\/code>: The date of the retry attempt.<\/li>\n<li><code>success<\/code>: <strong>true<\/strong><\/li>\n<li><code>reason<\/code>: <strong>maxRetryAttemptsReached<\/strong><\/li>\n<\/ul>\n<p>Here's an example of the Auto Rescue process end webhook event.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'AUTORESCUE webhook event for a successful second retry'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n  \\\"notificationItems\\\": [\\n    {\\n        \\\"NotificationRequestItem\\\": {\\n            \\\"additionalData\\\": {\\n                \\\"retry.rescueReference\\\": \\\"8515572949781132\\\",\\n                \\\"merchantOrderReference\\\": \\\"YOUR_MERCHANT_ORDER_REFERENCE\\\"\\n            },\\n            \\\"amount\\\": {\\n                \\\"currency\\\": \\\"EUR\\\",\\n                \\\"value\\\": 1000\\n            },\\n            \\\"eventCode\\\": \\\"AUTORESCUE\\\",\\n            \\\"eventDate\\\": \\\"2021-03-07T04:57:38+01:00\\\",\\n            \\\"merchantAccountCode\\\": \\\"YOUR_MERCHANT_ACCOUNT\\\",\\n            \\\"merchantReference\\\": \\\"YOUR_REFERENCE\\\",\\n            \\\"originalReference\\\": \\\"8515572949781132\\\",\\n            \\\"pspReference\\\": \\\"QJCMPCQ8HXSKGK82\\\",\\n            \\\"reason\\\": \\\"maxRetryAttemptsReached\\\",\\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>You can view how much revenue has been recovered with Auto Rescue in your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>, under <strong>Reports<\/strong>. Search for the <strong>RevenueAccelerate<\/strong> report.<\/p>\n<h3 id=\"retry-unsuccessful\">Retry attempt unsuccessful<\/h3>\n<p>If a retry attempt was unsuccessful, this means we received chargebacks after each of the two retry attempts. You will receive a webhook event with:<\/p>\n<ul>\n<li><code>eventCode<\/code>: <strong>AUTORESCUE<\/strong><\/li>\n<li><code>eventDate<\/code>: The date of the retry attempt.<\/li>\n<li><code>success<\/code>: <strong>false<\/strong><\/li>\n<li><code>reason<\/code>: <strong>maxRetryAttemptsReached<\/strong><\/li>\n<\/ul>\n<p>Here's an example of the Auto Rescue process end webhook event.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'AUTORESCUE webhook event for an unsuccessful retry attempt'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n  \\\"notificationItems\\\": [\\n    {\\n        \\\"NotificationRequestItem\\\": {\\n            \\\"additionalData\\\": {\\n                \\\"retry.rescueReference\\\": \\\"8515659468351668\\\",\\n                \\\"merchantOrderReference\\\": \\\"YOUR_MERCHANT_ORDER_REFERENCE\\\"\\n            },\\n            \\\"amount\\\": {\\n                \\\"currency\\\": \\\"EUR\\\",\\n                \\\"value\\\": 1000\\n            },\\n            \\\"eventCode\\\": \\\"AUTORESCUE\\\",\\n            \\\"eventDate\\\": \\\"2021-03-07T04:57:38+01:00\\\",\\n            \\\"merchantAccountCode\\\": \\\"YOUR_MERCHANT_ACCOUNT\\\",\\n            \\\"merchantReference\\\": \\\"YOUR_REFERENCE\\\",\\n            \\\"originalReference\\\": \\\"8515659468351668\\\",\\n            \\\"pspReference\\\": \\\"HWL5D5BDLSGLNK82\\\",\\n            \\\"reason\\\": \\\"maxRetryAttemptsReached\\\",\\n            \\\"success\\\": \\\"false\\\"\\n        }\\n    }\\n  ]\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"send-a-payment-link\">Send a payment link<\/h2>\n<p>In case the Auto Rescue process ended unsuccessfully, you can optionally use <a href=\"\/pt\/unified-commerce\/pay-by-link\">Pay by Link<\/a> to send the shopper a payment link so they can still proceed with the payment, for example, using other payment method.<\/p>\n<p>To activate Pay by Link for Auto Rescue, contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a>.<\/p>\n<p>After we activate the feature, you will receive additional data fields in the Auto Rescue process end webhook:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/post\/paymentLinks\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">paymentLink.url<\/a> \u2014 The URL where the shopper can complete the payment. Valid for 5 days.<\/li>\n<li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/post\/paymentLinks\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">paymentLink.expiresAt<\/a> \u2014 The date when the payment link expires, in <a href=\"https:\/\/www.iso.org\/iso-8601-date-and-time-format.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">ISO 8601<\/a> format. For example, <code>2019-11-23T12:25:28Z<\/code> or <code>2020-05-27T20:25:28+08:00<\/code>.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'AUTORESCUE webhook with payment link'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"live\\\":\\\"false\\\",\\n   \\\"notificationItems\\\":[\\n      {\\n         \\\"NotificationRequestItem\\\":{\\n            \\\"additionalData\\\":{\\n               \\\"retry.rescueReference\\\":\\\"88HH88HH88HH88HH\\\",\\n               \\\"merchantOrderReference\\\":\\\"Cust12345_Nov19\\\",\\n               \\\"paymentLink.url\\\": \\\"https:\\\/\\\/test.adyen.link\\\/PL8F7CCDDCCB904770\\\",\\n               \\\"paymentLink.expiresAt\\\": \\\"2021-05-26T12:51:14Z\\\"\\n            },\\n            \\\"amount\\\":{\\n               \\\"currency\\\":\\\"USD\\\",\\n               \\\"value\\\":1000\\n            },\\n            \\\"eventCode\\\":\\\"AUTORESCUE\\\",\\n            \\\"eventDate\\\":\\\"2019-11-11T12:00:01+01:00\\\",\\n            \\\"merchantAccountCode\\\":\\\"YOUR_MERCHANT_ACCOUNT\\\",\\n            \\\"success\\\":\\\"false\\\",\\n            \\\"originalReference\\\":\\\"812872049382471H\\\",\\n            \\\"pspReference\\\":\\\"GH4R4RBFJGXXGN82\\\",\\n            \\\"reason\\\":\\\"maxRetryAttemptsReached\\\"\\n         }\\n      }\\n   ]\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>When the shopper has paid with Pay by Link, you receive an <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/MockNotificationService\/latest\/post\/AUTHORISATION\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">AUTHORISATION<\/a> webhook event with:<\/p>\n<ul>\n<li><code>shopperReference<\/code>: The payment details used by the shopper.<\/li>\n<li><code>storedPaymentMethodId<\/code>: The token you can use for the next subscription renewal. For more information, refer to <a href=\"\/pt\/online-payments\/tokenization\">Tokenization<\/a>.<\/li>\n<\/ul>\n<h2 id=\"cancel-auto-rescue-process\">Cancel Auto Rescue<\/h2>\n<p>While a payment is in the Auto Rescue process, your shopper may provide you with a new payment method, or cancel their subscription. In these scenarios, you should cancel the Auto Rescue process for the charged back payment.<\/p>\n<p>To cancel the Auto Rescue process:<\/p>\n<ol>\n<li>\n<p>Make a\u00a0<a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/Payment\/cancel\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/cancel<\/a>\u00a0request, specifying:\u00a0<\/p>\n<ul>\n<li><code>originalReference<\/code>: The <code>rescueReference<\/code> that you received in the <a href=\"#payment-response\">payment response<\/a>.<\/li>\n<li><code>cancellationType<\/code>: <strong>autoRescue<\/strong><\/li>\n<\/ul>\n<p>The following example shows how to cancel the Auto Rescue process for a payment with a <code>rescueReference<\/code> of <strong>865497581465325B<\/strong>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Cancel Auto Rescue'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/pal-test.adyen.com\\\/pal\\\/servlet\\\/Payment\\\/v68\\\/cancel \\\\\\n-H 'x-api-key: YOUR_COMPANY_ACCOUNT_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n\\t\\t\\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n\\t\\t\\&quot;originalReference\\&quot;:\\&quot;865497581465325B\\&quot;,\\n\\t\\t\\&quot;additionalData\\&quot;:{\\n\\t\\t\\t\\&quot;cancellationType\\&quot;:\\&quot;autoRescue\\&quot;\\n\\t\\t}\\n\\t}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>You receive a\u00a0<a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/Payment\/cancel\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/cancel<\/a>\u00a0response containing:<\/p>\n<ul>\n<li><code>response<\/code>: <strong>[cancel-received]<\/strong><\/li>\n<li><code>pspReference<\/code>: The PSP reference associated with this <code>\/cancel<\/code> request. This is different from the PSP reference associated with the original payment request.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"\\t{\\n\\t    \\\"response\\\":\\\"[cancel-received]\\\",\\n\\t\\t\\\"pspReference\\\":\\\"XB7XNCQ8HXSKGK82\\\"\\n\\t}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>After we have processed your cancel request, you receive a webhook event with:<\/p>\n<ul>\n<li><code>eventCode<\/code>: <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Webhooks\/latest\/post\/CANCEL_AUTORESCUE\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">CANCEL_AUTORESCUE<\/a><\/li>\n<li><code>success<\/code>: Indicates whether your request to cancel the rescue process was successful.<\/li>\n<li><code>merchantOrderReference<\/code>: Unique order reference that you provided in the payment request.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'CANCEL_AUTORESCUE webhook'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"\\t{\\n\\t   \\\"live\\\":\\\"false\\\",\\n\\t   \\\"notificationItems\\\":[\\n\\t      {\\n\\t         \\\"NotificationRequestItem\\\":{\\n               \\\"additionalData\\\":{\\n                  \\\"merchantOrderReference\\\":\\\"Cust12345_Nov19\\\"\\n               },\\n\\t            \\\"amount\\\":{\\n\\t               \\\"currency\\\":\\\"USD\\\",\\n\\t               \\\"value\\\":1000\\n\\t            },\\n\\t            \\\"eventCode\\\":\\\"CANCEL_AUTORESCUE\\\",\\n\\t            \\\"eventDate\\\": \\\"2019-04-05T09:08:05+01:00\\\",\\n\\t            \\\"merchantAccountCode\\\":\\\"YOUR_MERCHANT_ACCOUNT\\\",\\n\\t            \\\"success\\\":\\\"true\\\",\\n\\t            \\\"originalReference\\\":\\\"88HH88HH88HH88HH\\\",\\n\\t            \\\"pspReference\\\":\\\"BB7XNCQ8HXSKGK82\\\",\\n\\t            ...\\n\\t         }\\n\\t      }\\n\\t   ]\\n\\t}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h2 id=\"test-auto-rescue\">Test Auto Rescue and go live<\/h2>\n<p>Before flagging live payments for Auto Rescue, we recommend that you test how your integration handles scenarios involving <a href=\"#step-2-receive-auto-rescue-updates\">Auto Rescue updates<\/a>.<\/p>\n<p>To simulate scenarios involving Auto Rescue updates:<\/p>\n<ol>\n<li>\n<p>Make a test  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request that is <a href=\"#step-1-enable-auto-rescue\">flagged for Auto Rescue<\/a>. In the request, additionally provide:<\/p>\n <ul>\n<li><code>autoRescueSepaScenario<\/code>: Set this to the scenario you want to test:\n<ul>\n<li><strong>AutoRescueSuccessfulFirst<\/strong>: The payment is authorized but we received a chargeback. The first retry attempt is successful because we received no chargeback after this attempt within 30 days.<\/li>\n<li><strong>AutoRescueSuccessfulSecond<\/strong>: The payment is authorized but we received a chargeback. The first retry attempt is authorized but we received a second chargeback. The second retry attempt is successful because we received no chargeback after this attempt within 30 days.<\/li>\n<li><strong>AutoRescueFailed<\/strong>: The payment and all retry attempts are authorized, but we received chargebacks after each attempt.<\/li>\n<\/ul><\/li>\n<\/ul>\n<ul>\n<li><code>ownerName<\/code>: Set this to the type of chargeback that you want to simulate. Use a concatenation of <code>chargeback<\/code> and the reason code. For example, <strong>chargeback:MS03<\/strong> or <strong>chargeback:AM04<\/strong>.\n<\/li>\n<\/ul>\n<p>The example below shows how to test a scenario, with the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> endpoint, where the second retry attempt is successful:<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Test successful second retry attempt'\" :id=\"'2'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v68\\\/payments \\\\\\n-H 'x-api-key: YOUR_COMPANY_ACCOUNT_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n     \\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n     \\&quot;reference\\&quot;:\\&quot;YOUR_MERCHANT_REFERENCE\\&quot;,\\n     \\&quot;merchantOrderReference\\&quot;:\\&quot;YOUR_MERCHANT_ORDER_REFERENCE\\&quot;,\\n     \\&quot;shopperInteraction\\&quot;:\\&quot;ContAuth\\&quot;,\\n     \\&quot;amount\\&quot;:{\\n        \\&quot;currency\\&quot;:\\&quot;EUR\\&quot;,\\n        \\&quot;value\\&quot;:1000\\n     },\\n     \\&quot;paymentMethod\\&quot;:{\\n        \\&quot;type\\&quot;:\\&quot;sepadirectdebit\\&quot;,\\n        \\&quot;sepa.ownerName\\&quot;:\\&quot;chargeback:MS03\\&quot;,\\n        \\&quot;sepa.ibanNumber\\&quot;:\\&quot;DE87123456781234567890\\&quot;\\n     },\\n     \\&quot;additionalData\\&quot;:{\\n        \\&quot;autoRescue\\&quot;:\\&quot;true\\&quot;,\\n        \\&quot;maxDaysToRescue\\&quot;:\\&quot;30\\&quot;,\\n        \\&quot;autoRescueSepaScenario\\&quot;:\\&quot;AutoRescueSuccessfulSecond\\&quot;\\n    }\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<!-- list separator -->\n<\/li>\n<li>\n<p>You receive <a href=\"#step-2-receive-auto-rescue-updates\">Auto Rescue updates<\/a> corresponding to the scenario you are testing. If this scenario involves multiple retry attempts, these Auto Rescue updates will occur several minutes apart.<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"auto-rescue-reports\">Auto Rescue reports<\/h2>\n<p>Each Auto Rescue retry attempt is a separate transaction, and thus generates a unique <code>pspReference<\/code>. If you want to see all payments initiated by Auto Rescue, we can add the <strong>Payment Requester Type<\/strong> column to your <a href=\"\/pt\/reporting\/received-payment-details-report\">Received payment details report<\/a>. Contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> or your Adyen Account Manager to configure this for you.<\/p>\n<p>To connect an Auto Rescue retry attempt to a payment request, use the value in the <strong>Merchant Order Reference<\/strong> column. This corresponds to <code>merchantOrderReference<\/code> you provided in the payment request. We can add <strong>Merchant Order Reference<\/strong> to the following reports:<\/p>\n<ul>\n<li><a href=\"\/pt\/reporting\/received-payment-details-report\">Received payment details report<\/a><\/li>\n<li><a href=\"\/pt\/reporting\/settlement-detail-report\">Settlement Detail Report<\/a><\/li>\n<li><a href=\"\/pt\/reporting\/invoice-reconciliation\/payment-accounting-report\">Payments Accounting Report<\/a><\/li>\n<\/ul>\n<p>Contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> or your Adyen Account Manager to configure this for you.<\/p>\n<div class=\"notices yellow\">\n<p>If you did not provide <code>merchantOrderReference<\/code> in the payment request, we automatically populate the <strong>Merchant Order Reference<\/strong> column with <code>pspReference<\/code> of the payment request.<\/p>\n<\/div>\n<h3>Example<\/h3>\n<p>The following example represents two payment requests with <code>merchantOrderReference<\/code> <strong>A1<\/strong> and <strong>A2<\/strong>.<\/p>\n<ul>\n<li><strong>A1<\/strong>: The payment was rescued on the first retry attempt.<\/li>\n<li><strong>A2<\/strong>: The payment was rescued on the second retry attempt.<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Transaction<\/th>\n<th style=\"text-align: left;\">PSP Reference<\/th>\n<th style=\"text-align: left;\">Merchant Order Reference<\/th>\n<th style=\"text-align: left;\">Record Type<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">November monthly subscription payment<\/td>\n<td style=\"text-align: left;\">812872049382471H<\/td>\n<td style=\"text-align: left;\">A1<\/td>\n<td style=\"text-align: left;\">Chargeback<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">1st retry attempt<\/td>\n<td style=\"text-align: left;\">814987049386784P<\/td>\n<td style=\"text-align: left;\">A1<\/td>\n<td style=\"text-align: left;\">Authorised<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">December monthly subscription payment<\/td>\n<td style=\"text-align: left;\">812872049382471H<\/td>\n<td style=\"text-align: left;\">A2<\/td>\n<td style=\"text-align: left;\">Chargeback<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">1st retry attempt<\/td>\n<td style=\"text-align: left;\">804938149876784D<\/td>\n<td style=\"text-align: left;\">A2<\/td>\n<td style=\"text-align: left;\">Chargeback<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">2nd retry attempt<\/td>\n<td style=\"text-align: left;\">804938149950514L<\/td>\n<td style=\"text-align: left;\">A2<\/td>\n<td style=\"text-align: left;\">Authorised<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/development-resources\/refusal-reasons\"\n                        target=\"_self\"\n                        >\n                    Refusal reasons\n                <\/a><\/li><li><a href=\"\/development-resources\/webhooks\"\n                        target=\"_self\"\n                        >\n                    Webhooks\n                <\/a><\/li><li><a href=\"\/risk-management\/understanding-disputes\"\n                        target=\"_self\"\n                        >\n                    Understanding disputes\n                <\/a><\/li><li><a href=\"\/risk-management\/chargeback-guidelines\/sepa-chargebacks\"\n                        target=\"_self\"\n                        >\n                    SEPA chargebacks\n                <\/a><\/li><li><a href=\"\/reporting\/received-payment-details-report\"\n                        target=\"_self\"\n                        >\n                    Received payment details report\n                <\/a><\/li><li><a href=\"\/unified-commerce\/pay-by-link\"\n                        target=\"_self\"\n                        >\n                    Pay by Link\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/online-payments\/auto-rescue\/sepa","articleFields":{"description":"Automatically retry shopper-not-present direct debit transactions when they are refused.","id":"47482757","type":"page","cache_enable":false,"_expandable":{"operations":""},"feedback_component":true,"page_id":"c4ad58c2-2e91-4107-9101-1669ded9ed34","filters_component":false,"decision_tree":"[]"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/online-payments\/auto-rescue\/sepa","title":"Auto Rescue for SEPA payments","content":"Besides Auto Rescue for card transactions, we support rescuing SEPA transactions. Because SEPA transactions always have eventCode AUTHORISED in the response, these require a different rescue logic compared to card transactions.\nWe apply our rescue logic on two chargeback reasons for SEPA.\n\nAM04: Insufficient funds\nMS03: No reason specified. This code is used in some countries\/regions instead of AM04.\n\nAlso note that for SEPA payments, we have a maximum of two rescue attempts within the rescue window. The reasons for that are:\n\nThe period between the initial transaction and the first decline message is longer than for card transactions. This means we have fewer days left to rescue the transaction.\nBecause chargebacks are typically fined by the issuing bank, it is important to keep the number of rescue attempts low.\n\nOn this page, you will learn how to:\n\nEnable Auto Rescue for SEPA transactions.\nReceive updates on the Auto Rescue process.\n\nWe also explain how you can:\n\nSend a payment link when the Auto Rescue process ends unsuccessfully.\nCancel the Auto Rescue process for a payment.\nTest how your integration handles Auto Rescue updates.\nReconcile retry attempts in Adyen generated reports.\n\nHow it works\n\nStep 1: Enable Auto Rescue\nYou can enable Auto Rescue for SEPA payments at:\n\nAccount level\nTransaction level.\n\nEnable at account level\nTo enable Auto Rescue for all qualifying SEPA payments, contact our Support Team or your Adyen Account Manager to configure this for you.\n\nThe rescue window is set to 42 days. If you want to use a different rescue window, enable Auto Rescue for SEPA payments at transaction level.\n\nEnable at transaction level\nTo enable Auto Rescue for SEPA payments on transaction level, contact our Support Team or your Adyen Account Manager to configure this for you.\nWhen configured, to enable Auto Rescue for a SEPA transaction in your payment request:\n\nAdd the autoRescue flag.\nSubmit a unique merchantOrderReference. This reference represents a specific billing cycle or subscription and will appear in any Auto Rescue updates or reports. You can connect any Auto Rescue retry attempt to the original  \/payments request using this reference.\n\nFor example:\n\n\nMake a  \/payments request, and specify:\n\n shopperInteraction&#58; ContAuth\nautoRescue:\u00a0true\nmaxDaysToRescue: The rescue window, in days. You can specify between\u00a01\u00a0and\u00a042 days. We recommend using a rescue window of one calendar month (30 days).\n reference&#58; Your unique reference for this\u00a0payment request.\n merchantOrderReference&#58; Your unique order reference. For example, a concatenation of a unique shopper reference and the transaction date.\npaymentMethod.type: sepadirectdebit\npaymentMethod.sepa.ownerName: The name on the SEPA bank account. For testing, use a concatenation of chargeback and reasonCode. See the example below.\npaymentMethod.sepa.ibanNumber: The IBAN of the bank account. Make sure to not encrypt this value.\n\nThe following example shows how to enable Auto Rescue for a SEPA shopper-not-present transaction submitted to the  \/payments endpoint. In case of a chargeback, Auto Rescue will automatically retry this payment for a maximum of 30 days.\n\n\n\nYou will receive a response containing:\n\nresultCode: Authorised\n\n\n\n\n\nIn case the transaction is charged back, you will receive a webhook event containing:\n\neventCode:  CHARGEBACK\n\n\n\n\nThe Auto Rescue process will attempt to rescue this transaction.\n\n\nStep 2: Receive Auto Rescue updates\nTo update you on the Auto Rescue process, we send you a webhook event. We send an event when:\n\nA rescue attempt was made, and it was:\n\nSuccessful\nUnsuccessful\n\nThe rescue process ended either because the payment was rescued, or the process was unsuccessful.\n\nYou will receive the webhook 16 days after the rescue attempt.\n\nBefore using Auto Rescue for live payments, we recommend that you test how your integration handles these events.\n\nRetry attempt successful\nIf a retry attempt was successful, this means we didn't receive another chargeback within the specified rescue window and the Auto Rescue process ended, you will receive a webhook event with:\n\neventCode: AUTORESCUE\neventDate: The date of the retry attempt.\nsuccess: true\nreason: retryWindowHasElapsed\n\nHere's an example of the Auto Rescue process end webhook event.\n\n    \n\nIf we received another chargeback but the second retry was successful, the process ends and you will receive a webhook event with:\n\neventCode: AUTORESCUE\neventDate: The date of the retry attempt.\nsuccess: true\nreason: maxRetryAttemptsReached\n\nHere's an example of the Auto Rescue process end webhook event.\n\n    \n\nYou can view how much revenue has been recovered with Auto Rescue in your Customer Area, under Reports. Search for the RevenueAccelerate report.\nRetry attempt unsuccessful\nIf a retry attempt was unsuccessful, this means we received chargebacks after each of the two retry attempts. You will receive a webhook event with:\n\neventCode: AUTORESCUE\neventDate: The date of the retry attempt.\nsuccess: false\nreason: maxRetryAttemptsReached\n\nHere's an example of the Auto Rescue process end webhook event.\n\n    \n\nSend a payment link\nIn case the Auto Rescue process ended unsuccessfully, you can optionally use Pay by Link to send the shopper a payment link so they can still proceed with the payment, for example, using other payment method.\nTo activate Pay by Link for Auto Rescue, contact our Support Team.\nAfter we activate the feature, you will receive additional data fields in the Auto Rescue process end webhook:\n\npaymentLink.url \u2014 The URL where the shopper can complete the payment. Valid for 5 days.\npaymentLink.expiresAt \u2014 The date when the payment link expires, in ISO 8601 format. For example, 2019-11-23T12:25:28Z or 2020-05-27T20:25:28+08:00.\n\n\n    \n\nWhen the shopper has paid with Pay by Link, you receive an AUTHORISATION webhook event with:\n\nshopperReference: The payment details used by the shopper.\nstoredPaymentMethodId: The token you can use for the next subscription renewal. For more information, refer to Tokenization.\n\nCancel Auto Rescue\nWhile a payment is in the Auto Rescue process, your shopper may provide you with a new payment method, or cancel their subscription. In these scenarios, you should cancel the Auto Rescue process for the charged back payment.\nTo cancel the Auto Rescue process:\n\n\nMake a\u00a0\/cancel\u00a0request, specifying:\u00a0\n\noriginalReference: The rescueReference that you received in the payment response.\ncancellationType: autoRescue\n\nThe following example shows how to cancel the Auto Rescue process for a payment with a rescueReference of 865497581465325B.\n\n\n\n\n\nYou receive a\u00a0\/cancel\u00a0response containing:\n\nresponse: [cancel-received]\npspReference: The PSP reference associated with this \/cancel request. This is different from the PSP reference associated with the original payment request.\n\n\n\n\nAfter we have processed your cancel request, you receive a webhook event with:\n\neventCode: CANCEL_AUTORESCUE\nsuccess: Indicates whether your request to cancel the rescue process was successful.\nmerchantOrderReference: Unique order reference that you provided in the payment request.\n\n\n\n\n\n\nTest Auto Rescue and go live\nBefore flagging live payments for Auto Rescue, we recommend that you test how your integration handles scenarios involving Auto Rescue updates.\nTo simulate scenarios involving Auto Rescue updates:\n\n\nMake a test  \/payments request that is flagged for Auto Rescue. In the request, additionally provide:\n \nautoRescueSepaScenario: Set this to the scenario you want to test:\n\nAutoRescueSuccessfulFirst: The payment is authorized but we received a chargeback. The first retry attempt is successful because we received no chargeback after this attempt within 30 days.\nAutoRescueSuccessfulSecond: The payment is authorized but we received a chargeback. The first retry attempt is authorized but we received a second chargeback. The second retry attempt is successful because we received no chargeback after this attempt within 30 days.\nAutoRescueFailed: The payment and all retry attempts are authorized, but we received chargebacks after each attempt.\n\n\n\nownerName: Set this to the type of chargeback that you want to simulate. Use a concatenation of chargeback and the reason code. For example, chargeback:MS03 or chargeback:AM04.\n\n\nThe example below shows how to test a scenario, with the  \/payments endpoint, where the second retry attempt is successful:\n\n\n\n\n\n\nYou receive Auto Rescue updates corresponding to the scenario you are testing. If this scenario involves multiple retry attempts, these Auto Rescue updates will occur several minutes apart.\n\n\nAuto Rescue reports\nEach Auto Rescue retry attempt is a separate transaction, and thus generates a unique pspReference. If you want to see all payments initiated by Auto Rescue, we can add the Payment Requester Type column to your Received payment details report. Contact our Support Team or your Adyen Account Manager to configure this for you.\nTo connect an Auto Rescue retry attempt to a payment request, use the value in the Merchant Order Reference column. This corresponds to merchantOrderReference you provided in the payment request. We can add Merchant Order Reference to the following reports:\n\nReceived payment details report\nSettlement Detail Report\nPayments Accounting Report\n\nContact our Support Team or your Adyen Account Manager to configure this for you.\n\nIf you did not provide merchantOrderReference in the payment request, we automatically populate the Merchant Order Reference column with pspReference of the payment request.\n\nExample\nThe following example represents two payment requests with merchantOrderReference A1 and A2.\n\nA1: The payment was rescued on the first retry attempt.\nA2: The payment was rescued on the second retry attempt.\n\n\n\n\nTransaction\nPSP Reference\nMerchant Order Reference\nRecord Type\n\n\n\n\nNovember monthly subscription payment\n812872049382471H\nA1\nChargeback\n\n\n1st retry attempt\n814987049386784P\nA1\nAuthorised\n\n\nDecember monthly subscription payment\n812872049382471H\nA2\nChargeback\n\n\n1st retry attempt\n804938149876784D\nA2\nChargeback\n\n\n2nd retry attempt\n804938149950514L\nA2\nAuthorised\n\n\n\nSee also\n\n\n                    Refusal reasons\n                \n                    Webhooks\n                \n                    Understanding disputes\n                \n                    SEPA chargebacks\n                \n                    Received payment details report\n                \n                    Pay by Link\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Auto Rescue","lvl3":"Auto Rescue for SEPA payments"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/online-payments","lvl2":"https:\/\/docs.adyen.com\/pt\/online-payments\/auto-rescue","lvl3":"\/pt\/online-payments\/auto-rescue\/sepa"},"levels":4,"category":"Online Payments","category_color":"green","tags":["Rescue","payments"]},"articleFiles":{"autorescue-sepa.svg":"<img alt=\"\" src=\"https:\/\/docs.adyen.com\/user\/pages\/docs\/02.online-payments\/23.auto-rescue\/02.sepa\/autorescue-sepa.svg?decoding=auto&amp;fetchpriority=auto\" \/>","enable-auto-rescue-in-payments-request-4562632474.js":"<p alt=\"\">enable-auto-rescue-in-payments-request-4562632474.js<\/p>"}}
