{"title":"Cash App Afterpay for API only","category":"default","creationDate":1776961628,"content":"<p>Accept Cash App Afterpay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.<\/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 built an <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow?platform=Web&amp;integration=API%20only\">API-only integration<\/a>. <\/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 Cash App Afterpay in your test Customer Area<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Build your payment form for Cash App Afterpay<\/h2>\n<p>If you are using  <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 show which payment methods are available to the shopper,<br \/>\nspecify in your request the following combinations of  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">countryCode<\/a> and  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-amount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.currency<\/a>&#58;<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Country\/region<\/th>\n<th style=\"text-align: left;\"><code>countryCode<\/code><\/th>\n<th style=\"text-align: left;\"><code>amount.currency<\/code><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">United States<\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>US<\/strong><\/span><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>USD<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"notices green\">\n<p>We provide an Cash App Afterpay logo which you can use on your payment form. For more information, refer to <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#downloading-logos\">Downloading logos<\/a>.<\/p>\n<\/div>\n<p>To perform risk checks, Cash App Afterpay requires you to collect the following shopper details:<\/p>\n<ul>\n<li>Full name<\/li>\n<li>Email address<\/li>\n<li>Billing address and delivery address.<\/li>\n<\/ul>\n<h2 id=\"make-a-payment\">Make a payment<\/h2>\n<ol>\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 from your server, specifying:<\/p>\n<ul>\n<li>\n<p><code>paymentMethod<\/code>: <span translate=\"no\"><strong>afterpaytouch_US<\/strong><\/span><\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperName\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperName<\/a>&#58;\u00a0the shopper's full name.\u00a0<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperEmail\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperEmail<\/a>&#58; the shopper's email address.\u00a0\u00a0<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-telephoneNumber\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">telephoneNumber<\/a> (Optional)&#58; the shopper's phone number.<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-billingAddress\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">billingAddress<\/a>&#58;\u00a0the postal address to be included on the invoice.\u00a0<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-deliveryAddress\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">deliveryAddress<\/a>&#58;\u00a0the postal address where the goods will be shipped.<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-lineItems\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">lineItems<\/a>&#58; price and product information about the purchased items.\u00a0\u00a0<\/p>\n<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"''\" :id=\"'afterpayclearpay-web-payments'\" :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;paymentMethod\\&quot;:{\\n     \\&quot;type\\&quot;:\\&quot;afterpaytouch_US\\&quot;\\n  },\\n  \\&quot;amount\\&quot;:{\\n     \\&quot;value\\&quot;:1000,\\n     \\&quot;currency\\&quot;:\\&quot;USD\\&quot;\\n  },\\n  \\&quot;shopperName\\&quot;:{\\n     \\&quot;firstName\\&quot;:\\&quot;Simon\\&quot;,\\n     \\&quot;lastName\\&quot;:\\&quot;Hopper\\&quot;\\n  },\\n  \\&quot;shopperEmail\\&quot;:\\&quot;s.hopper@example.com\\&quot;,\\n  \\&quot;shopperReference\\&quot;:\\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  \\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;returnUrl\\&quot;:\\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy..\\&quot;,\\n  \\&quot;countryCode\\&quot;:\\&quot;US\\&quot;,\\n  \\&quot;telephoneNumber\\&quot;:\\&quot;+16123456789\\&quot;,\\n  \\&quot;billingAddress\\&quot;:{\\n     \\&quot;city\\&quot;:\\&quot;San Francisco\\&quot;,\\n     \\&quot;country\\&quot;:\\&quot;US\\&quot;,\\n     \\&quot;houseNumberOrName\\&quot;:\\&quot;274\\&quot;,\\n     \\&quot;postalCode\\&quot;:\\&quot;94107\\&quot;,\\n     \\&quot;stateOrProvince\\&quot;:\\&quot;CA\\&quot;,\\n     \\&quot;street\\&quot;:\\&quot;Brennan St.\\&quot;\\n  },\\n  \\&quot;deliveryAddress\\&quot;:{\\n     \\&quot;city\\&quot;:\\&quot;San Francisco\\&quot;,\\n     \\&quot;country\\&quot;:\\&quot;US\\&quot;,\\n     \\&quot;houseNumberOrName\\&quot;:\\&quot;274\\&quot;,\\n     \\&quot;postalCode\\&quot;:\\&quot;94107\\&quot;,\\n     \\&quot;stateOrProvince\\&quot;:\\&quot;CA\\&quot;,\\n     \\&quot;street\\&quot;:\\&quot;Brennan St.\\&quot;\\n  },\\n  \\&quot;lineItems\\&quot;:[\\n     {\\n        \\&quot;description\\&quot;:\\&quot;Shoes\\&quot;,\\n        \\&quot;quantity\\&quot;:\\&quot;1\\&quot;,\\n        \\&quot;amountIncludingTax\\&quot;:\\&quot;400\\&quot;,\\n        \\&quot;amountExcludingTax\\&quot;: \\&quot;331\\&quot;,\\n        \\&quot;taxAmount\\&quot;: \\&quot;69\\&quot;,\\n        \\&quot;id\\&quot;:\\&quot;Item #1\\&quot;\\n     },\\n     {\\n        \\&quot;description\\&quot;:\\&quot;Socks\\&quot;,\\n        \\&quot;quantity\\&quot;:\\&quot;2\\&quot;,\\n        \\&quot;amountIncludingTax\\&quot;:\\&quot;300\\&quot;,\\n        \\&quot;amountExcludingTax\\&quot;: \\&quot;248\\&quot;,\\n        \\&quot;taxAmount\\&quot;: \\&quot;52\\&quot;,\\n        \\&quot;id\\&quot;:\\&quot;Item #2\\&quot;\\n     }\\n  ]\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set ADYEN_API_KEY with the API key from the Customer Area.\\n\\\/\\\/ Change to Environment.LIVE and add the Live URL prefix when you are ready to accept live payments.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n    Checkout checkout = new Checkout(client);\\n\\n    PaymentsRequest paymentsRequest = new PaymentsRequest();\\n\\n    String merchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;;\\n    paymentsRequest.setMerchantAccount(merchantAccount);\\n\\n    Amount amount = new Amount();\\n    amount.setCurrency(\\&quot;USD\\&quot;);\\n    amount.setValue(1000L);\\n    paymentsRequest.setAmount(amount);\\n\\n    DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();\\n    paymentMethodDetails.setType(\\&quot;afterpaytouch_US\\&quot;);\\n    paymentsRequest.setPaymentMethod(paymentMethodDetails);\\n\\n    paymentsRequest.setReference(\\&quot;YOUR_ORDER_NUMBER\\&quot;);\\n    paymentsRequest.setReturnUrl(\\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy..\\&quot;);\\n\\n    Name shopperDetails = new Name();\\n    shopperDetails.setFirstName(\\&quot;Simon\\&quot;);\\n    shopperDetails.setLastName(\\&quot;Hopper\\&quot;);\\n\\n    paymentsRequest.setShopperName(shopperDetails);\\n    paymentsRequest.setShopperReference(\\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;);\\n    paymentsRequest.setCountryCode(\\&quot;US\\&quot;);\\n    paymentsRequest.setTelephoneNumber(\\&quot;+16123456789\\&quot;);\\n    paymentsRequest.setShopperEmail(\\&quot;s.hopper@example.com\\&quot;);\\n\\n\\n    BillingAddress billingAddress = new BillingAddress();\\n    billingAddress.setCountry(\\&quot;US\\&quot;);\\n    billingAddress.setCity(\\&quot;San Francisco\\&quot;);\\n    billingAddress.setHouseNumberOrName(\\&quot;274\\&quot;);\\n    billingAddress.setStreet(\\&quot;Brennan St.\\&quot;);\\n    billingAddress.setPostalCode(\\&quot;94107\\&quot;);\\n    billingAddress.setStateOrProvince(\\&quot;CA\\&quot;);\\n\\n    paymentsRequest.setBillingAddress(billingAddress);\\n\\n    DeliveryAddress deliveryAddress = new DeliveryAddress();\\n    deliveryAddress.setCountry(\\&quot;US\\&quot;);\\n    deliveryAddress.setCity(\\&quot;San Francisco\\&quot;);\\n    deliveryAddress.setHouseNumberOrName(\\&quot;274\\&quot;);\\n    deliveryAddress.setStreet(\\&quot;Brennan St.\\&quot;);\\n    deliveryAddress.setPostalCode(\\&quot;94107\\&quot;);\\n    deliveryAddress.setStateOrProvince(\\&quot;CA\\&quot;);\\n\\n    paymentsRequest.setDeliveryAddress(deliveryAddress);\\n\\n    List&lt;LineItem&gt; lineItems = new ArrayList&lt;&gt;();\\n    lineItems.add(\\n        new LineItem()\\n            .quantity(1L)\\n            .description(\\&quot;Shoes\\&quot;)\\n            .id(\\&quot;Item #1\\&quot;)\\n            .amountIncludingTax(400L)\\n            .amountExcludingTax(331L)\\n            .taxAmount(69L)\\n    );\\n    lineItems.add(\\n        new LineItem()\\n            .quantity(2L)\\n            .description(\\&quot;Socks\\&quot;)\\n            .id(\\&quot;Item #2\\&quot;)\\n            .amountIncludingTax(300L)\\n            .amountExcludingTax(248L)\\n            .taxAmount(52L)\\n    );\\n\\n    paymentsRequest.setLineItems(lineItems);\\n\\n    PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set your X-API-KEY with the API key from the Customer Area.\\n$client = new \\\\Adyen\\\\Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n$service = new \\\\Adyen\\\\Service\\\\Checkout($client);\\n\\n$params = [\\n  \\&quot;merchantAccount\\&quot; =&gt; \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;reference\\&quot; =&gt; \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;amount\\&quot; =&gt; [\\n    \\&quot;currency\\&quot; =&gt; \\&quot;USD\\&quot;,\\n    \\&quot;value\\&quot; =&gt; 1000\\n  ],\\n  \\&quot;paymentMethod\\&quot; =&gt; [\\n    \\&quot;type\\&quot; =&gt; \\&quot;afterpaytouch_US\\&quot;\\n  ],\\n  \\&quot;returnUrl\\&quot; =&gt; \\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy..\\&quot;,\\n  \\&quot;countryCode\\&quot; =&gt; \\&quot;US\\&quot;,\\n  \\&quot;shopperName\\&quot; =&gt; [\\n       \\&quot;firstName\\&quot; =&gt; \\&quot;Simon\\&quot;,\\n       \\&quot;lastName\\&quot; =&gt; \\&quot;Hopper\\&quot;\\n  ],\\n  \\&quot;shopperEmail\\&quot; =&gt; \\&quot;s.hopper@example.com\\&quot;,\\n  \\&quot;shopperReference\\&quot; =&gt; \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  \\&quot;telephoneNumber\\&quot; =&gt; \\&quot;+16123456789\\&quot;,\\n  \\&quot;billingAddress\\&quot; =&gt; [\\n       \\&quot;city\\&quot; =&gt; \\&quot;San Francisco\\&quot;,\\n       \\&quot;country\\&quot; =&gt; \\&quot;US\\&quot;,\\n       \\&quot;houseNumberOrName\\&quot; =&gt; \\&quot;274\\&quot;,\\n       \\&quot;postalCode\\&quot; =&gt; \\&quot;94107\\&quot;,\\n       \\&quot;stateOrProvince\\&quot; =&gt; \\&quot;CA\\&quot;,\\n       \\&quot;street\\&quot; =&gt; \\&quot;Brennan St.\\&quot;\\n  ],\\n  \\&quot;deliveryAddress\\&quot; =&gt; [\\n       \\&quot;city\\&quot; =&gt; \\&quot;San Francisco\\&quot;,\\n       \\&quot;country\\&quot; =&gt; \\&quot;US\\&quot;,\\n       \\&quot;houseNumberOrName\\&quot; =&gt; \\&quot;274\\&quot;,\\n       \\&quot;postalCode\\&quot; =&gt; \\&quot;94107\\&quot;,\\n       \\&quot;stateOrProvince\\&quot; =&gt; \\&quot;CA\\&quot;,\\n       \\&quot;street\\&quot; =&gt; \\&quot;Brennan St.\\&quot;\\n  ],\\n  \\&quot;lineItems\\&quot; =&gt; [\\n     [\\n        \\&quot;description\\&quot; =&gt; \\&quot;Shoes\\&quot;,\\n        \\&quot;quantity\\&quot; =&gt; \\&quot;1\\&quot;,\\n        \\&quot;amountIncludingTax\\&quot; =&gt; \\&quot;400\\&quot;,\\n        \\&quot;amountExcludingTax\\&quot; =&gt; \\&quot;331\\&quot;,\\n        \\&quot;taxAmount\\&quot; =&gt; \\&quot;69\\&quot;,\\n        \\&quot;id\\&quot; =&gt; \\&quot;Item #1\\&quot;\\n     ],\\n     [\\n        \\&quot;description\\&quot; =&gt; \\&quot;Socks\\&quot;,\\n        \\&quot;quantity\\&quot; =&gt; \\&quot;2\\&quot;,\\n        \\&quot;amountIncludingTax\\&quot; =&gt; \\&quot;300\\&quot;,\\n        \\&quot;amountExcludingTax\\&quot; =&gt; \\&quot;248\\&quot;,\\n        \\&quot;taxAmount\\&quot; =&gt; \\&quot;52\\&quot;,\\n        \\&quot;id\\&quot; =&gt; \\&quot;Item #2\\&quot;\\n     ]\\n    ]\\n];\\n$result = $service-&gt;payments($params);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set your X-API-KEY with the API key from the Customer Area.\\nvar client = new Client (\\&quot;ADYEN_API_KEY\\&quot;, Environment.Test);\\nvar checkout = new Checkout(client);\\n\\nvar paymentsRequest = new Adyen.Model.Checkout.PaymentRequest\\n{\\n   MerchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n   Reference = \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n   PaymentMethod = new DefaultPaymentMethodDetails { Type = \\&quot;afterpaytouch_US\\&quot; },\\n   Amount = new Adyen.Model.Checkout.Amount(currency: \\&quot;USD\\&quot;, value: 1000),\\n   CountryCode = \\&quot;US\\&quot;,\\n   TelephoneNumber = \\&quot;+16123456789\\&quot;,\\n   ShopperEmail = \\&quot;s.hopper@example.com\\&quot;,\\n   ShopperName = new Adyen.Model.Checkout.Name\\n   {\\n       FirstName = \\&quot;Simon\\&quot;,\\n       LastName = \\&quot;Hopper\\&quot;\\n   },\\n   ShopperReference = \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n   BillingAddress = new Adyen.Model.Checkout.Address\\n   {\\n       City = \\&quot;San Francisco\\&quot;,\\n       Country = \\&quot;US\\&quot;,\\n       HouseNumberOrName = \\&quot;274\\&quot;,\\n       PostalCode = \\&quot;94107\\&quot;,\\n       StateOrProvince = \\&quot;CA\\&quot;,\\n       Street = \\&quot;Brennan St.\\&quot;\\n   },\\n   DeliveryAddress = new Adyen.Model.Checkout.Address\\n   {\\n       City = \\&quot;San Francisco\\&quot;,\\n       Country = \\&quot;US\\&quot;,\\n       HouseNumberOrName = \\&quot;274\\&quot;,\\n       PostalCode = \\&quot;94107\\&quot;,\\n       StateOrProvince = \\&quot;CA\\&quot;,\\n       Street = \\&quot;Brennan St.\\&quot;\\n   },\\n   ReturnUrl = \\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy..\\&quot;,\\n   LineItems = new List&lt;LineItem&gt;\\n   {\\n     new LineItem(quantity:1, description: \\&quot;Shoes\\&quot;, id: \\&quot;Item #1\\&quot;, amountIncludingTax: 400, amountExcludingTax: 331, taxAmount: 69),\\n     new LineItem(quantity:2, description: \\&quot;Socks\\&quot;, id: \\&quot;Item #2\\&quot;, amountIncludingTax: 300, amountExcludingTax: 248, taxAmount: 52)\\n   }\\n};&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v16.1.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ Initialize the client object\\nconst client = new Client({apiKey: \\&quot;YOUR_X_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object\\nconst paymentRequest = {\\n  paymentMethod: {\\n    type: \\&quot;afterpaytouch_US\\&quot;\\n  },\\n  amount: {\\n    value: 1000,\\n    currency: \\&quot;USD\\&quot;\\n  },\\n  shopperName: {\\n    firstName: \\&quot;Simon\\&quot;,\\n    lastName: \\&quot;Hopper\\&quot;\\n  },\\n  shopperEmail: \\&quot;s.hopper@example.com\\&quot;,\\n  shopperReference: \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  reference: \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  returnUrl: \\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy..\\&quot;,\\n  countryCode: \\&quot;US\\&quot;,\\n  telephoneNumber: \\&quot;+16123456789\\&quot;,\\n  billingAddress: {\\n    city: \\&quot;San Francisco\\&quot;,\\n    country: \\&quot;US\\&quot;,\\n    houseNumberOrName: \\&quot;274\\&quot;,\\n    postalCode: \\&quot;94107\\&quot;,\\n    stateOrProvince: \\&quot;CA\\&quot;,\\n    street: \\&quot;Brennan St.\\&quot;\\n  },\\n  deliveryAddress: {\\n    city: \\&quot;San Francisco\\&quot;,\\n    country: \\&quot;US\\&quot;,\\n    houseNumberOrName: \\&quot;274\\&quot;,\\n    postalCode: \\&quot;94107\\&quot;,\\n    stateOrProvince: \\&quot;CA\\&quot;,\\n    street: \\&quot;Brennan St.\\&quot;\\n  },\\n  lineItems: [ {\\n    description: \\&quot;Shoes\\&quot;,\\n    quantity: \\&quot;1\\&quot;,\\n    amountIncludingTax: \\&quot;400\\&quot;,\\n    amountExcludingTax: \\&quot;331\\&quot;,\\n    taxAmount: \\&quot;69\\&quot;,\\n    id: \\&quot;Item #1\\&quot;\\n  }, {\\n    description: \\&quot;Socks\\&quot;,\\n    quantity: \\&quot;2\\&quot;,\\n    amountIncludingTax: \\&quot;300\\&quot;,\\n    amountExcludingTax: \\&quot;248\\&quot;,\\n    taxAmount: \\&quot;52\\&quot;,\\n    id: \\&quot;Item #2\\&quot;\\n  } ]\\n}\\n\\n\\\/\\\/ Make the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.0.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;YOUR_X_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\njson_request = {\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;afterpaytouch_US\\&quot;\\n  },\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;value\\&quot;: 1000,\\n    \\&quot;currency\\&quot;: \\&quot;USD\\&quot;\\n  },\\n  \\&quot;shopperName\\&quot;: {\\n    \\&quot;firstName\\&quot;: \\&quot;Simon\\&quot;,\\n    \\&quot;lastName\\&quot;: \\&quot;Hopper\\&quot;\\n  },\\n  \\&quot;shopperEmail\\&quot;: \\&quot;s.hopper@example.com\\&quot;,\\n  \\&quot;shopperReference\\&quot;: \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;returnUrl\\&quot;: \\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy..\\&quot;,\\n  \\&quot;countryCode\\&quot;: \\&quot;US\\&quot;,\\n  \\&quot;telephoneNumber\\&quot;: \\&quot;+16123456789\\&quot;,\\n  \\&quot;billingAddress\\&quot;: {\\n    \\&quot;city\\&quot;: \\&quot;San Francisco\\&quot;,\\n    \\&quot;country\\&quot;: \\&quot;US\\&quot;,\\n    \\&quot;houseNumberOrName\\&quot;: \\&quot;274\\&quot;,\\n    \\&quot;postalCode\\&quot;: \\&quot;94107\\&quot;,\\n    \\&quot;stateOrProvince\\&quot;: \\&quot;CA\\&quot;,\\n    \\&quot;street\\&quot;: \\&quot;Brennan St.\\&quot;\\n  },\\n  \\&quot;deliveryAddress\\&quot;: {\\n    \\&quot;city\\&quot;: \\&quot;San Francisco\\&quot;,\\n    \\&quot;country\\&quot;: \\&quot;US\\&quot;,\\n    \\&quot;houseNumberOrName\\&quot;: \\&quot;274\\&quot;,\\n    \\&quot;postalCode\\&quot;: \\&quot;94107\\&quot;,\\n    \\&quot;stateOrProvince\\&quot;: \\&quot;CA\\&quot;,\\n    \\&quot;street\\&quot;: \\&quot;Brennan St.\\&quot;\\n  },\\n  \\&quot;lineItems\\&quot;: [ {\\n    \\&quot;description\\&quot;: \\&quot;Shoes\\&quot;,\\n    \\&quot;quantity\\&quot;: \\&quot;1\\&quot;,\\n    \\&quot;amountIncludingTax\\&quot;: \\&quot;400\\&quot;,\\n    \\&quot;amountExcludingTax\\&quot;: \\&quot;331\\&quot;,\\n    \\&quot;taxAmount\\&quot;: \\&quot;69\\&quot;,\\n    \\&quot;id\\&quot;: \\&quot;Item #1\\&quot;\\n  }, {\\n    \\&quot;description\\&quot;: \\&quot;Socks\\&quot;,\\n    \\&quot;quantity\\&quot;: \\&quot;2\\&quot;,\\n    \\&quot;amountIncludingTax\\&quot;: \\&quot;300\\&quot;,\\n    \\&quot;amountExcludingTax\\&quot;: \\&quot;248\\&quot;,\\n    \\&quot;taxAmount\\&quot;: \\&quot;52\\&quot;,\\n    \\&quot;id\\&quot;: \\&quot;Item #2\\&quot;\\n  } ]\\n}\\n\\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.1.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'YOUR_X_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\nrequest_body = {\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'afterpaytouch_US'\\n  },\\n  :amount =&gt; {\\n    :value =&gt; 1000,\\n    :currency =&gt; 'USD'\\n  },\\n  :shopperName =&gt; {\\n    :firstName =&gt; 'Simon',\\n    :lastName =&gt; 'Hopper'\\n  },\\n  :shopperEmail =&gt; 's.hopper@example.com',\\n  :shopperReference =&gt; 'YOUR_UNIQUE_SHOPPER_ID',\\n  :reference =&gt; 'YOUR_ORDER_REFERENCE',\\n  :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n  :returnUrl =&gt; 'https:\/\/your-company.example.com\/checkout?shopperOrder=12xy..',\\n  :countryCode =&gt; 'US',\\n  :telephoneNumber =&gt; '+16123456789',\\n  :billingAddress =&gt; {\\n    :city =&gt; 'San Francisco',\\n    :country =&gt; 'US',\\n    :houseNumberOrName =&gt; '274',\\n    :postalCode =&gt; '94107',\\n    :stateOrProvince =&gt; 'CA',\\n    :street =&gt; 'Brennan St.'\\n  },\\n  :deliveryAddress =&gt; {\\n    :city =&gt; 'San Francisco',\\n    :country =&gt; 'US',\\n    :houseNumberOrName =&gt; '274',\\n    :postalCode =&gt; '94107',\\n    :stateOrProvince =&gt; 'CA',\\n    :street =&gt; 'Brennan St.'\\n  },\\n  :lineItems =&gt; [ {\\n    :description =&gt; 'Shoes',\\n    :quantity =&gt; '1',\\n    :amountIncludingTax =&gt; '400',\\n    :amountExcludingTax =&gt; '331',\\n    :taxAmount =&gt; '69',\\n    :id =&gt; 'Item #1'\\n  }, {\\n    :description =&gt; 'Socks',\\n    :quantity =&gt; '2',\\n    :amountIncludingTax =&gt; '300',\\n    :amountExcludingTax =&gt; '248',\\n    :taxAmount =&gt; '52',\\n    :id =&gt; 'Item #2'\\n  } ]\\n}\\n\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>In 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> response, check the <code>action<\/code> object for the information that you must use to redirect the shopper.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/payments response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n  \\\"resultCode\\\":\\\"RedirectShopper\\\",\\n  \\\"action\\\":{\\n    \\\"paymentMethodType\\\":\\\"afterpaytouch_US\\\",\\n    \\\"method\\\":\\\"GET\\\",\\n    \\\"url\\\":\\\"https:\\\/\\\/checkoutshopper-test.adyen.com\\\/checkoutshopper\\\/checkoutPaymentRedirect?redirectData=...\\\",\\n    \\\"type\\\":\\\"redirect\\\"\\n  }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h2>Handle the redirect<\/h2>\n<ol>\n<li>\n<p>To complete the payment, redirect the shopper to the <code>action.url<\/code> returned in 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> response, taking into account the following recommendations:<\/p>\n<ul>\n<li>\n<p><strong>When using the HTTP GET method:<\/strong><br \/>\nFor security reasons, when showing the redirect in the app, we recommend that you use <a href=\"https:\/\/developer.apple.com\/documentation\/safariservices\/sfsafariviewcontroller\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">SFSafariViewController<\/a> for iOS or <a href=\"https:\/\/developer.chrome.com\/multidevice\/android\/customtabs\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Chrome Custom Tabs<\/a> for Android, instead of WebView objects. Also refer to the <a href=\"https:\/\/developer.android.com\/topic\/security\/best-practices#webview\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">security best practices<\/a> for WebView.<\/p>\n<\/li>\n<li>\n<p><strong>Redirection for mobile integrations:<\/strong><br \/>\nFor mobile integrations, we strongly recommended that you redirect the shopper to the default browser of their device. Redirecting to the default browser ensures the best compatibility, handling of multi-factor authentication, app-to-app redirection, and error handling.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>After the shopper is redirected back to your website, check the payment result by making a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/details\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/details<\/a> request, specifying:<\/p>\n<ul>\n<li><code>details<\/code>: object that contains the URL-decoded <code>redirectResult<\/code> returned when the shopper was redirected back to your site.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/payments\/details request'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/payments\\\/details \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n   \\&quot;details\\&quot;: {\\n      \\&quot;redirectResult\\&quot;: \\&quot;eyJ0cmFuc1N0YXR1cyI6IlkifQ==\\&quot;\\n   }\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>In the response note the following:<\/p>\n<ul>\n<li><code>resultCode<\/code>: use this to present the result to your shopper.<\/li>\n<li><code>pspReference<\/code>: our unique identifier for the transaction.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/payments\/details response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"resultCode\\\": \\\"Authorised\\\",\\n   \\\"pspReference\\\": \\\"V4HZ4RBFJGXXGN82\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h2>Present the payment result<\/h2>\n<p>Use the <code>resultCode<\/code> that you received in the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/details\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/details<\/a> response to present the payment result to your shopper.<\/p>\n<p>The <code>resultCode<\/code> values you can receive for Cash App Afterpay are:<\/p>\n<table>\n<thead>\n<tr>\n<th>resultCode<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Authorised<\/strong><\/td>\n<td>The payment was successful.<\/td>\n<td>Inform the shopper that the payment was successful.<\/td>\n<\/tr>\n<tr>\n<td><strong>Cancelled<\/strong><\/td>\n<td>The shopper cancelled the payment.<\/td>\n<td>Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.<\/td>\n<\/tr>\n<tr>\n<td><strong>Pending<\/strong> or  <br> <strong>Received<\/strong><\/td>\n<td>The shopper has completed the payment but the final result is not yet known. It may take minutes or hours to confirm this.<\/td>\n<td>Inform the shopper that you have received their order, and are waiting for the payment to be completed. <br> To know the final result of the payment, wait for the <a href=\"\/pt\/development-resources\/webhooks\/webhook-types\">AUTHORISATION webhook<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Refused<\/strong><\/td>\n<td>The payment was refused by Cash App Afterpay.<\/td>\n<td>Ask the shopper to try the payment again using a different payment method.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a id=\"webhooks\"><\/a> If the shopper failed to return to your website or app, wait for webhooks to know the outcome of the payment:<\/p>\n<table>\n<thead>\n<tr>\n<th>eventCode<\/th>\n<th>success field<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>AUTHORISATION<\/strong><\/td>\n<td><strong>false<\/strong><\/td>\n<td>The transaction failed.<\/td>\n<td>Cancel the order and inform the shopper that the payment failed.<\/td>\n<\/tr>\n<tr>\n<td><strong>AUTHORISATION<\/strong><\/td>\n<td><strong>true<\/strong><\/td>\n<td>The shopper successfully completed the payment.<\/td>\n<td>Inform the shopper that the payment was successful and proceed with the order.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Capture the payment<\/h2>\n<p>Depending on your merchant account configuration, Cash App Afterpay payments are captured automatically after authorisation, or manually captured. If you prefer to capture the payment after the goods have been sent, you need to set up a <a href=\"\/pt\/online-payments\/capture#delayed-automatic-capture\">capture delay<\/a> or use <a href=\"\/pt\/online-payments\/capture#capture-a-payment\">manual capture<\/a>. To partially capture a payment, you also need to use manual capture.<\/p>\n<p>Cash App Afterpay payments have to be captured within 13 days after authorisation.<\/p>\n<p>During authorisation, the shopper is charged for the first installment. If the payment is not captured within 13 days, before the second installment, Cash App Afterpay cancels the payment and refunds the first installment to the shopper.<\/p>\n<div class=\"notices blue\">\n<p>For testing purposes, Cash App Afterpay authorisations expire in one day. When you use manual capture, you need to capture test Cash App Afterpay payments within one day after authorisation.<\/p>\n<\/div>\n<h3 id=\"partial-captures\">Full or partial manual captures<\/h3>\n<p>When you use manual capture, in your  <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 specify:<\/p>\n<ul>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/captures#request-amount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.value<\/a>: the full or partial amount that the shopper should pay.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/captures#request-lineItems\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">lineItems<\/a>: (optional) price and product information for the items that the shopper should pay for.<\/li>\n<\/ul>\n<p>Any unclaimed amount that is left over after partially capturing a payment is automatically cancelled. When your account is enabled for <em>multiple<\/em> partial captures, the unclaimed amount after an initial capture is not automatically cancelled.<\/p>\n<div class=\"sc-notice info\"><div>\n<p>To set up multiple partial captures, 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>. Multiple partial captures will create a new invoice for each capture.<\/p>\n<\/div><\/div>\n<h2>Refunds and cancellations<\/h2>\n<p>If a payment has not yet been captured, you can <a href=\"\/pt\/online-payments\/cancel\">cancel<\/a> it. If a payment has already been captured and you want to return the funds to the shopper, you need to <a href=\"\/pt\/online-payments\/refund\">refund<\/a> the payment.<\/p>\n<h3 id=\"partial-refunds\">Full or partial refunds<\/h3>\n<p>To fully or partially refund a payment, in your  <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> request specify:<\/p>\n<ul>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-amount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.value<\/a>: the full or partial amount to be refunded to the shopper.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-lineItems\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">lineItems<\/a>: (optional) price and product information about the refunded items.<\/li>\n<\/ul>\n<h2>Discounts<\/h2>\n<p>To offer discounts, your payment request must include the negative amount to be added to the original price. The following example shows how to specify a discount of 1 USD on Item #2:<\/p>\n<pre><code class=\"language-json\">{\n  \"amount\":{\n     \"value\":800,\n     \"currency\":\"USD\"\n  },\n  ...\n  \"lineItems\":[\n\n     {\n        \"description\":\"Test Cash App Afterpay 1\",\n        \"quantity\":\"1\",\n        \"amountIncludingTax\":\"400\",\n        \"id\":\"Item #1\"\n     },\n     {\n        \"description\":\"Test Cash App Afterpay 2\",\n        \"quantity\":\"2\",\n        \"amountIncludingTax\":\"300\",\n        \"id\":\"Item #2\"\n     }\n\n     {\n        \"description\":\"Discount\",\n        \"quantity\":\"2\",\n        \"amountIncludingTax\":\"-100\",\n        \"id\":\"Item #2 Discount\"\n     }\n  ]\n}<\/code><\/pre>\n<h2>Test and go live<\/h2>\n<p>To test Cash App Afterpay payments, you need a test shopper account in the Afterpay sandbox environment.<\/p>\n<p>To create a test account:<\/p>\n<ol>\n<li>Go to <a href=\"https:\/\/portal.sandbox.afterpay.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">https:\/\/portal.sandbox.afterpay.com\/<\/a>.<\/li>\n<li>Enter a real email address and select <strong>Continue<\/strong>. You will get confirmations of payments and refunds like any other shopper on this email address.<\/li>\n<li>From the drop-down menu, select the country\/region for which you want to create a test shopper account: <strong>US<\/strong>.<\/li>\n<li>Enter any mobile telephone number that is formatted correctly, and select <strong>Continue<\/strong>. Check the input box for hints on the format. The phone number will not be used.<\/li>\n<li>When you are prompted to enter your SMS verification code, enter <strong>111111<\/strong>.<\/li>\n<li>Follow the instructions on your screen to complete your profile, accept the terms and conditions, and select <strong>Continue<\/strong>.<\/li>\n<\/ol>\n<p> <\/p>\n<p>To test payments, add a test card to your Afterpay test shopper account.<br \/>\nYou can use the card details provided in the Afterpay <a href=\"https:\/\/developers.afterpay.com\/afterpay-online\/docs\/customer-accounts\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">developer documentation<\/a>, or use one of the Adyen <a href=\"\/pt\/development-resources\/test-cards-and-credentials\/test-card-numbers\">test cards<\/a>. Use CVV 000 to simulate authorised payments, or CVV 051 to simulate refused payments.<\/p>\n<p> <\/p>\n<p>You can check the status of 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> <\/p>\n<p>Before you can accept live Cash App Afterpay payments, you need to <a href=\"\/pt\/payment-methods\/add-payment-methods\">submit a request for Cash App Afterpay<\/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>See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/online-payments\/api-only\"\n                        target=\"_self\"\n                        >\n                    API-only integration guide\n                <\/a><\/li><li><a href=\"\/development-resources\/webhooks\"\n                        target=\"_self\"\n                        >\n                    Webhooks\n                <\/a><\/li><li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/overview\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    API Explorer\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/cash-app-afterpay\/api-only","articleFields":{"description":"Add Cash App Afterpay to an existing API-only integration.","type":"page","parameters":{"integration":"API-only","platform":"Web","integration_guide_url":"build-your-integration\/advanced-flow?platform=Web&integration=API%20only","payment_method":"Cash App Afterpay","country_code":"US","currency_code":"USD","payment_method_type":"afterpaytouch_US","shopper_email":"s.hopper@example.com","shopper_name_first":"Simon","shopper_name_last":"Hopper","shopperreference":"YOUR_UNIQUE_SHOPPER_ID","city":"San Francisco","housenumberorname":"274","postalcode":"94107","street":"Brennan St.","stateorprovince":"CA","telephone_number":"+16123456789","return_url":"https:\/\/your-company.example.com\/checkout?shopperOrder=12xy.."},"feedback_component":true},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/cash-app-afterpay\/api-only","title":"Cash App Afterpay for API only","content":"Accept Cash App Afterpay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have built an API-only integration. \n\n\nSetup steps\nBefore you begin, add Cash App Afterpay in your test Customer Area.\n\n\n\nBuild your payment form for Cash App Afterpay\nIf you are using  \/paymentMethods to show which payment methods are available to the shopper,\nspecify in your request the following combinations of  countryCode and  amount.currency&#58;\n\n\n\nCountry\/region\ncountryCode\namount.currency\n\n\n\n\nUnited States\nUS\nUSD\n\n\n\n\nWe provide an Cash App Afterpay logo which you can use on your payment form. For more information, refer to Downloading logos.\n\nTo perform risk checks, Cash App Afterpay requires you to collect the following shopper details:\n\nFull name\nEmail address\nBilling address and delivery address.\n\nMake a payment\n\n\nMake a  \/payments request from your server, specifying:\n\n\npaymentMethod: afterpaytouch_US\n\n\n shopperName&#58;\u00a0the shopper's full name.\u00a0\n\n\n shopperEmail&#58; the shopper's email address.\u00a0\u00a0\n\n\n telephoneNumber (Optional)&#58; the shopper's phone number.\n\n\n billingAddress&#58;\u00a0the postal address to be included on the invoice.\u00a0\n\n\n deliveryAddress&#58;\u00a0the postal address where the goods will be shipped.\n\n\n lineItems&#58; price and product information about the purchased items.\u00a0\u00a0\n\n\n\n\n\n\n\nIn the  \/payments response, check the action object for the information that you must use to redirect the shopper.\n\n\n\n\n\nHandle the redirect\n\n\nTo complete the payment, redirect the shopper to the action.url returned in the  \/payments response, taking into account the following recommendations:\n\n\nWhen using the HTTP GET method:\nFor security reasons, when showing the redirect in the app, we recommend that you use SFSafariViewController for iOS or Chrome Custom Tabs for Android, instead of WebView objects. Also refer to the security best practices for WebView.\n\n\nRedirection for mobile integrations:\nFor mobile integrations, we strongly recommended that you redirect the shopper to the default browser of their device. Redirecting to the default browser ensures the best compatibility, handling of multi-factor authentication, app-to-app redirection, and error handling.\n\n\n\n\nAfter the shopper is redirected back to your website, check the payment result by making a POST  \/payments\/details request, specifying:\n\ndetails: object that contains the URL-decoded redirectResult returned when the shopper was redirected back to your site.\n\n\n\n\n\n\nIn the response note the following:\n\nresultCode: use this to present the result to your shopper.\npspReference: our unique identifier for the transaction.\n\n\n\n\n\n\nPresent the payment result\nUse the resultCode that you received in the  \/payments\/details response to present the payment result to your shopper.\nThe resultCode values you can receive for Cash App Afterpay are:\n\n\n\nresultCode\nDescription\nAction to take\n\n\n\n\nAuthorised\nThe payment was successful.\nInform the shopper that the payment was successful.\n\n\nCancelled\nThe shopper cancelled the payment.\nAsk the shopper whether they want to continue with the order, or ask them to select a different payment method.\n\n\nPending or   Received\nThe shopper has completed the payment but the final result is not yet known. It may take minutes or hours to confirm this.\nInform the shopper that you have received their order, and are waiting for the payment to be completed.  To know the final result of the payment, wait for the AUTHORISATION webhook.\n\n\nRefused\nThe payment was refused by Cash App Afterpay.\nAsk the shopper to try the payment again using a different payment method.\n\n\n\n If the shopper failed to return to your website or app, wait for webhooks to know the outcome of the payment:\n\n\n\neventCode\nsuccess field\nDescription\nAction to take\n\n\n\n\nAUTHORISATION\nfalse\nThe transaction failed.\nCancel the order and inform the shopper that the payment failed.\n\n\nAUTHORISATION\ntrue\nThe shopper successfully completed the payment.\nInform the shopper that the payment was successful and proceed with the order.\n\n\n\nCapture the payment\nDepending on your merchant account configuration, Cash App Afterpay payments are captured automatically after authorisation, or manually captured. If you prefer to capture the payment after the goods have been sent, you need to set up a capture delay or use manual capture. To partially capture a payment, you also need to use manual capture.\nCash App Afterpay payments have to be captured within 13 days after authorisation.\nDuring authorisation, the shopper is charged for the first installment. If the payment is not captured within 13 days, before the second installment, Cash App Afterpay cancels the payment and refunds the first installment to the shopper.\n\nFor testing purposes, Cash App Afterpay authorisations expire in one day. When you use manual capture, you need to capture test Cash App Afterpay payments within one day after authorisation.\n\nFull or partial manual captures\nWhen you use manual capture, in your  \/payments\/{paymentPspReference}\/captures request specify:\n\n amount.value: the full or partial amount that the shopper should pay.\n lineItems: (optional) price and product information for the items that the shopper should pay for.\n\nAny unclaimed amount that is left over after partially capturing a payment is automatically cancelled. When your account is enabled for multiple partial captures, the unclaimed amount after an initial capture is not automatically cancelled.\n\nTo set up multiple partial captures, contact our Support Team. Multiple partial captures will create a new invoice for each capture.\n\nRefunds and cancellations\nIf a payment has not yet been captured, you can cancel it. If a payment has already been captured and you want to return the funds to the shopper, you need to refund the payment.\nFull or partial refunds\nTo fully or partially refund a payment, in your  \/payments\/{paymentPspReference}\/refunds request specify:\n\n amount.value: the full or partial amount to be refunded to the shopper.\n lineItems: (optional) price and product information about the refunded items.\n\nDiscounts\nTo offer discounts, your payment request must include the negative amount to be added to the original price. The following example shows how to specify a discount of 1 USD on Item #2:\n{\n  \"amount\":{\n     \"value\":800,\n     \"currency\":\"USD\"\n  },\n  ...\n  \"lineItems\":[\n\n     {\n        \"description\":\"Test Cash App Afterpay 1\",\n        \"quantity\":\"1\",\n        \"amountIncludingTax\":\"400\",\n        \"id\":\"Item #1\"\n     },\n     {\n        \"description\":\"Test Cash App Afterpay 2\",\n        \"quantity\":\"2\",\n        \"amountIncludingTax\":\"300\",\n        \"id\":\"Item #2\"\n     }\n\n     {\n        \"description\":\"Discount\",\n        \"quantity\":\"2\",\n        \"amountIncludingTax\":\"-100\",\n        \"id\":\"Item #2 Discount\"\n     }\n  ]\n}\nTest and go live\nTo test Cash App Afterpay payments, you need a test shopper account in the Afterpay sandbox environment.\nTo create a test account:\n\nGo to https:\/\/portal.sandbox.afterpay.com\/.\nEnter a real email address and select Continue. You will get confirmations of payments and refunds like any other shopper on this email address.\nFrom the drop-down menu, select the country\/region for which you want to create a test shopper account: US.\nEnter any mobile telephone number that is formatted correctly, and select Continue. Check the input box for hints on the format. The phone number will not be used.\nWhen you are prompted to enter your SMS verification code, enter 111111.\nFollow the instructions on your screen to complete your profile, accept the terms and conditions, and select Continue.\n\n \nTo test payments, add a test card to your Afterpay test shopper account.\nYou can use the card details provided in the Afterpay developer documentation, or use one of the Adyen test cards. Use CVV 000 to simulate authorised payments, or CVV 051 to simulate refused payments.\n \nYou can check the status of test payments in your\u00a0Customer Area\u00a0&gt;\u00a0Transactions\u00a0&gt;\u00a0Payments.\n \nBefore you can accept live Cash App Afterpay payments, you need to submit a request for Cash App Afterpay in your live Customer Area.\nSee also\n\n\n                    API-only integration guide\n                \n                    Webhooks\n                \n                    API Explorer\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Cash App Afterpay","lvl3":"Cash App Afterpay 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\/cash-app-afterpay","lvl3":"\/pt\/payment-methods\/cash-app-afterpay\/api-only"},"levels":4,"category":"Payment method","category_color":"green","tags":["Afterpay"]}}
