Verify a charge
GEThttps://api.nogorpay.com/api/v1/charge/verify/{id}
Returns the current status of a charge. Use it to confirm a payment before you fulfil an order, or as a fallback when a webhook didn’t arrive.
Path parameters
Section titled “Path parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | The charge’s invoice_id, your order_id, or the session_id. |
You can also pass the ID as a query parameter: GET /charge/verify?invoice_id=INV-7K9X2P8M, ?order_id=ORDER-1042 or ?session_id=cs_live_....
Request
Section titled “Request”curl https://api.nogorpay.com/api/v1/charge/verify/INV-7K9X2P8M \ -H "NOGORPAY-API-KEY: $NOGORPAY_API_KEY"async function verifyCharge(invoiceId) { const res = await fetch( `https://api.nogorpay.com/api/v1/charge/verify/${encodeURIComponent(invoiceId)}`, { headers: { 'NOGORPAY-API-KEY': process.env.NOGORPAY_API_KEY } }, ); return res.json();}
const charge = await verifyCharge('INV-7K9X2P8M');if (charge.status === 'completed' && charge.amount === order.total) { // mark the order as paid}<?phpfunction verify_nogorpay_charge(string $invoiceId): array{ $ch = curl_init('https://api.nogorpay.com/api/v1/charge/verify/' . rawurlencode($invoiceId)); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['NOGORPAY-API-KEY: ' . getenv('NOGORPAY_API_KEY')], ]); $data = json_decode(curl_exec($ch), true); curl_close($ch); return $data;}import osimport requests
def verify_charge(invoice_id): res = requests.get( f"https://api.nogorpay.com/api/v1/charge/verify/{invoice_id}", headers={"NOGORPAY-API-KEY": os.environ["NOGORPAY_API_KEY"]}, timeout=15, ) return res.json()Response
Section titled “Response”The response shape depends on whether the customer has paid. The same fields are also repeated inside a data object, so you can read either status or data.status.
{ "success": true, "invoice_id": "INV-7K9X2P8M", "order_id": "ORDER-1042", "status": "completed", "amount": 1500, "currency": "BDT", "payment_method": "bkash", "trx_id": "9B7X2K4L", "sender_phone": "01712345678", "customer_name": "Rahim Ahmed", "completed_at": "2026-08-07T12:03:41.000Z", "invoice_download_url": "https://api.nogorpay.com/api/v1/charge/download-invoice/INV-7K9X2P8M", "invoice_url": "https://api.nogorpay.com/api/v1/charge/download-invoice/INV-7K9X2P8M", "data": { "...": "same fields as above" }}{ "success": true, "invoice_id": "INV-7K9X2P8M", "order_id": "ORDER-1042", "session_id": "cs_live_3f2a9c0e8b7d4e1fa6c5b4d3e2f1a0b9", "status": "pending", "amount": 1500, "currency": "BDT", "customer_name": "Rahim Ahmed", "customer_phone": "01712345678", "customer_email": "customer@example.com", "expires_at": "2026-08-07T12:15:00.000Z", "invoice_download_url": "https://api.nogorpay.com/api/v1/charge/download-invoice/INV-7K9X2P8M", "invoice_url": "https://api.nogorpay.com/api/v1/charge/download-invoice/INV-7K9X2P8M", "data": { "...": "same fields as above" }}{ "success": false, "search_id": "INV-UNKNOWN1", "status": "not_found", "message": "No transaction or charge found matching the provided invoice_id, order_id, or session_id"}Response fields
Section titled “Response fields”| Field | Type | Present | Description |
|---|---|---|---|
success |
boolean | Always | true if the charge was found. |
invoice_id |
string | Always | NogorPay invoice ID. |
order_id |
string or null |
Always | Your order reference. |
status |
string | Always | See Statuses. |
amount |
number | Always | Charge amount in BDT. |
currency |
string | Always | Always BDT. |
payment_method |
string | Completed | Method the customer paid with. |
trx_id |
string | Completed | Transaction ID from bKash, Nagad, Rocket or Upay. |
sender_phone |
string | Completed | The wallet number the customer paid from. |
customer_name |
string or null |
Always | Customer’s name. |
completed_at |
string | Completed | When the payment was confirmed. |
session_id |
string | Not paid yet | Checkout session ID. |
customer_phone |
string or null |
Not paid yet | Customer’s phone. |
customer_email |
string or null |
Not paid yet | Customer’s email. |
expires_at |
string or null |
Not paid yet | When the checkout closes. |
invoice_download_url |
string | Always | Link to a PDF invoice. invoice_url is the same link. |
data |
object | Always | The same fields, nested. |
Statuses
Section titled “Statuses”status |
Meaning | What to do |
|---|---|---|
pending |
Checkout created, the customer hasn’t submitted a payment. | Wait. If expires_at has passed, treat it as expired. |
verifying |
The customer submitted a transaction ID and NogorPay is matching it. | Wait and check again, or wait for the webhook. |
completed |
Payment confirmed. | Check amount, then fulfil the order. |
cancelled |
The customer cancelled on the checkout page. | Let the customer try again with a new charge. |
expired |
The checkout closed before payment. | Create a new charge if the customer still wants to pay. |
