---
title: "Cash App Pay Component"
description: "Add Cash App Pay to an existing Components integration."
url: "https://docs.adyen.com/payment-methods/cash-app-pay/web-component"
source_url: "https://docs.adyen.com/payment-methods/cash-app-pay/web-component.md"
canonical: "https://docs.adyen.com/payment-methods/cash-app-pay/web-component"
last_modified: "2023-08-17T09:59:00+02:00"
language: "en"
---

# Cash App Pay Component

Add Cash App Pay to an existing Components integration.

[View source](/payment-methods/cash-app-pay/web-component.md)

This page explains how to add Cash App Pay to your existing Web Components integration.

## Requirements

Select the [server-side flow](/online-payments/build-your-integration) that your integration uses:

### Tab: Sessions flow

| Requirement          | Description                                                                                                                                                                                                                                             |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Integration type** | Make sure that you have built a Sessions flow [Web Components integration](/online-payments/build-your-integration/sessions-flow?platform=Web\&integration=Components). The minimum required version is 5.44.0.                                         |
| **Webhooks**         | Enable the [Recurring tokens life cycle events](/online-payments/tokenization/create-tokens#enable-the-webhook) webhook.                                                                                                                                |
| **Setup steps**      | Before you begin:- [Add Cash App Pay in your Customer Area](/payment-methods/add-payment-methods).
- In your [Customer Area](https://ca-test.adyen.com/) go to **Developer** > **Additional data** and under **Payment** select **Save configuration**. |

### Tab: Advanced flow

| Requirement          | Description                                                                                                                                                                                                                                             |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Integration type** | Make sure that you have built an Advanced flow [Web Components integration](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=Components). The minimum required version is 5.44.0.                                        |
| **Webhooks**         | Enable the [Recurring tokens life cycle events](/online-payments/tokenization/create-tokens#enable-the-webhook) webhook.                                                                                                                                |
| **Setup steps**      | Before you begin:- [Add Cash App Pay in your Customer Area](/payment-methods/add-payment-methods).
- In your [Customer Area](https://ca-test.adyen.com/) go to **Developer** > **Additional data** and under **Payment** select **Save configuration**. |

## Import resources for v6

If you are using Web Components v6, [import the Component](/online-payments/build-your-integration/?platform=Web\&integration=Drop-in\&version=6.0.0) that you need for Cash App Pay:

```js
import { AdyenCheckout, CashAppPay } from '@adyen/adyen-web'
```

## API reference

You do not need to send additional fields for Cash App Pay. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:

* [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions): This is the default with [Components v5.0.0](/online-payments/build-your-integration/sessions-flow?platform=Web\&integration=Components) or later.
* [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments): If you implemented an [additional use case](/online-payments/build-your-integration).

## Component configuration

### Step 1: Create a DOM element

Create a DOM element on your checkout page, placing it where you want the payment method form to be rendered:

```html
 <div id="cashapp-container"></div>
```

### Step 2: Create an instance of the Component

#### v6.0.0 or later

Create an instance of the Component, passing:

* Your instance of `AdyenCheckout`.

```js
const cashapp = new CashAppPay(checkout).mount('#cashapp-container');
```

**

#### v5.x.x or earlier

Use the `create` method of your `AdyenCheckout` instance, in this case `checkout`, to create the Component:

```js
const cashappComponent = checkout.create('cashapp').mount('#cashapp-container');
```

For Cash App Pay, you must pass the `amount` for the transaction value to be authorized.

* If you use the [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) endpoint, pass the `amount` when creating the session.
* If you use the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) endpoint, include the `amount` when creating an instance of `AdyenCheckout`.

You do not have to pass the `amount` for [zero-value auth](/get-started-with-adyen/adyen-glossary/#zero-value-auth) transactions.

### Optional configuration

You can add the following optional configuration:

| Parameter name       | Description                                                                                                                                                                                                                                        | Default   |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `enableStoreDetails` | Set to **true** to show a toggle that lets the shopper choose whether to save their payment details.                                                                                                                                               | **false** |
| `storePaymentMethod` | Set to **true** to save the shopper's payment details without showing a toggle. For example, use this for a page where the shopper enters their details for a subscription service that charges the shopper on a recurring basis.                  | **false** |
| `button`             | Use the available [style options](https://developers.cash.app/docs/partner/technical-documentation/sdks/pay-kit/getting-started#customize-the-cash-app-pay-button) to configure the layout of the Pay button for Cash App Pay.                     |           |
| `showPayButton`      | Show or hide the Adyen-provided **Pay** button. This **Pay** button triggers the `onSubmit` event when payment details are valid. When using your own **Pay** button, you have to call the `.submit()` method from your own button implementation. | **false** |

The following event handler is supported for Cash App Pay:

| Event              | Description                                                                                                                                      |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `onClick(actions)` | Called when the shopper clicks the Cash App Pay Pay button. Call `actions.resolve()` or `actions.reject()` to continue or stop the payment flow. |

## Recurring and card-on-file payments

Cash App Pay supports [tokenization](/online-payments/tokenization) of the shopper's payment details for future recurring and card-on-file payments. Card-on-file payments are ad-hoc payments where you use the shopper's token. By getting the shopper's permission to save their payment details when you create the token, you can bypass the shopper approval step for those future payments.

We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring or card-on-file payments. In the case of recurring payments, being transparent about the payment schedule and the amount of recurring payments reduces the risk of chargebacks.

You can:

* [Store Cash App Pay details](#store-details)
* [Show stored Cash App Pay details](#show-stored)
* [Get the shopper's $cashtag](#cashtag)
* [Make a one-off or recurring payment with stored Cash App Pay details](#make-a-payment-with-stored-details)
* [Receive a notification when a shopper deletes stored Cash App Pay details](#token-disabled)

### Store Cash App Pay details

Select the [server-side flow](/online-payments/build-your-integration) that your integration uses:

### Tab: Sessions flow

How you store card details with the Cash App Pay Component depends on the Checkout API version you use:

* [Checkout API v70 or later](#v70-or-later)
* [Checkout API v69](#v69)

#### v70 or later

Send additional parameters in the [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request to store payment details with our [Tokenization feature](/online-payments/tokenization) or to configure the Cash App Pay Component to let the shopper choose if they want to store their payment details.

In the [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request, include:

| Parameter                  | Description                                                                                                                                           |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `recurringProcessingModel` | The type of transactions you can use the stored Cash App Pay details for.                                                                             |
| `shopperReference`         | Your unique reference for the shopper.                                                                                                                |
| `storePaymentMethodMode`   | The setting for storing the shopper's Cash App Pay details. Set `storePaymentMethod` to **true** in the component configuration to store the details. |

Possible values for `storePaymentMethodMode`:

| Value             | Description                                                                                                     |
| ----------------- | --------------------------------------------------------------------------------------------------------------- |
| **disabled**      | Your shopper's Cash App Pay details are *not* stored.                                                           |
| **askForConsent** | the Cash App Pay Component enables your shopper to select whether they want their payment details to be stored. |
| **enabled**       | Your shopper's Cash App Pay details are stored.                                                                 |

For example:

**/sessions request for asking shopper consent to store Cash App Pay details**

#### curl

```bash
curl https://checkout-test.adyen.com/v70/sessions \
-H 'X-API-key: ADYEN_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
    "amount": {
      "currency": "USD",
      "value": 1000
    },
    "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
    "reference": "YOUR_ORDER_NUMBER",
    "recurringProcessingModel": "CardOnFile",
    "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..",
    "storePaymentMethodMode": "askForConsent"
}'
```

#### Java

```java
// Adyen Java API Library v27.0.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.checkout.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.model.RequestOptions;
import com.adyen.service.checkout.*;

// For the live environment, additionally include your liveEndpointUrlPrefix.
Client client = new Client("ADYEN_API_KEY", Environment.TEST);

// Create the request object(s)
Amount amount = new Amount()
  .currency("USD")
  .value(1000L);

CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest()
  .reference("YOUR_ORDER_NUMBER")
  .storePaymentMethodMode(CreateCheckoutSessionRequest.StorePaymentMethodModeEnum.ASKFORCONSENT)
  .amount(amount)
  .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
  .recurringProcessingModel(CreateCheckoutSessionRequest.RecurringProcessingModelEnum.CARDONFILE)
  .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..");

// Send the request
PaymentsApi service = new PaymentsApi(client);
CreateCheckoutSessionResponse response = service.sessions(createCheckoutSessionRequest, new RequestOptions().idempotencyKey("UUID"));
```

#### PHP

```php
// Adyen PHP API Library v19.0.0
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\Checkout\Amount;
use Adyen\Model\Checkout\CreateCheckoutSessionRequest;
use Adyen\Service\Checkout\PaymentsApi;

$client = new Client();
$client->setXApiKey("ADYEN_API_KEY");
// For the live environment, additionally include your liveEndpointUrlPrefix.
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$amount = new Amount();
$amount
  ->setCurrency("USD")
  ->setValue(1000);

$createCheckoutSessionRequest = new CreateCheckoutSessionRequest();
$createCheckoutSessionRequest
  ->setReference("YOUR_ORDER_NUMBER")
  ->setStorePaymentMethodMode("askForConsent")
  ->setAmount($amount)
  ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
  ->setRecurringProcessingModel("CardOnFile")
  ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..");

$requestOptions['idempotencyKey'] = 'UUID';

// Send the request
$service = new PaymentsApi($client);
$response = $service->sessions($createCheckoutSessionRequest, $requestOptions);
```

#### C\#

```cs
// Adyen .net API Library v17.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.Checkout;
using Adyen.Service.Checkout;

// For the live environment, additionally include your liveEndpointUrlPrefix.
var config = new Config()
{
    XApiKey = "ADYEN_API_KEY",
    Environment = Environment.Test
};
var client = new Client(config);

// Create the request object(s)
Amount amount = new Amount
{
  Currency = "USD",
  Value = 1000
};

CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest
{
  Reference = "YOUR_ORDER_NUMBER",
  StorePaymentMethodMode = CreateCheckoutSessionRequest.StorePaymentMethodModeEnum.AskForConsent,
  Amount = amount,
  MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
  RecurringProcessingModel = CreateCheckoutSessionRequest.RecurringProcessingModelEnum.CardOnFile,
  ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy.."
};

// Send the request
var service = new PaymentsService(client);
var response = service.Sessions(createCheckoutSessionRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v18.0.0
// Require the parts of the module you want to use
const { Client, CheckoutAPI } = require('@adyen/api-library');
// Initialize the client object
// For the live environment, additionally include your liveEndpointUrlPrefix.
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const createCheckoutSessionRequest = {
  amount: {
    currency: "USD",
    value: 1000
  },
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  reference: "YOUR_ORDER_NUMBER",
  recurringProcessingModel: "CardOnFile",
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
  storePaymentMethodMode: "askForConsent"
}

// Send the request
const checkoutAPI = new CheckoutAPI(client);
const response = checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" });
```

#### Go

```go
// Adyen Go API Library v10.4.0
import (
  "context"
  "github.com/adyen/adyen-go-api-library/v9/src/common"
  "github.com/adyen/adyen-go-api-library/v9/src/adyen"
  "github.com/adyen/adyen-go-api-library/v9/src/checkout"
)
// For the live environment, additionally include your liveEndpointUrlPrefix.
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_API_KEY",
  Environment: common.TestEnv,
})

// Create the request object(s)
amount := checkout.Amount{
  Currency: "USD",
  Value: 1000,
}

createCheckoutSessionRequest := checkout.CreateCheckoutSessionRequest{
  Reference: "YOUR_ORDER_NUMBER",
  StorePaymentMethodMode: common.PtrString("askForConsent"),
  Amount: amount,
  MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  RecurringProcessingModel: common.PtrString("CardOnFile"),
  ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
}

// Send the request
service := client.Checkout()
req := service.PaymentsApi.SessionsInput().IdempotencyKey("UUID").CreateCheckoutSessionRequest(createCheckoutSessionRequest)
res, httpRes, err := service.PaymentsApi.Sessions(context.Background(), req)
```

#### Python

```py
# Adyen Python API Library v12.5.1
import Adyen

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_API_KEY"
# For the live environment, additionally include your liveEndpointUrlPrefix.
adyen.client.platform = "test" # The environment to use library in.

# Create the request object(s)
json_request = {
  "amount": {
    "currency": "USD",
    "value": 1000
  },
  "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
  "reference": "YOUR_ORDER_NUMBER",
  "recurringProcessingModel": "CardOnFile",
  "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..",
  "storePaymentMethodMode": "askForConsent"
}

# Send the request
result = adyen.checkout.payments_api.sessions(request=json_request, idempotency_key="UUID")
```

#### Ruby

```rb
# Adyen Ruby API Library v9.5.1
require "adyen-ruby-api-library"

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_API_KEY'
# For the live environment, additionally include your liveEndpointUrlPrefix.
adyen.env = :test # Set to "live" for live environment

# Create the request object(s)
request_body = {
  :amount => {
    :currency => 'USD',
    :value => 1000
  },
  :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT',
  :reference => 'YOUR_ORDER_NUMBER',
  :recurringProcessingModel => 'CardOnFile',
  :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..',
  :storePaymentMethodMode => 'askForConsent'
}

# Send the request
result = adyen.checkout.payments_api.sessions(request_body, headers: { 'Idempotency-Key' => 'UUID' })
```

#### NodeJS (TypeScript)

```ts
// Adyen Node API Library v18.0.0
// Require the parts of the module you want to use
import { Client, CheckoutAPI, Types } from "@adyen/api-library";
// Initialize the client object
// For the live environment, additionally include your liveEndpointUrlPrefix.
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const amount: Types.checkout.Amount = {
  currency: "USD",
  value: 1000
};

const createCheckoutSessionRequest: Types.checkout.CreateCheckoutSessionRequest = {
  reference: "YOUR_ORDER_NUMBER",
  storePaymentMethodMode: Types.checkout.CreateCheckoutSessionRequest.StorePaymentMethodModeEnum.AskForConsent,
  amount: amount,
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  recurringProcessingModel: Types.checkout.CreateCheckoutSessionRequest.RecurringProcessingModelEnum.CardOnFile,
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.."
};

// Send the request
const checkoutAPI = new CheckoutAPI(client);
const response = checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" });
```

#### v69

To ask the shopper if they want to store their Cash App Pay details, set `enableStoreDetails` to **true** when [adding the Cash App Pay Component](#component-configuration). This shows a toggle that lets the shopper choose whether to save their payment details.

To store the shopper's payment details without showing a toggle, set `storePaymentMethodMode` to **enabled** in your [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request and set `storePaymentMethod` to **true** in the Component configuration object. Use this, for example, for a page where the shopper enters their details for a subscription service that charges the shopper on a recurring basis.

### Tab: Advanced flow

To store a shopper's Cash App Pay details, set `enableStoreDetails` to **true** when [adding the Cash App Pay Component](#component-configuration). This shows a checkbox for your shopper to choose to store their details. You can also store the details automatically by setting `storePaymentMethod` to **true** in the Component configuration.

If the shopper chooses to save their card details when making a payment, the `onChange` or `onSubmit` method from the Component includes a `state.data.storePaymentMethod`. Pass this to your server.

To create a token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

* `storePaymentMethod`: The `state.data.storePaymentMethod` from your front end.
* [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): Your unique identifier for the shopper.

### Show stored Cash App Pay details

To add available stored payment details in your payment form:

1. In your [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request, include:

   * [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): The unique shopper identifier that you specified when creating the token.

2. In the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response, note the `storedPaymentMethods` array. This contains the stored payment methods for this shopper.

3. Add stored payment details to your payment form:\
   a. Create a DOM element for stored payment methods, placing it where you want the form to be rendered:

   ```xml
   <div id="stored-cashapp"></div>
   ```

   b. Get the stored payment methods that you want to show from the `checkout.paymentMethodsResponse` object, and pass this when creating an instance of the Cash App Pay Component:

   ```js
   const storedPaymentMethod = checkout.paymentMethodsResponse.storedPaymentMethods[0];
   const cashAppPayElement = checkout.create("cashapp", storedPaymentMethod).mount("#stored-cashapp");
   ```

4. If `state.isValid` is **true**, collect the `state.data` and pass this to your server. You need this data to make a payment.

### Get the shopper's $cashtag

We recommend making sure that your recurring payments include the shopper's **$cashtag**. The $cashtag makes it easier for the shopper to recognize the recurring payment as a legitimate one. This helps to avoid chargebacks.

To obtain the shopper's $cashtag, you need to make a `/payments/details` request. If you are using the Sessions flow and want to include the $cashtag in recurring payments, you need to switch to the Advanced flow and implement both the `/payments/details` request and the `/payments` request.

### Tab: Advanced flow

1. Make sure that you have enabled receiving the shopper's $cashtag:\
   In your Customer Area, go to **Developers** > **Additional Data** and select **Token information for digital wallets**.

2. Make a POST [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) request. For instructions, see [Submit additional payment details](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=Components\&version=latest#send-additional-payment-details).

3. From the `/payments/details` response, save the following `additionalData` details:

   | Parameter                                           | Description                                                 |
   | --------------------------------------------------- | ----------------------------------------------------------- |
   | `additionalData.cashapp.cashtag`                    | The shopper's $cashtag.                                     |
   | `additionalData.tokenization.shopperReference`      | The shopper reference you specified in the payment request. |
   | `additionalData.tokenization.storedPaymentMethodId` | The token that was generated through the payment request.   |

   Note that the [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) also includes the shopper reference and the recurring detail reference, but not the $cashtag.

   **/payments/details response with $cashtag and recurring details**

   ```json
   {
      "additionalData": {
         "cashapp.cashtag": "$CASHTAG_C_TOKEN",
         "tokenization.shopperReference": "YOUR_SHOPPER_REFERENCE",
         "tokenization.storedPaymentMethodId": "M5N7TQ4TG5PFWR50"
      },
      "amount":{
         "currency":"USD",
         "value":1000
      },
      "merchantRreference":"YOUR_ORDER_NUMBER",
      "paymentMethod":{
         "type":"cashapp",
         "subtype":"redirect"
      },
      "pspReference":"V4HZ4RBFJGXXGN82",
      "resultCode":"Authorised"
   }
   ```

### Make a payment with stored Cash App Pay details

### Tab: Sessions flow

When the shopper selects **Pay**, the Component submits the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request.

### Tab: Advanced flow

When the shopper selects to pay, the Component calls the `onSubmit` event, which contains a `state.data`.

1. Pass the `state.data` to your server.

2. From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying:

   * The parameters required for one-off or recurring tokenized payments. For instructions, see [Tokenization](/online-payments/tokenization).
   * `paymentMethod`: The `state.data.paymentMethod` from the `onSubmit` event.

   To make it easier for the shopper to recognize the recurring payment as a legitimate one, optionally include:

   * `paymentMethod.cashtag`: the shoppers [$cashtag](#cashtag).

   **Payment request with a token**

   #### curl

   ```bash
   curl https://checkout-test.adyen.com/v68/payments \
   -H 'x-api-key: ADYEN_API_KEY' \
   -H 'content-type: application/json' \
   -d '{
        "amount": {
          "value": 1000,
          "currency": "USD"
        },
        "paymentMethod": {
          "cashtag":"$CASHTAG_C_TOKEN",
          "storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
          "type":"cashapp"
        },
        "reference": "YOUR_ORDER_NUMBER",
        "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
        "returnUrl": "...",
        "shopperReference": "YOUR_SHOPPER_REFERENCE",
        "shopperInteraction": "ContAuth",
        "recurringProcessingModel": "CardOnFile"
    }'
   ```

   #### Java

   ```java
   // Adyen Java API Library v27.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.model.checkout.*;
   import java.time.OffsetDateTime;
   import java.util.*;
   import com.adyen.model.RequestOptions;
   import com.adyen.service.checkout.*;

   // For the live environment, additionally include your liveEndpointUrlPrefix.
   Client client = new Client("ADYEN_API_KEY", Environment.TEST);

   // Create the request object(s)
   Amount amount = new Amount()
     .currency("USD")
     .value(1000L);

   CashAppDetails cashAppDetails = new CashAppDetails()
     .cashtag("$CASHTAG_C_TOKEN"),
     .storedPaymentMethodId("M5N7TQ4TG5PFWR50")
     .type(CashAppDetails.TypeEnum.CASHAPP);

   PaymentRequest paymentRequest = new PaymentRequest()
     .reference("YOUR_ORDER_NUMBER")
     .amount(amount)
     .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
     .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE)
     .paymentMethod(new CheckoutPaymentMethod(cashAppDetails))
     .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)
     .returnUrl("...")
     .shopperReference("YOUR_SHOPPER_REFERENCE");

   // Send the request
   PaymentsApi service = new PaymentsApi(client);
   PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
   ```

   #### PHP

   ```php
   // Adyen PHP API Library v19.0.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Model\Checkout\Amount;
   use Adyen\Model\Checkout\CheckoutPaymentMethod;
   use Adyen\Model\Checkout\PaymentRequest;
   use Adyen\Service\Checkout\PaymentsApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   // For the live environment, additionally include your liveEndpointUrlPrefix.
   $client->setEnvironment(Environment::TEST);


   // Create the request object(s)
   $amount = new Amount();
   $amount
     ->setCurrency("USD")
     ->setValue(1000);

   $checkoutPaymentMethod = new CheckoutPaymentMethod();
   $checkoutPaymentMethod
     ->setCashtag("$CASHTAG_C_TOKEN")
     ->setStoredPaymentMethodId("M5N7TQ4TG5PFWR50")
     ->setType("cashapp");

   $paymentRequest = new PaymentRequest();
   $paymentRequest
     ->setReference("YOUR_ORDER_NUMBER")
     ->setAmount($amount)
     ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
     ->setRecurringProcessingModel("CardOnFile")
     ->setPaymentMethod($checkoutPaymentMethod)
     ->setShopperInteraction("ContAuth")
     ->setReturnUrl("...")
     ->setShopperReference("YOUR_SHOPPER_REFERENCE");

   $requestOptions['idempotencyKey'] = 'UUID';

   // Send the request
   $service = new PaymentsApi($client);
   $response = $service->payments($paymentRequest, $requestOptions);
   ```

   #### C\#

   ```cs
   // Adyen .net API Library v17.0.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Model;
   using Adyen.Model.Checkout;
   using Adyen.Service.Checkout;

   // For the live environment, additionally include your liveEndpointUrlPrefix.
   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Create the request object(s)
   Amount amount = new Amount
   {
     Currency = "USD",
     Value = 1000
   };

   CashAppDetails cashAppDetails = new CashAppDetails
   {
     Cashtag = "$CASHTAG_C_TOKEN",
     StoredPaymentMethodId = "M5N7TQ4TG5PFWR50",
     Type = CashAppDetails.TypeEnum.Cashapp
   };

   PaymentRequest paymentRequest = new PaymentRequest
   {
     Reference = "YOUR_ORDER_NUMBER",
     Amount = amount,
     MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
     RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
     PaymentMethod = new CheckoutPaymentMethod(cashAppDetails),
     ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,
     ReturnUrl = "...",
     ShopperReference = "YOUR_SHOPPER_REFERENCE"
   };

   // Send the request
   var service = new PaymentsService(client);
   var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
   ```

   #### NodeJS (JavaScript)

   ```js
   // Adyen Node API Library v18.0.0
   // Require the parts of the module you want to use
   const { Client, CheckoutAPI } = require('@adyen/api-library');
   // Initialize the client object
   // For the live environment, additionally include your liveEndpointUrlPrefix.
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Create the request object(s)
   const paymentRequest = {
     amount: {
       value: 1000,
       currency: "USD"
     },
     paymentMethod: {
       cashtag: "$CASHTAG_C_TOKEN",
       storedPaymentMethodId: "M5N7TQ4TG5PFWR50",
       type: "cashapp"
     },
     reference: "YOUR_ORDER_NUMBER",
     merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
     returnUrl: "...",
     shopperReference: "YOUR_SHOPPER_REFERENCE",
     shopperInteraction: "ContAuth",
     recurringProcessingModel: "CardOnFile"
   }

   // Send the request
   const checkoutAPI = new CheckoutAPI(client);
   const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
   ```

   #### Go

   ```go
   // Adyen Go API Library v10.4.0
   import (
     "context"
     "github.com/adyen/adyen-go-api-library/v9/src/common"
     "github.com/adyen/adyen-go-api-library/v9/src/adyen"
     "github.com/adyen/adyen-go-api-library/v9/src/checkout"
   )
   // For the live environment, additionally include your liveEndpointUrlPrefix.
   client := adyen.NewClient(&common.Config{
     ApiKey:      "ADYEN_API_KEY",
     Environment: common.TestEnv,
   })

   // Create the request object(s)
   amount := checkout.Amount{
     Currency: "USD",
     Value: 1000,
   }

   cashAppDetails := checkout.CashAppDetails{
     Cashtag: common.PtrString("$CASHTAG_C_TOKEN"),
     StoredPaymentMethodId: common.PtrString("M5N7TQ4TG5PFWR50"),
     Type: common.PtrString("cashapp"),
   }

   paymentRequest := checkout.PaymentRequest{
     Reference: "YOUR_ORDER_NUMBER",
     Amount: amount,
     MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
     RecurringProcessingModel: common.PtrString("CardOnFile"),
     PaymentMethod: checkout.CashAppDetailsAsCheckoutPaymentMethod(&cashAppDetails),
     ShopperInteraction: common.PtrString("ContAuth"),
     ReturnUrl: "...",
     ShopperReference: common.PtrString("YOUR_SHOPPER_REFERENCE"),
   }

   // Send the request
   service := client.Checkout()
   req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
   res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
   ```

   #### Python

   ```py
   # Adyen Python API Library v12.5.1
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   # For the live environment, additionally include your liveEndpointUrlPrefix.
   adyen.client.platform = "test" # The environment to use library in.

   # Create the request object(s)
   json_request = {
     "amount": {
       "value": 1000,
       "currency": "USD"
     },
     "paymentMethod": {
       "cashtag": "$CASHTAG_C_TOKEN",
       "storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
       "type": "cashapp"
     },
     "reference": "YOUR_ORDER_NUMBER",
     "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
     "returnUrl": "...",
     "shopperReference": "YOUR_SHOPPER_REFERENCE",
     "shopperInteraction": "ContAuth",
     "recurringProcessingModel": "CardOnFile"
   }

   # Send the request
   result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
   ```

   #### Ruby

   ```rb
   # Adyen Ruby API Library v9.5.1
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   # For the live environment, additionally include your liveEndpointUrlPrefix.
   adyen.env = :test # Set to "live" for live environment

   # Create the request object(s)
   request_body = {
     :amount => {
       :value => 1000,
       :currency => 'USD'
     },
     :paymentMethod => {
       :cashtag => '$CASHTAG_C_TOKEN',
       :storedPaymentMethodId => 'M5N7TQ4TG5PFWR50',
       :type => 'cashapp'
     },
     :reference => 'YOUR_ORDER_NUMBER',
     :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT',
     :returnUrl => '...',
     :shopperReference => 'YOUR_SHOPPER_REFERENCE',
     :shopperInteraction => 'ContAuth',
     :recurringProcessingModel => 'CardOnFile'
   }

   # Send the request
   result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
   ```

   #### NodeJS (TypeScript)

   ```ts
   // Adyen Node API Library v18.0.0
   // Require the parts of the module you want to use
   import { Client, CheckoutAPI, Types } from "@adyen/api-library";
   // Initialize the client object
   // For the live environment, additionally include your liveEndpointUrlPrefix.
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Create the request object(s)
   const amount: Types.checkout.Amount = {
     currency: "USD",
     value: 1000
   };

   const cashAppDetails: Types.checkout.CashAppDetails = {
     cashtag: "$CASHTAG_C_TOKEN",
     storedPaymentMethodId: "M5N7TQ4TG5PFWR50",
     type: Types.checkout.CashAppDetails.TypeEnum.Cashapp
   };

   const paymentRequest: Types.checkout.PaymentRequest = {
     reference: "YOUR_ORDER_NUMBER",
     amount: amount,
     merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
     recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
     paymentMethod: cashAppDetails,
     shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,
     returnUrl: "...",
     shopperReference: "YOUR_SHOPPER_REFERENCE"
   };

   // Send the request
   const checkoutAPI = new CheckoutAPI(client);
   const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
   ```

3. In the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response, note the following:

   * `resultCode`: Use this to [present the payment result to your shopper](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=Drop-in#get-the-payment-outcome).

   **Response**

   ```json
   {
      "pspReference": "8815329842815468",
      "resultCode": "Authorised"
   }
   ```

### Receive a notification when a shopper deletes stored Cash App Pay details

When a shopper deletes their stored payment details in Cash App Pay, Adyen sends a `recurring.token.disabled` webhook.\
You can prevent future failed payments by removing the stored token for Cash App pay and asking the shopper to use another payment method.

**Example recurring.token.disabled notification**

```json
{
"createdAt" : "2025-08-12T18:58:11+02:00",
"environment" : "test",
"type" : "recurring.token.disabled",
"data" : {
   "merchantAccount" : " YOUR_MERCHANT_ACCOUNT",
   "shopperReference" : "YOUR_SHOPPER_REFERENCE",
   "storedPaymentMethodId" : "G7NRRBC9H7VGGS75",
   "type" : "cashapp"
},
"eventId" : "N4P54KZTS2SVS3V5"
}
```

## Test and go live

Test your Cash App Pay integration using the test environment. You can simulate various payment scenarios using Cash App Pay [magic values](https://developers.cash.app/cash-app-pay-partner-api/guides/technical-guides/sandbox/developer-sandbox#magic-values). You can check the status of Cash App Pay test payments in your Customer Area, under **Transactions** > **Payments**.

When you are ready to go live, add Cash App Pay in your live Customer Area.
