API reference

Create, check and cancel payments; methods, invoices and links. JSON over HTTPS with a Bearer key.

Updated 22 Nov 2026 · 1 min read

Base URL: https://your-server/api/v1/ · Auth header: Authorization: Bearer pk_live_… (also accepted: X-API-Key). Bodies are JSON. Every answer has ok; errors look like {"ok":false,"error":"invalid_amount","message":"…"} with a matching HTTP status (400, 401, 403, 404, 409, 422, 429, 503).

Create a payment

POST /api/v1/payments

{"amount":"500.00","currency":"BDT","reference":"ORDER-1001",
 "customer":{"name":"Rahim","email":"r@example.com","phone":"01712345678"},
 "success_url":"https://shop.example.com/thanks","cancel_url":"https://shop.example.com/cart",
 "webhook_url":"https://shop.example.com/ipn","methods":["bkash","nagad"],
 "metadata":{"order_id":1001},"expires_in":3600}

Answer 201:

{"ok":true,"payment":{"id":"PAY-7Q2M9XKD","status":"pending","amount":"500.00","currency":"BDT",
 "checkout_url":"https://pay.example.com/checkout/PAY7Q2M9XKD","expires_at":"2026-11-16T11:15:00+06:00"}}

Send the customer to checkout_url. Repeating the same reference while the earlier payment is still open returns that payment; send "new":true to force a new one.

Check a payment

GET /api/v1/payments/{id} or GET /api/v1/payments?reference=ORDER-1001

statusmeaning
pendingcreated, not paid
processingthe customer gave a TrxID; waiting for the SMS
completedpaid — has paid_amount, paid_currency, method, trx_id, sender, paid_at
failed, expired, cancelled, refundedfinal states

Other calls

CallUse
GET /api/v1/methods?amount=500&currency=BDTmethods this website can take for that amount
POST /api/v1/payments/{id}/cancelcancel an open payment
POST /api/v1/payments/{id}/verifywhen you collect the TrxID on your own page: method, trx_id, sender
POST /api/v1/invoicescustomer, items[{name,qty,price}], currency, due_date, note → invoice with url
POST /api/v1/linkstitle, amount (or null for customer-entered), currency → reusable link url

Example with curl

curl -X POST https://pay.example.com/api/v1/payments \
  -H "Authorization: Bearer pk_test_xxx" -H "Content-Type: application/json" \
  -d '{"amount":"250.00","currency":"BDT","reference":"TEST-1"}'