Quickstart
This guide takes you from zero to a working payment integration. By the end, you will have created a test payment and received a webhook confirmation.Prerequisites
- Node.js 18 or later
- A ZendFi account (sign up here)
- Your test API key (starts with
zfi_test_)
Option A: Add to an Existing Project
If you already have a Next.js or Express project, the fastest path is the CLI:Option B: Start from Scratch
Step 1: Create a New Project
Step 2: Configure Your API Key
Add your test API key to the.env file:
.env
Test keys route all transactions to Solana devnet. No real money is involved. You can generate a test key from your dashboard.
Step 3: Create a Payment
- TypeScript (SDK)
- cURL
- CLI
payment_url — open it in your browser to see the hosted checkout page.
Step 4: Complete the Payment
Open the checkout URL in your browser. You will see ZendFi’s hosted checkout page with:- The payment amount and description
- A QR code for Solana wallet apps
- A wallet address for direct transfers
- A countdown timer showing when the payment expires
Step 5: Handle Webhooks
When the payment confirms on-chain, ZendFi sends a webhook to your configured endpoint.- Next.js (App Router)
- Express
app/api/webhooks/zendfi/route.ts
Step 6: Test Webhooks Locally
Use the CLI to create a tunnel and forward webhooks to your local server:What Happens Next
Once you are comfortable with test mode:- Set up webhook security to verify signatures in production.
- Switch to live mode by using a
zfi_live_API key. - Explore subscriptions, invoices, and payment links for more advanced flows.