Skip to main content
You can accept Venmo for secure payments from US customers with the JavaScript SDK v6. This guide shows you how to set up your environment, review eligibility requirements, add Venmo payments, and work with advanced features.

Prerequisites

Before beginning your integration, meet these requirements:
  • Create a PayPal developer account.
  • Use a PayPal business account to accept Venmo payments
  • Set up your sandbox credentials.
Note: You’ll use your sandbox credentials to create a .env file during the Development setup.

Eligibility

  • US-based merchants and US-based consumers only.
  • Payment must be in USD.

Development setup

Before continuing, complete the steps in the PayPal v6 Web SDK sample integration README. Configure your local development environment with the required dependencies and credentials. Install project dependencies:
Create environment configuration:
Start the development server:
To load the application, see http://localhost:3000.

Implementation steps

Step 1: HTML structure setup

Create your HTML page and include the PayPal SDK script.

Step 2: Initialize PayPal SDK

Set up the PayPal SDK with the Venmo component after it loads.

Step 3: Configure Venmo button

Create the Venmo payment session and set up the button.

Step 4. Configure payment session callbacks

Define callback handlers for payment approval, cancellation, and error scenarios.

Step 5. Choose presentation mode

The presentation mode determines how the payment UI appears for the customer.
Note: Use "auto" mode to let Venmo attempt popup first and automatically fall back to modal if popups are blocked.

API endpoints

The integration requires these server-side endpoints.

Client token endpoint

Create order endpoint

Capture order endpoint

Key components

Integrate Venmo effectively by understanding the essential parts of the JavaScript SDK v6 workflow.
Key componentPurposeDetails
PayPal SDK instanceMain entry point for PayPal functionality
  • Includes venmo-payments component
  • Requires client token from server
Eligibility checkDetermines if Venmo is available
  • Based on user location, device type, currency, and account status
  • Always check before showing Venmo button
Payment sessionManages Venmo payment flow and callbacks
  • Handles approve, cancel, and error scenarios
  • Created once and reused for multiple payment attempts
Presentation modesDefines how Venmo is displayed
  • Auto — Best mode selected automatically (Recommended)
  • Popup — Opens in popup window that may be blocked
  • Modal — Opens in overlay modal
  • Redirect — Full page redirect to Venmo

Security considerations

  • Request client tokens from your server only.
  • Never expose client secrets in frontend code.
  • Process all payments through PayPal’s servers.
  • Use HTTPS in production.

Testing

  • Run transactions across desktop and mobile devices.
  • Verify eligibility logic and Venmo button rendering.
  • Test payment approval, cancellation, and error handling.

Advanced features

Enhance your Venmo integration with advanced capabilities.

Custom order creation

Create a custom order endpoint to control purchase details and items more precisely. Use this pattern when your integration or product requires flexible order payloads.

Error handling best practices

Establish error handling for your payment flows. The following approach provides user-friendly messages and optional actions on payment failure, success, and cancellation.

React integration

Integrate Venmo payments for React applications.

Resources