Naafi Pay

Quick Start

This guide takes you from zero to a working payment-management flow in under five minutes. You will create a NaafiPay account, claim a free storefront subdomain, generate your first API key, and make a checkout request from your terminal. By the end you will have a real checkout URL in test mode that you can open in a browser and pay with simulated bKash or Nagad credentials. No production setup, KYC or live business payment account is required to follow along.

Step 1. Create your account

Visit naafipay.com and click Start Now. Sign up with your email address and a password, verify your email, and choose a storefront name. Your storefront URL will be https://your-name.naafipay.app until you connect a custom domain.

Step 2. Generate an API key

From the dashboard, navigate to Settings → API Keys and clickCreate key. The key starts with pg_test_ (test mode) orpg_live_ (live mode) and is shown only once — copy it and store it in your password manager or a server-side environment variable. Keys are SHA-256 hashed at rest, so we can never show it to you again.

WarningTreat API keys like passwords
Never paste a live API key into client-side code, a public repository, or a chat message. If a key leaks, revoke it immediately from the dashboard. Test keys only move test money and are safe to share with collaborators, but live keys must stay server-side.

Step 3. Create your first payment record

Open a terminal and run the following request. Replace pg_test_xxx with the key you just copied. The response returns a payment object with a reference_idand id you will use to check its status.

cURL
1curl -X POST https://naafipay.com/api/public/v1/payments \
2 -H "Authorization: Bearer pg_test_xxx" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "amount": 1500,
6 "currency": "BDT",
7 "customer_name": "Tasin Fahim",
8 "customer_email": "tasin@example.com",
9 "reference_id": "ORD-1001",
10 "metadata": { "order_id": "ORD-1001" }
11 }'

Step 4. Verify the payment

Before delivering the goods, call POST /api/public/v1/verify-payment with theinvoice_id tied to the payment link. Only deliver the goods or unlock the account when the response status is COMPLETED. This guards against URL tampering, where a customer manually navigates to your success page without actually paying.

Verify
1curl -X POST https://naafipay.com/api/public/v1/verify-payment \
2 -H "Authorization: Bearer pg_test_xxx" \
3 -H "Content-Type: application/json" \
4 -d '{ "invoice_id": "udp_01HZX..." }'
TipWhat to do next
Read the API Reference for every endpoint, set up a webhook endpoint so your server is notified of payment events asynchronously, and explore the Customer Portal for self-service refund and receipt access. When you are ready to take live payments, complete the required business setup in the dashboard and switch your key from test to live.

What you have built

  1. A NaafiPay merchant account on a free storefront subdomain
  2. A test API key for local development
  3. A working checkout request that returns a hosted checkout URL
  4. A verification request you can wire into your success page
Updated at: May 30, 2026