Naafi Pay

Verify Payment

POST/api/public/v1/verify-payment

Verifies a payment by invoice_id and returns its current status. Call this endpoint from your success_url handler before you deliver goods or unlock an account. It is the single source of truth for whether a payment has actually been captured. Relying only on the success-page redirect is unsafe — a malicious user can type the URL directly without paying. This call is idempotent and free; you can call it as many times as you want for the same invoice.

Request headers

FieldTypeRequiredDescription
AuthorizationstringrequiredYour test or live API key.
Example: pg_live_xxx
Content-TypestringrequiredMust be application/json.
Example: application/json

Request body

FieldTypeRequiredDescription
invoice_idstringrequiredThe invoice_id returned by Create Checkout, also passed to your success_url as a query param.
Example: inv_01HZX5JM3W7QZK8YF7N9P0RTS2

Response

200 OK
1{
2 "invoice_id": "inv_01HZX5JM3W7QZK8YF7N9P0RTS2",
3 "status": "completed",
4 "amount": 1500,
5 "currency": "BDT",
6 "fee": 22.5,
7 "net": 1477.5,
8 "gateway": "bkash",
9 "transaction_id": "8GD7H2K3L1",
10 "customer": {
11 "full_name": "Tasin Fahim",
12 "email": "tasin@example.com"
13 },
14 "metadata": { "order_id": "ORD-1001" },
15 "paid_at": "2026-05-30T14:06:21Z"
16}

Possible status values are completed, pending, failed, and cancelled. Only ship the product when status is completed.

TipMatch amount and metadata
Compare the returned amount and metadata.order_id to your local order before fulfilment. This protects you from edge cases where two checkouts for different orders somehow get confused.

Error codes

FieldTypeRequiredDescription
400missing_invoice_idoptionalinvoice_id was not provided.
401unauthorizedoptionalAPI key is missing or invalid.
403wrong_storefrontoptionalThe invoice belongs to a different storefront.
404not_foundoptionalNo invoice exists for the given id.
WarningNever trust the success_url alone
Anyone can open your success URL. Verify the payment server-side every single time before delivering anything of value.
Updated at: May 30, 2026