> 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 Venmo Payments

## Overview

This guide covers the three ways to accept Venmo with Coinflow:

1. **[Prebuilt Checkout UI (iframe)](#option-1-prebuilt-checkout-ui-iframe)** — Venmo appears automatically inside Coinflow's hosted checkout.
2. **[`CoinflowVenmoButton` SDK component](#option-2-coinflowvenmobutton-sdk-component)** — Embed the Venmo button in your own checkout UI.
3. **[Direct API + PayPal SDK](#option-3-direct-api--paypal-sdk)** — Render the Venmo button with PayPal's own SDK and call Coinflow's checkout endpoints directly.

> **Warning**
>
> Before using any of these options, Venmo must be enabled on your Coinflow account. Contact your Coinflow integrations team to have Venmo configured.

> **Info**
>
> Venmo is a **US-only** payment method. The button only renders when Venmo is an eligible funding source for the customer (US buyers); for everyone else it will not appear.

## Option 1: Prebuilt Checkout UI (iframe)

This is the simplest path. If you already embed Coinflow's hosted checkout, there is **nothing to build** — once Venmo is enabled on your account, the Venmo button automatically appears alongside your other payment methods in the checkout iframe.

#### Request Venmo activation

Contact your Coinflow integrations team to enable Venmo on your account.

#### Confirm it appears

Load your existing Coinflow checkout from an eligible US customer's perspective. The Venmo button will render automatically with no code changes required.

If you have not yet integrated the hosted checkout, see [Implement Checkout](/guides/developer-resources/checkout-implementation) for how to embed the `CoinflowPurchase` component.

## Option 2: CoinflowVenmoButton SDK Component

Use the `CoinflowVenmoButton` component when you have built your own checkout UI but want Coinflow to manage the Venmo order creation, approval flow, and settlement. You render a single React component where you want the Venmo button to appear, and Coinflow handles the rest inside a secure iframe.

> **Info**
>
> Unlike the `CoinflowPayPalButton`, Venmo's approval flow runs in a **popup window** rather than an in-page overlay. The button iframe stays inline, so there is no overlay element to position over and **no `overlayId` prop**.

#### Install the SDK

```bash
npm install @coinflowlabs/react
```

#### Render the button

Drop `CoinflowVenmoButton` into your checkout and handle the `onApprove` callback to drive your post-purchase UI.

```tsx
import {CoinflowVenmoButton, Currency} from '@coinflowlabs/react';

function VenmoCheckout() {
  return (
    <CoinflowVenmoButton
      env={'sandbox'} // 'prod' | 'sandbox'
      merchantId={'YOUR_MERCHANT_ID'}
      sessionKey={'USER_SESSION_KEY'} // From: /api-reference/api-reference/authentication/get-session-key
      subtotal={{cents: 500, currency: Currency.USD}}
      email={'customer@example.com'}
      handleHeightChange={(height) => {
        /* size the button container */
      }}
      onApprove={({paymentId}) => {
        // Payment approved — show your own confirmation screen.
        console.log('Venmo payment complete', paymentId);
      }}
      onError={(error) => {
        console.error('Venmo payment failed', error);
      }}
    />
  );
}
```

### Component Props

In addition to the standard Coinflow purchase props (`env`, `merchantId`, `sessionKey`, `subtotal`, `handleHeightChange`, etc.), the `CoinflowVenmoButton` accepts the following:

| Prop          | Type                                            | Required                | Description                                                                                        |
| ------------- | ----------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------- |
| `onApprove`   | `(info: {paymentId: string}) => void`           | Yes                     | Fires once the Venmo purchase is approved and complete. Use it to drive your own post-purchase UI. |
| `email`       | `string`                                        | One identifier required | Email tied to the Venmo account, used to create the order.                                         |
| `phoneNumber` | `{countryCode: string; nationalNumber: string}` | One identifier required | Phone number tied to the Venmo account, used to create the order.                                  |
| `token`       | `string`                                        | One identifier required | A saved Venmo account token, used to create the order directly.                                    |
| `onError`     | `(error) => void`                               | No                      | Fires when the Venmo payment fails.                                                                |

> **Info**
>
> The button requires at least one customer identifier — `email`, `phoneNumber`, or `token`. Until one is provided, the button renders disabled.

## Option 3: Direct API + PayPal SDK

This is the most flexible path. Venmo runs on the [PayPal JS SDK](https://developer.paypal.com/sdk/js/) — you load the SDK with Venmo enabled as a funding source, render the Venmo button, and call Coinflow's Venmo checkout endpoints to create the order. Use this when you need full control over the Venmo experience.

#### Fetch your PayPal merchant ID

Venmo uses your PayPal merchant configuration. Call the [Get Merchant (v2)](/api-reference/api-reference/merchant/get-merchant-v-2) endpoint and read `merchant.paypalMerchantId` from the response. This value is passed to the PayPal SDK as the `merchant-id`.

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

**Response (truncated):**

```json
{
  "merchant": {
    "paypalMerchantId": "EXAMPLE_PAYPAL_MERCHANT_ID"
  }
}
```

> **Info**
>
> `paypalMerchantId` is unique to your account and is set when the integrations team enables PayPal/Venmo. The value above is an **example only** — read the real value from the API response.

#### Initialize the PayPal SDK with Venmo enabled

Load the PayPal JS SDK using your `paypalMerchantId` as the `merchant-id` and the Coinflow-provided PayPal `client-id`. Initialize with `intent=authorize`, pass `enable-funding=venmo`, and set the partner attribution ID (BN code) to `CoinflowLabsLimited_PSP` via the `data-partner-attribution-id` attribute on the script tag.

```html
<script
  src="https://www.paypal.com/sdk/js?client-id=<PAYPAL_CLIENT_ID>&merchant-id=<PAYPAL_MERCHANT_ID>&currency=USD&intent=authorize&components=buttons&enable-funding=venmo&disable-funding=paylater"
  data-partner-attribution-id="CoinflowLabsLimited_PSP"
></script>
```

> **Warning**
>
> You **must** pass the `data-partner-attribution-id` (BN code) `CoinflowLabsLimited_PSP` when loading the SDK. This identifies the integration as processed through Coinflow — payments will not be attributed correctly without it.

> **Info**
>
> Venmo only renders for US customers. When testing against a non-production environment, the SDK should be loaded with `buyer-country=US` so the Venmo funding source is eligible.

> **Warning**
>
> The sandbox `client-id` is:
>
> `AZ27v54Pd6dItFBi39hcHPCSrFSbaylVU4ExPpHi3z0UIIDquGWG4psZK63Sz1EUZVKXyh3ucAAWE9oS`
>
> This value is for **sandbox only**. Contact your Coinflow integrations team for the production `client-id`.

#### Create the order via Coinflow

Render the Venmo button with `fundingSource` set to the Venmo funding source and, in its `createOrder` callback, call the [Venmo New Checkout](/api-reference/api-reference/checkout/new-venmo-checkout) endpoint. Coinflow creates the order and returns a `paymentId`.

```bash
curl --location 'https://api-sandbox.coinflow.cash/api/checkout/venmo/<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,
    "currency": "USD"
  },
  "venmo": {
    "email": "customer@example.com"
  }
}'
```

**Response:**

```json
{
  "paymentId": "EXAMPLE_PAYMENT_ID"
}
```

> **Info**
>
> The `venmo` object accepts either an `email` or a `phoneNumber` (`{countryCode, nationalNumber}`) tied to the customer's Venmo account.

> **Info**
>
> The `paymentId` returned by Coinflow **is** the Venmo/PayPal order ID. Return it directly from your `createOrder` callback so the PayPal SDK uses it as the order ID — do not create a separate order with PayPal.

For customers paying with a previously saved Venmo account, call the [Venmo Saved Checkout](/api-reference/api-reference/checkout/saved-venmo-checkout) endpoint instead and pass the saved `token`.

> **Tip**
>
> If vaulting is enabled on your account and the customer's saved Venmo account carries `vaulted: true`, call the [Venmo Vaulted Checkout](/api-reference/api-reference/checkout/vaulted-venmo-checkout) endpoint instead — the payment authorizes immediately with no Venmo approval step, giving returning customers a one-click checkout. See [Venmo Vaulting](/guides/checkout/payment-methods/payment-methods/venmo/venmo-vaulting).

```tsx
paypal.Buttons({
  fundingSource: paypal.FUNDING.VENMO,
  style: {layout: 'horizontal', shape: 'rect', height: 48, tagline: false},
  createOrder: async () => {
    const res = await fetch(
      `https://api-sandbox.coinflow.cash/api/checkout/venmo/${merchantId}`,
      {
        method: 'POST',
        headers: {
          'content-type': 'application/json',
          'x-coinflow-auth-session-key': sessionKey,
        },
        body: JSON.stringify({
          subtotal: {cents: 500, currency: 'USD'},
          venmo: {email: 'customer@example.com'},
        }),
      }
    );
    const {paymentId} = await res.json();
    // Coinflow's paymentId IS the Venmo order ID — return it directly.
    return paymentId;
  },
  onApprove: async (data) => {
    // Payment approved by the customer in Venmo.
    console.log('Approved', data.orderID);
  },
  onError: (err) => console.error(err),
}).render('#venmo-button-container');
```

> **Info**
>
> Render the Venmo button only where it is eligible. The PayPal SDK exposes `isEligible()` on the button instance — skip rendering when it returns `false` rather than forcing the button to appear.

#### Confirm settlement with webhooks

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

## Important Notes

> **Account Configuration:** Venmo must be enabled on your account by the Coinflow integrations team before any of these options will work.

> **US Only:** Venmo is available only to US customers. The button renders only when Venmo is an eligible funding source.

> **PayPal Rails:** Venmo runs on PayPal's processor. It uses your `paypalMerchantId` and the same PayPal `client-id`, loaded with `enable-funding=venmo`.

> **Sandbox vs. Production:** The sandbox `client-id` provided above only works against the PayPal and Coinflow sandbox environments. Use your production `client-id` (from the integrations team) and the production API base URL (`https://api.coinflow.cash`) when going live.

> **Settlement:** Regardless of which integration path you choose, funds are delivered to your configured settlement location, and the recommended way to confirm completion is by listening for `Settled` webhook events.