Payments API

Create invoice

Call this from your server backend — never from frontend JS. Returns a hosted checkout URL to redirect the buyer.

POST/api/v1/payments

Auth: X-Api-Key: YOUR_STORE_API_KEY

Request body

FieldTypeNotes
amountnumberRequired. BDT, must be > 0
providerstring?bkash | nagad | rocket — omit for all
customerNamestring?Shown on the checkout page
customerPhonestring?Optional buyer phone
notestring?Order ID / product name
expiresInHoursnumber?1–168, default 24
request
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",
    "expiresInHours": 24
  }'
response
{
  "id": "987a15a8-c5d6-4e0d-94c6-523f8db581ee",
  "amount": 1490,
  "currency": "BDT",
  "provider": null,
  "trxId": null,
  "status": "pending",
  "note": "Order #2041",
  "expiresAt": "2026-08-20T15:00:00.000Z",
  "createdAt": "2026-08-19T15:00:00.000Z",
  "payUrl": "https://yourdomain.com/pay/987a15a8-..."
}

Redirect the buyer to payUrl. Store id on your order to poll later.

Get payment status

GET/api/v1/payments/:id

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

List payments

GET/api/v1/payments

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