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
| Field | Type | Notes |
|---|---|---|
| amount | number | Required. BDT, must be > 0 |
| provider | string? | bkash | nagad | rocket — omit for all |
| customerName | string? | Shown on the checkout page |
| customerPhone | string? | Optional buyer phone |
| note | string? | Order ID / product name |
| expiresInHours | number? | 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"