{"title":"TWINT for API only","category":"default","creationDate":1776961628,"content":"<p>You can add TWINT to your existing integration. The following instructions show only what you must add to your integration specifically for TWINT.<\/p>\n<p>If an instruction on this page corresponds with a step in the main integration guide, it includes a link to that corresponding step of the main integration guide.<\/p>\n<h2>Requirements<\/h2>\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;\">Make sure that you have an existing <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only\">API-only integration<\/a>.<\/td>\n<td> <\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Action handling<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that your existing integration is set up to <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#additional-action\">handle the additional action<\/a>. <br> <code>action.type<\/code>: <strong>redirect<\/strong> or <strong>sdk<\/strong>.<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\"> Before you begin, <a href=\"\/pt\/payment-methods\/add-payment-methods\">add TWINT in your Customer Area<\/a>. <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How it works<\/h2>\n<ol>\n<li>The shopper selects TWINT as the payment method.<\/li>\n<li>The shopper enters their details in the <a href=\"#build-your-payment-form\">payment form that you build<\/a>.<\/li>\n<li>The shopper is redirected to a TWINT hosted payment page<\/li>\n<li>The shopper authorizes the payment in the TWINT app.<\/li>\n<\/ol>\n<h2 id=\"build-your-payment-form\">Build your payment form<\/h2>\n<p>Include TWINT in the list of available payment methods. You do not need to collect any information from the shopper in your payment form.<\/p>\n<div class=\"notices green\">\n<p>You can <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%2Bonly&amp;version=71#downloading-logos\">download the logo for TWINT<\/a> to use in your form.<\/p>\n<\/div>\n<h2>Get TWINT as an available payment method<\/h2>\n<p>When you make the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> to <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#get-available-payment-methods\">get available payment methods<\/a>, specify the following so that TWINT is included in the response.<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Values<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-countryCode\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">countryCode<\/a><\/td>\n<td><span translate=\"no\"><strong><strong>CH<\/strong><\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-amount-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.currency<\/a><\/td>\n<td><span translate=\"no\"><strong><strong>CHF<\/strong><\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example request for available payment methods'\" :id=\"'payment-methods-request'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/paymentMethods \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST\\n-d '{\\n   \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n   \\&quot;countryCode\\&quot;: \\&quot;CH\\&quot;,\\n   \\&quot;amount\\&quot;: {\\n      \\&quot;currency\\&quot;: \\&quot;CHF\\&quot;,\\n\\t  \\&quot;value\\&quot;: 1000\\n   },\\n   \\&quot;shopperLocale\\&quot;: \\&quot;ch-CH\\&quot;\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example response with TWINT available'\" :id=\"'payment-methods-response'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"paymentMethods\\\": [\\n        {\\n            \\\"name\\\": \\\"TWINT\\\",\\n            \\\"type\\\": \\\"twint\\\"\\n        }\\n    ]\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"additional-parameters-payments\">Add additional parameters to your \/payments request<\/h2>\n<p>You do not need to add any additional parameters when you <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#make-a-payment\">make a payment<\/a>.<\/p>\n<h2 id=\"capture-the-payment\">Capture the payment<\/h2>\n<p>By default, TWINT payments are captured automatically. This means that the <strong>Capture Delay<\/strong> setting in your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a> is set to <strong>Immediate<\/strong> or <strong>1\u20137 days<\/strong>.<\/p>\n<p>In case <strong>Capture Delay<\/strong> is set to <strong>Manual<\/strong>, then you need to <a href=\"\/pt\/online-payments\/capture#manual-capture\">manually capture the payment<\/a>. The authorization for TWINT payments expires after 7 days, so make sure you capture the payment before then.<\/p>\n<h3 id=\"partial-capture\">Partial capture<\/h3>\n<p>TWINT supports partial capture, but not multiple partial captures. To <a href=\"\/pt\/online-payments\/capture\">partially capture<\/a> a TWINT payment, specify in your\u00a0 <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/captures\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/{paymentPspReference}\/captures<\/a>  request:<\/p>\n<ul>\n<li><code>modificationAmount<\/code>: The amount that the shopper should pay.<\/li>\n<\/ul>\n<p>The following example shows how to make a partial capture request:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'\/capture request'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"reference\\\":\\\"PSP_REFERENCE\\\",\\n   \\\"amount\\\":{\\n      \\\"value\\\":\\\"2500\\\",\\n      \\\"currency\\\":\\\"CHF\\\"\\n   },\\n   \\\"merchantAccount\\\":\\\"YOUR_MERCHANT ACCOUNT\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>Any unclaimed amount that is left over after partially capturing a payment is automatically cancelled.<\/p>\n<h2>Recurring payments<\/h2>\n<p>To make recurring payments for TWINT, you need to:<\/p>\n<ol>\n<li><a href=\"#create-a-token\">Create a shopper token<\/a>.<\/li>\n<li><a href=\"#make-payment-with-token\">Use the token to make future payments for the shopper<\/a>.<\/li>\n<\/ol>\n<h3 id=\"create-a-token\">Create a token<\/h3>\n<p>To create a token, include in your  <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:<\/p>\n<ul>\n<li><code>storePaymentMethod<\/code>: <strong>true<\/strong><\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperReference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperReference<\/a>&#58; Your unique identifier for the shopper (minimum length three characters).<\/li>\n<\/ul>\n<p>When the payment details have been stored, you receive a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Tokenization-webhooks\/latest\/post\/recurring.token.created\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">recurring.token.created<\/a> <a href=\"\/pt\/development-resources\/webhooks\">webhook<\/a> containing:<\/p>\n<ul>\n<li><code>type<\/code>: <strong>recurring.token.created<\/strong><\/li>\n<li><code>shopperReference<\/code>: your unique identifier for the shopper.<\/li>\n<li><code>eventId<\/code>: the <code>pspReference<\/code> of the initial payment.<\/li>\n<li><code>storedPaymentMethodId<\/code>: the token that you need to make recurring payments for this shopper.<\/li>\n<\/ul>\n<div class=\"notices green\">\n<p>Make sure that your server is able to receive the <a href=\"\/pt\/development-resources\/webhooks\/webhook-types\/#other-webhooks\">Recurring tokens life cycle events<\/a> webhook. You can <a href=\"\/pt\/development-resources\/webhooks\/#set-up-webhooks-in-your-customer-area\">set up this webhook in your Customer Area<\/a>.<\/p>\n<\/div>\n<h3 id=\"make-payment-with-token\">Make a payment with a token<\/h3>\n<p>To make a payment with the token, include in your  <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:<\/p>\n<ul>\n<li>\n<p><code>paymentMethod.storedPaymentMethodId<\/code>: The <code>storedPaymentMethodId<\/code> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Tokenization-webhooks\/latest\/post\/recurring.token.created\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">recurring.token.created<\/a> webhook.<\/p>\n<div class=\"notices green\">\n<p>You can also get this value using the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Recurring\/latest\/post\/listRecurringDetails\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/listRecurringDetails<\/a> endpoint.<\/p>\n<\/div>\n<\/li>\n<li>\n<p><code>shopperReference<\/code>: The unique shopper identifier that you specified when creating the token (minimum length three characters).<\/p>\n<\/li>\n<li>\n<p><code>shopperInteraction<\/code>: <strong>ContAuth<\/strong>.<\/p>\n<\/li>\n<li>\n<p><code>recurringProcessingModel<\/code>: <strong>Subscription<\/strong> or <strong>UnscheduledCardOnFile<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<p>For more information about the <code>shopperInteraction<\/code> and <code>recurringProcessingModel<\/code> fields, refer to <a href=\"\/pt\/online-payments\/tokenization\/\">Tokenization<\/a>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'twint-recurring'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n   \\&quot;amount\\&quot;:{\\n      \\&quot;value\\&quot;:1000,\\n      \\&quot;currency\\&quot;:\\&quot;CHF\\&quot;\\n   },\\n   \\&quot;paymentMethod\\&quot;:{\\n      \\&quot;type\\&quot;:\\&quot;twint\\&quot;,\\n      \\&quot;storedPaymentMethodId\\&quot;:\\&quot;7219687191761347\\&quot;\\n   },\\n   \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n   \\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n   \\&quot;shopperReference\\&quot;:\\&quot;YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\\&quot;,\\n   \\&quot;shopperInteraction\\&quot;:\\&quot;ContAuth\\&quot;,\\n   \\&quot;recurringProcessingModel\\&quot;: \\&quot;Subscription\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v39.3.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, also include your liveEndpointUrlPrefix.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\n\\\/\\\/ Send the request\\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;&lt;?php\\n\\\/\\\/ Adyen PHP API Library v28.2.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Service\\\\Checkout\\\\PaymentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Send the request\\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 v32.1.1\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Checkout;\\nusing Adyen.Service.Checkout;\\n\\n\\\/\\\/ For the LIVE environment, also 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)\\n\\\/\\\/ Send the request\\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 v29.0.0\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nconst paymentRequest = {\\n  amount: {\\n    value: 1000,\\n    currency: \\&quot;CHF\\&quot;\\n  },\\n  paymentMethod: {\\n    type: \\&quot;twint\\&quot;,\\n    storedPaymentMethodId: \\&quot;7219687191761347\\&quot;\\n  },\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  shopperReference: \\&quot;YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\\&quot;,\\n  shopperInteraction: \\&quot;ContAuth\\&quot;,\\n  recurringProcessingModel: \\&quot;Subscription\\&quot;\\n}\\n\\n\\\/\\\/ Send the request\\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 v21.0.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the LIVE environment, also 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)\\n\\\/\\\/ Send the request\\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 v13.6.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the LIVE environment, also 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;amount\\&quot;: {\\n    \\&quot;value\\&quot;: 1000,\\n    \\&quot;currency\\&quot;: \\&quot;CHF\\&quot;\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;twint\\&quot;,\\n    \\&quot;storedPaymentMethodId\\&quot;: \\&quot;7219687191761347\\&quot;\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;shopperReference\\&quot;: \\&quot;YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\\&quot;,\\n  \\&quot;shopperInteraction\\&quot;: \\&quot;ContAuth\\&quot;,\\n  \\&quot;recurringProcessingModel\\&quot;: \\&quot;Subscription\\&quot;\\n}\\n\\n# Send the request\\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 v10.4.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the LIVE environment, also include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :amount =&gt; {\\n    :value =&gt; 1000,\\n    :currency =&gt; 'CHF'\\n  },\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'twint',\\n    :storedPaymentMethodId =&gt; '7219687191761347'\\n  },\\n  :reference =&gt; 'YOUR_ORDER_NUMBER',\\n  :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n  :shopperReference =&gt; 'YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j',\\n  :shopperInteraction =&gt; 'ContAuth',\\n  :recurringProcessingModel =&gt; 'Subscription'\\n}\\n\\n# Send the request\\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 v29.0.0\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\n\\\/\\\/ Send the request\\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<h2>Test and go live<\/h2>\n<p>Check the status of TWINT test payments in your\u00a0<a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>\u00a0&gt;\u00a0<strong>Transactions<\/strong>\u00a0&gt;\u00a0<strong>Payments<\/strong>.<\/p>\n<p>Before you can accept live TWINT payments, you need to <a href=\"\/pt\/payment-methods\/add-payment-methods\">submit a request for TWINT<\/a> in your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a>.<\/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=\"\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only\"\n                        target=\"_self\"\n                        >\n                    API-only integration guide\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/twint\/api-only","articleFields":{"description":"Add TWINT to your API-only integration.","never_cache_twig":true,"parameters":{"flow":"Advanced","integration_guide_url":"\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&integration=API%20only","payment_method":"TWINT","payment_method_type":"twint","payment_method_type_capitalized":"Twint","tx_variant":"twint","tx_variant_capitalized":"Twint","country_codes":"<strong>CH<\/strong>","currency_codes":"<strong>CHF<\/strong>","additional_api":"false","api_version":"none","action_type":"<strong>redirect<\/strong> or <strong>sdk<\/strong>","pm_directory":"twint","contact":"false"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/twint\/api-only","title":"TWINT for API only","content":"You can add TWINT to your existing integration. The following instructions show only what you must add to your integration specifically for TWINT.\nIf an instruction on this page corresponds with a step in the main integration guide, it includes a link to that corresponding step of the main integration guide.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have an existing API-only integration.\n \n\n\nAction handling\nMake sure that your existing integration is set up to handle the additional action.  action.type: redirect or sdk.\n\n\n\nSetup steps\n Before you begin, add TWINT in your Customer Area. \n\n\n\nHow it works\n\nThe shopper selects TWINT as the payment method.\nThe shopper enters their details in the payment form that you build.\nThe shopper is redirected to a TWINT hosted payment page\nThe shopper authorizes the payment in the TWINT app.\n\nBuild your payment form\nInclude TWINT in the list of available payment methods. You do not need to collect any information from the shopper in your payment form.\n\nYou can download the logo for TWINT to use in your form.\n\nGet TWINT as an available payment method\nWhen you make the  \/paymentMethods to get available payment methods, specify the following so that TWINT is included in the response.\n\n\n\nParameter\nValues\n\n\n\n\n countryCode\nCH\n\n\n amount.currency\nCHF\n\n\n\n\n    \n\n\n    \n\nAdd additional parameters to your \/payments request\nYou do not need to add any additional parameters when you make a payment.\nCapture the payment\nBy default, TWINT payments are captured automatically. This means that the Capture Delay setting in your Customer Area is set to Immediate or 1\u20137 days.\nIn case Capture Delay is set to Manual, then you need to manually capture the payment. The authorization for TWINT payments expires after 7 days, so make sure you capture the payment before then.\nPartial capture\nTWINT supports partial capture, but not multiple partial captures. To partially capture a TWINT payment, specify in your\u00a0 \/payments\/{paymentPspReference}\/captures  request:\n\nmodificationAmount: The amount that the shopper should pay.\n\nThe following example shows how to make a partial capture request:\n\n    \n\nAny unclaimed amount that is left over after partially capturing a payment is automatically cancelled.\nRecurring payments\nTo make recurring payments for TWINT, you need to:\n\nCreate a shopper token.\nUse the token to make future payments for the shopper.\n\nCreate a token\nTo create a token, include in your  \/payments request:\n\nstorePaymentMethod: true\n shopperReference&#58; Your unique identifier for the shopper (minimum length three characters).\n\nWhen the payment details have been stored, you receive a  recurring.token.created webhook containing:\n\ntype: recurring.token.created\nshopperReference: your unique identifier for the shopper.\neventId: the pspReference of the initial payment.\nstoredPaymentMethodId: the token that you need to make recurring payments for this shopper.\n\n\nMake sure that your server is able to receive the Recurring tokens life cycle events webhook. You can set up this webhook in your Customer Area.\n\nMake a payment with a token\nTo make a payment with the token, include in your  \/payments request:\n\n\npaymentMethod.storedPaymentMethodId: The storedPaymentMethodId from the  recurring.token.created webhook.\n\nYou can also get this value using the  \/listRecurringDetails endpoint.\n\n\n\nshopperReference: The unique shopper identifier that you specified when creating the token (minimum length three characters).\n\n\nshopperInteraction: ContAuth.\n\n\nrecurringProcessingModel: Subscription or UnscheduledCardOnFile.\n\n\nFor more information about the shopperInteraction and recurringProcessingModel fields, refer to Tokenization.\n\n    \n\nTest and go live\nCheck the status of TWINT test payments in your\u00a0Customer Area\u00a0&gt;\u00a0Transactions\u00a0&gt;\u00a0Payments.\nBefore you can accept live TWINT payments, you need to submit a request for TWINT in your live Customer Area.\nSee also\n\n\n                    API-only integration guide\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"TWINT","lvl3":"TWINT for API only"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/twint","lvl3":"\/pt\/payment-methods\/twint\/api-only"},"levels":4,"category":"Payment method","category_color":"green","tags":["TWINT"]},"articleFiles":{"payment-methods-response.json":"<p alt=\"\">payment-methods-response.json<\/p>"}}
