Start here

Quickstart

5 minutes: get your API key, create an invoice, send the buyer to checkout, confirm verified.

1. Get your API key

Log in to your merchant dashboard → Stores & API → copy the API Key for your store.

store it securely
API_KEY=your_store_api_key_here

2. Create an invoice

POST/api/v1/payments

curl
curl -s http://localhost:4000/api/v1/payments \
  -H "X-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1490,
    "note": "Order #2041",
    "customerName": "Rafi Hasan",
    "customerPhone": "01711111111"
  }'
response
{
  "id": "987a15a8-c5d6-4e0d-94c6-523f8db581ee",
  "amount": 1490,
  "status": "pending",
  "payUrl": "http://localhost:3000/pay/987a15a8-..."
}

Save id on your order. Redirect the buyer to payUrl.

3. Buyer pays on hosted checkout

The buyer opens /pay/{id}, picks bKash / Nagad / Rocket, sends money to your number, and submits the TrxID.

4. Get notified (outbound webhook)

Set your server URL in Stores & API → Webhook URL. When payment is verified we POST:

POST → your server
{
  "event": "payment.verified",
  "paymentId": "987a15a8-...",
  "storeId": "...",
  "amount": 1490,
  "currency": "BDT",
  "provider": "bkash",
  "trxId": "BKH8X2K1M",
  "payerNumber": "01711111111",
  "customerName": "Rafi Hasan",
  "note": "Order #2041",
  "verifiedAt": "2026-08-19T15:00:00.000Z"
}

Verify the X-TakaPay-Signature header before fulfilling the order.

5. Or poll the status

GET/api/v1/payments/:id

curl
curl http://localhost:4000/api/v1/payments/987a15a8-... \
  -H "X-Api-Key: $API_KEY"

When status === "verified", deliver the product. Never fulfil on TrxID alone from the customer.