> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.coinflow.cash/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.coinflow.cash/_mcp/server.

# How To: Implement Cash App Payments

## Overview

Merchants can accept payments from customers using Cash App. The integration flow works by creating a checkout order via the API, rendering the returned link as a QR code for desktop users, and automatically redirecting mobile users into the Cash App application via deep link.

## API Implementation

### 1. Create a Cash App Checkout Order

Call the [Cash App Checkout](/api-reference/api-reference/checkout/cash-app-checkout) endpoint:

```bash
curl --location 'https://api-sandbox.coinflow.cash/api/checkout/cashapp/<YOUR_MERCHANT_ID>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-coinflow-auth-session-key: <YOUR_SESSION_KEY>' \
--data-raw '{
  "subtotal": {
    "cents": 500
  },
  "email": "customer@example.com"
}'
```

**Response:**

```json
{
  "paymentId": "abc123-def456",
  "cashAppLink": "https://cash.app/pay/...",
  "expiresAt": "2026-03-27T12:30:00.000Z"
}
```

| Field         | Description                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------- |
| `paymentId`   | Unique identifier for the payment. Use this to poll for status updates.                     |
| `cashAppLink` | URL the customer must visit to complete payment. Render as a QR code or redirect on mobile. |
| `expiresAt`   | Expiration time for the payment link. The customer must complete payment before this time.  |

### 2. Display the Cash App Link

Render the `cashAppLink` as a QR code so desktop users can scan it with the Cash App on their phone.

You may use any QR code library. Below is an example using [cuer](https://github.com/wevm/cuer):

```tsx
import { Cuer } from 'cuer';

function CashAppQrCode({ cashAppLink }: { cashAppLink: string }) {
  return (
    <Cuer
      value={cashAppLink}
      size={240}
      color="#111827"
      errorCorrection="quartile"
    />
  );
}
```

### 3. Redirect Mobile Users (Recommended)

On mobile devices, it is recommended to automatically redirect the user to the `cashAppLink`. This deep links directly into the Cash App application where the customer can approve the payment.

```tsx
import { useEffect, useRef } from 'react';

function useCashAppRedirect(cashAppLink: string | undefined) {
  const redirectedRef = useRef<string | null>(null);

  useEffect(() => {
    if (!cashAppLink) return;

    const ua = navigator.userAgent || navigator.vendor;
    const isMobile = /iPad|iPhone|iPod|Android/.test(ua);
    if (!isMobile) return;

    if (redirectedRef.current === cashAppLink) return;
    redirectedRef.current = cashAppLink;
    window.location.href = cashAppLink;
  }, [cashAppLink]);
}
```

> **Tip:** Always provide a fallback "Open in Cash App" button for cases where the automatic redirect does not trigger (e.g. in-app browsers or WebViews).

### 4. Poll for Payment Status

After the customer is redirected, poll the payment status to determine when the payment has been completed:

```bash
curl --location 'https://api-sandbox.coinflow.cash/api/customer/history/<PAYMENT_ID>' \
--header 'accept: application/json' \
--header 'x-coinflow-auth-session-key: <YOUR_SESSION_KEY>'
```

Check the `status` field in the response. Possible statuses include:

| Status       | Description                                                                |
| ------------ | -------------------------------------------------------------------------- |
| `initiated`  | Payment link created, waiting for customer.                                |
| `processing` | Customer has started the payment in Cash App.                              |
| `deposited`  | Payment received and being processed.                                      |
| `settled`    | Payment settled. Funds delivered to merchant's chosen settlement location. |
| `failed`     | Payment failed or was declined.                                            |
| `expired`    | Payment link expired before the customer paid.                             |

### 5. Listen for Webhooks

Configure your [webhook endpoint](/guides/developer-resources/webhooks/checkout-webhooks) to listen for `Settled` events. This is the recommended way to confirm that a payment has completed rather than relying solely on polling.

## Important Notes

> **Payment Window:** Once a `cashAppLink` is generated, the customer has a limited time window to complete the payment (indicated by `expiresAt`). If the link expires, the payment status will change to `expired` and you will need to create a new checkout order.

> **Sandbox:** In sandbox mode, Cash App payments are processed by a mock provider and complete automatically. There is no need to scan the QR code or open Cash App during testing.

> **Mobile Deep Linking:** The `cashAppLink` supports deep linking into the Cash App on both iOS and Android. For the best user experience on mobile, redirect the user to this URL automatically rather than requiring them to scan a QR code.