PayBondhu API Documentation v2.0 — 2026-04-19

PayBondhu Payment Gateway enables merchants to receive payments from customers by redirecting them to PayBondhu. After payment, the customer returns to your website with transaction details.

💡 Quick Start: Get your Brand Key from Dashboard → Settings → Brands, then follow the steps below.

Authentication

All API requests require your Brand Key as the API-KEY header. Find it in Dashboard → Settings → Brands.

Required Headers

Content-Type:application/json
API-KEY:YOUR_BRAND_KEY
⚠️ Security: Never expose your Brand Key in client-side code. Always call API from your server.

Create Payment

Create a payment session and redirect the customer to the payment page.

Endpoint

POSThttps://pay.paybondhu.com/api/payment/create

Request Parameters

ParameterTypeRequiredDescriptionExample
cus_nameStringRequiredCustomer full nameJohn Doe
cus_emailStringRequiredCustomer emailjohn@gmail.com
amountStringRequiredPayment amount500 or 99.50
success_urlStringRequiredRedirect URL on successful paymenthttps://yoursite.com/success
cancel_urlStringRequiredRedirect URL if cancelledhttps://yoursite.com/cancel
meta_dataJSONOptionalCustom data (order ID, phone, etc.){"order_id":"123"}

Response

✅ Success
{ "status": true, "message": "Payment session created", "payment_url": "https://paybondhu.com/pay/abc123..." }
❌ Error
{ "status": false, "message": "Error description" }
📌 Next Step: Redirect customer to payment_url. After payment, they return to your success_url or cancel_url.

Code Examples

<?php$curl = curl_init();$data = json_encode([ 'cus_name' => 'John Doe', 'cus_email' => 'john@gmail.com', 'amount' => '500', 'success_url' => 'https://yoursite.com/success', 'cancel_url' => 'https://yoursite.com/cancel', 'meta_data' => json_encode(['order_id' => '12345']),]);curl_setopt_array($curl, [ CURLOPT_URL => 'https://pay.paybondhu.com/api/payment/create', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'API-KEY: YOUR_BRAND_KEY', ],]);$response = curl_exec($curl);curl_close($curl);$result = json_decode($response, true);if (!empty($result['payment_url'])) { header('Location: ' . $result['payment_url']); exit;}echo $result['message'] ?? 'Payment creation failed';?>
use Illuminate\Support\Facades\Http;$response = Http::withHeaders([ 'API-KEY' => env('PAYBONDHU_BRAND_KEY'),])->post('https://pay.paybondhu.com/api/payment/create', [ 'cus_name' => $request->name, 'cus_email' => $request->email, 'amount' => $order->total, 'success_url' => route('payment.success', $order->id), 'cancel_url' => route('payment.cancel', $order->id), 'meta_data' => json_encode(['order_id' => $order->id]),]);$data = $response->json();if (!empty($data['payment_url'])) { return redirect($data['payment_url']);}return back()->with('error', $data['message'] ?? 'Payment failed');
const axios = require('axios');const { data } = await axios.post('https://pay.paybondhu.com/api/payment/create', { cus_name: 'John Doe', cus_email: 'john@gmail.com', amount: '500', success_url: 'https://yoursite.com/success', cancel_url: 'https://yoursite.com/cancel', meta_data: JSON.stringify({ order_id: '12345' }),}, { headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_BRAND_KEY', }});if (data.payment_url) { res.redirect(data.payment_url);} else { console.error(data.message);}
import requests, jsonresponse = requests.post( 'https://pay.paybondhu.com/api/payment/create', headers={ 'Content-Type': 'application/json', 'API-KEY': 'YOUR_BRAND_KEY', }, json={ 'cus_name': 'John Doe', 'cus_email': 'john@gmail.com', 'amount': '500', 'success_url': 'https://yoursite.com/success', 'cancel_url': 'https://yoursite.com/cancel', 'meta_data': json.dumps({'order_id': '12345'}), })data = response.json()if data.get('payment_url'): print('Redirect to:', data['payment_url'])else: print('Error:', data.get('message'))
curl -X POST https://pay.paybondhu.com/api/payment/create \ -H "Content-Type: application/json" \ -H "API-KEY: YOUR_BRAND_KEY" \ -d '{ "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "500", "success_url": "https://yoursite.com/success", "cancel_url": "https://yoursite.com/cancel" }'

Callback (Redirect Back)

After payment, the customer is redirected to your success_url or cancel_url with these query parameters:

GEThttps://yoursite.com/success?transactionId=XXXX&paymentMethod=bkash&paymentAmount=500.00&paymentFee=0.00&status=success
ParameterTypeDescription
transactionIdStringUnique transaction ID — use this to verify payment
paymentMethodStringMethod used (bkash, nagad, rocket, etc.)
paymentAmountStringAmount paid
paymentFeeStringProcessing fee (if any)
statusStringsuccess, pending, or failed
⚠️ Important: Do NOT trust callback status alone. Always verify with the Verify API below.

Verify Payment

Verify transaction status server-side using the transaction ID from the callback.

Endpoint

POSThttps://pay.paybondhu.com/api/payment/verify

Request Parameter

ParameterTypeRequiredDescription
transaction_idStringRequiredThe transactionId from callback URL

Code Examples

<?php$transactionId = $_GET['transactionId'] ?? '';$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => 'https://pay.paybondhu.com/api/payment/verify', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode(['transaction_id' => $transactionId]), CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'API-KEY: YOUR_BRAND_KEY', ],]);$response = curl_exec($curl);curl_close($curl);$result = json_decode($response, true);if ($result['status'] === 'COMPLETED') { // ✅ Payment successful — update your order echo "Verified! Amount: " . $result['amount'];} else { echo "Status: " . $result['status'];}?>
$response = Http::withHeaders([ 'API-KEY' => env('PAYBONDHU_BRAND_KEY'),])->post('https://pay.paybondhu.com/api/payment/verify', [ 'transaction_id' => $request->query('transactionId'),]);$data = $response->json();if ($data['status'] === 'COMPLETED') { $order->update(['payment_status' => 'paid']); return view('payment.success');}return view('payment.failed');
const { data } = await axios.post('https://pay.paybondhu.com/api/payment/verify', { transaction_id: req.query.transactionId,}, { headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_BRAND_KEY', }});if (data.status === 'COMPLETED') { await Order.update({ payment_status: 'paid' }, { where: { id: orderId }}); res.send('Payment verified!');}
response = requests.post( 'https://pay.paybondhu.com/api/payment/verify', headers={'Content-Type': 'application/json', 'API-KEY': 'YOUR_BRAND_KEY'}, json={'transaction_id': request.args.get('transactionId')})data = response.json()if data.get('status') == 'COMPLETED': order.update(payment_status='paid')

Verify Response

✅ Completed
{ "status": "COMPLETED", "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "500.000", "transaction_id": "OVKPXW165414", "payment_method": "bkash", "metadata": { "order_id": "12345" }}
FieldTypeValues
statusStringCOMPLETED — Success PENDING — Waiting ERROR — Failed
transaction_idStringUnique transaction identifier
payment_methodStringbkash, nagad, rocket, etc.
amountStringPayment amount
metadataJSONCustom data sent during creation

Payment Flow

1
Create Payment
Server calls /api/payment/create
2
Redirect
Send customer to payment_url
3
Pay
Customer pays via bKash, Nagad, etc.
4
Callback
Redirect to success_url with transactionId
5
Verify
Server calls /api/payment/verify

Plugins & Apps

🔌
WordPress / WooCommerce
Plugin for WP & WooCommerce
Download
🖥️
WHMCS Module
Billing system integration
Download
📱
SMM Panel
SMM panel payment module
Download
📲
Mobile App
Android transaction monitor
Download