Prebuilt Coinflow UI for Subscriptions
Overview
Coinflow provides a prebuilt UI component that makes it easy to implement subscription purchases without building your own payment interface. The CoinflowPurchase component handles the entire subscription purchase flow, including payment method collection, subscription creation, and initial payment processing.
When to Use This Method
Choose this when you want the fastest subscription integration
- React or Next.js applications
- Teams wanting to launch subscriptions quickly (hours to days)
- Businesses validating subscription business models
- Startups without dedicated payment UI resources
- Standard subscription flows without complex customization
- Platforms preferring Coinflow-maintained payment forms
Integration time: Hours, not days
These scenarios benefit from custom API implementation
- Non-React frameworks (Vue, Angular, vanilla JS, mobile)
- Custom branded checkout matching your exact design
- Complex subscription logic (trials, prorations, upgrades)
- Custom payment flows beyond standard subscription purchase
- Backend-only systems without frontend components
- Multi-step checkout with additional business logic
→ See API Integration for full control
Start Simple, Customize Later
Most merchants begin with this prebuilt UI to validate their subscription offering (hours of integration), then migrate to API integration for custom experiences (1-2 weeks). Both methods support the same payment methods and features.
Installation
Install the Coinflow React package:
Basic Implementation
To use the prebuilt purchase component for subscriptions, you need to:
- Import the
CoinflowPurchasecomponent - Provide your
merchantIdand the subscriptionplanCode - Configure the component with appropriate callbacks
Example Implementation
Component Preview
Key Features
Automatic Plan Details Display
The component automatically fetches and displays:
- Plan name and description
- Subscription price
- Billing frequency (Monthly/Yearly)
- Duration (if applicable)
Multiple Payment Methods
The prebuilt UI supports:
- Credit/Debit Cards - Visa, Mastercard, American Express, Discover
- ACH Bank Transfers - Direct bank account payments
- Saved Payment Methods - Returning customers can use previously saved cards or bank accounts
Built-in Features
- Secure Payment Processing - PCI-compliant card handling
- Responsive Design - Works on desktop and mobile devices
- Customizable Branding - Match your brand colors and style
- Error Handling - Clear error messages for failed payments
- Loading States - Smooth loading indicators during processing
Configuration Options
Required Props
Optional Props
Subscription Flow
When a customer uses the prebuilt UI:
- Plan Display - The component shows the subscription details
- Payment Method - Customer enters credit card or connects bank account
- Initial Payment - First payment is processed immediately
- Subscription Creation - If payment succeeds, subscription is created
- Recurring Billing - Future payments are automatically processed according to the plan schedule
Session Key Generation
Before using the component, you must generate a session key for the customer on your backend:
Important: Session keys should be generated server-side to protect your API key. Never expose your API key in client-side code.
For more details, see the session key API reference.
Chargeback Protection
Include product details to enable chargeback protection:
Customization
Theme Customization
Customize the component appearance to match your brand:
Custom Callbacks
Handle subscription events:
Testing
To test subscriptions in sandbox mode:
- Use the sandbox environment:
env={'sandbox'} - Use test credit cards from our testing guide
- For ACH testing, use Plaid’s test credentials
Test Cards
- Successful Payment:
4111 1111 1111 1111 - Declined Payment:
4000 0000 0000 0002 - Insufficient Funds:
4000 0000 0000 9995
Use any future expiration date and any 3-digit CVV.

