How To: Implement Cash App Payments

Learn how to accept Cash App payments via the Coinflow API.

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 endpoint:

$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-blockchain: solana' \
>--header 'x-coinflow-auth-session-key: <YOUR_SESSION_KEY>' \
>--data-raw '{
> "subtotal": {
> "cents": 500
> },
> "email": "customer@example.com"
>}'

Response:

1{
2 "paymentId": "abc123-def456",
3 "cashAppLink": "https://cash.app/pay/...",
4 "expiresAt": "2026-03-27T12:30:00.000Z"
5}
FieldDescription
paymentIdUnique identifier for the payment. Use this to poll for status updates.
cashAppLinkURL the customer must visit to complete payment. Render as a QR code or redirect on mobile.
expiresAtExpiration time for the payment link. The customer must complete payment before this time.

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:

1import { Cuer } from 'cuer';
2
3function CashAppQrCode({ cashAppLink }: { cashAppLink: string }) {
4 return (
5 <Cuer
6 value={cashAppLink}
7 size={240}
8 color="#111827"
9 errorCorrection="quartile"
10 />
11 );
12}

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.

1import { useEffect, useRef } from 'react';
2
3function useCashAppRedirect(cashAppLink: string | undefined) {
4 const redirectedRef = useRef<string | null>(null);
5
6 useEffect(() => {
7 if (!cashAppLink) return;
8
9 const ua = navigator.userAgent || navigator.vendor;
10 const isMobile = /iPad|iPhone|iPod|Android/.test(ua);
11 if (!isMobile) return;
12
13 if (redirectedRef.current === cashAppLink) return;
14 redirectedRef.current = cashAppLink;
15 window.location.href = cashAppLink;
16 }, [cashAppLink]);
17}

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:

$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:

StatusDescription
initiatedPayment link created, waiting for customer.
processingCustomer has started the payment in Cash App.
depositedPayment received and being processed.
settledPayment settled. USDC delivered to merchant.
failedPayment failed or was declined.
expiredPayment link expired before the customer paid.

5. Listen for Webhooks

Configure your webhook endpoint 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.