CoinFlow Setup Guide
Get started with CoinFlow integration in under 10 minutes.
Prerequisites
- A HedgePayments account
- Node.js 18+ installed
- Basic understanding of React/Next.js
Step 1: Create CoinFlow Account
- Visit coinflow.cash
- Click “Get Started” or “Sign Up”
- Complete the registration form
- Verify your email address
Step 2: Get Your Credentials
Sandbox Credentials (for testing)
- Log into your CoinFlow dashboard
- Navigate to Settings → API Keys
- Copy your sandbox credentials:
- Merchant ID
- API Key
- Webhook Secret
Production Credentials (for live payments)
- Complete merchant verification (KYC)
- Navigate to Settings → API Keys → Production
- Generate and copy production credentials
Never commit API keys to version control. Always use environment variables.
Create a .env.local file in your project root:
Step 4: Install Dependencies
Install the CoinFlow React SDK:
Or with yarn:
Step 5: Create Payment Component
Create a new component components/CoinflowPayment.tsx:
Step 6: Create API Endpoint
Create an API route app/api/payments/create/route.ts:
Step 7: Set Up Webhooks
- In your CoinFlow dashboard, go to Settings → Webhooks
- Add your webhook URL:
https://yourdomain.com/api/webhooks/coinflow
- Select events to subscribe to:
payment.completed
payment.failed
payment.refunded
Create Webhook Handler
Create app/api/webhooks/coinflow/route.ts:
Step 8: Test Your Integration
Using Sandbox
- Start your development server:
- Navigate to your payment page
- Use test credentials:
Test Payment Flow
- Create a test payment
- Complete the CoinFlow widget
- Verify webhook is received
- Check payment status in database
Step 9: Go to Production
Before Launch Checklist
Production Environment
Update your production environment variables:
Common Issues
Issue: Widget shows loading spinner indefinitely
Solution:
- Verify
NEXT_PUBLIC_COINFLOW_MERCHANT_ID is set
- Check browser console for errors
- Ensure environment matches (sandbox/production)
Webhook Not Receiving Events
Issue: Payments succeed but webhooks never arrive
Solution:
- Verify webhook URL is publicly accessible
- Check webhook signature validation logic
- Review CoinFlow dashboard webhook logs
CORS Errors
Issue: Cross-origin errors in browser
Solution:
Next Steps
Need Help?