BohudurPay Developer Docs
Everything you need to integrate BohudurPay's payment aggregation platform into your application. Accept bKash, Nagad, Rocket, and 10+ payment methods with a single API.
How BohudurPay Works
BohudurPay uses a unique SMS-based auto-verification system. Here's the flow:
Merchant creates payment
Your server calls our API with the amount and redirect URLs. We return a payment_url.
Customer pays via MFS
Customer is redirected to our hosted checkout. They choose bKash/Nagad/Rocket, see the merchant's number, and complete the payment through the MFS app.
SMS auto-forwarded
The merchant's phone has our Android companion app. It automatically forwards the payment confirmation SMS to our servers.
Instant verification
Customer enters TrxID on checkout. We match it against the forwarded SMS — verified in under 2 seconds. No manual checking needed.
Webhook + redirect
We send a webhook to your server and redirect the customer to your success_url with payment details.
Quick Start Guide
Get up and running in 5 minutes.
Create Your Account
Sign up at marchant.bohudurpay.com/register. No documents or approvals needed — instant access.
Create a Brand
Go to Dashboard → Brands → New Brand. Enter your brand name and domain. You'll get an API Key instantly.
Configure Payment Methods
Go to Dashboard → Payment Settings. Select your brand, then enable the payment methods you want (bKash, Nagad, Rocket, etc.). Enter your personal or agent number for each.
Install the Android App
Download the BohudurPay companion app from your dashboard. Install it on the phone that receives payment SMS. Log in with your device key and keep the app running in the background.
Integrate the API
Use your brand API key to start creating payments. Here's a minimal example:
curl -X POST https://secure-payment.bohudurpay.com/api/payment/create \
-H "API-KEY: your_brand_api_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"cus_name": "John Doe",
"cus_email": "[email protected]",
"success_url": "https://yoursite.com/success",
"cancel_url": "https://yoursite.com/cancel",
"webhook_url": "https://yoursite.com/webhook"
}'Redirect the customer to the payment_url from the response. Done!
Dashboard Guide
Create Account
Visit the registration page and fill in your details. You'll need:
- Email address
- Password (min 6 characters)
- First & last name
- Phone number (optional)
After registration, you'll be taken directly to your dashboard.
Create a Brand
Brands represent your business entities. Each brand has its own:
- Unique API key for authentication
- Payment method configuration
- Custom domain support
- Brand colors and logo
- Separate transaction history
- Own fee structure
Setup Payment Methods
Navigate to Dashboard → Payment Settings and configure your payment methods:
- Select your brand from the dropdown
- Click "Add Payment Method"
- Choose the provider (bKash, Nagad, Rocket, etc.)
- Select account type (Personal, Agent, or API)
- Enter your number or API credentials
- Enable the method by toggling it on
Connect Android Device
The Android companion app forwards payment SMS to our servers for auto-verification.
- Go to Dashboard → Devices → New Device
- Give your device a name (e.g., "Main Phone")
- Copy the generated
Device Key - Download and install the companion APK from the dashboard
- Open the app, paste your Device Key, and tap Connect
- Grant SMS read permission when prompted
API Reference
Base URL: https://secure-payment.bohudurpay.com
Authentication
All API requests require your brand API key in the API-KEY header.
API-KEY: your_brand_api_key_here/api/payment/createCreate a new payment session. Returns a payment URL to redirect your customer to.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | number | Required | Payment amount in BDT (0.01 — 1,000,000) |
| success_url | string | Required | URL to redirect customer after successful payment |
| cancel_url | string | Required | URL to redirect customer if they cancel |
| cus_name | string | Optional | Customer name (shown on checkout page) |
| cus_email | string | Optional | Customer email address |
| cus_phone | string | Optional | Customer phone number |
| webhook_url | string | Optional | URL to receive webhook notification on payment completion |
| metadata | object | Optional | Custom JSON object (e.g., { order_id: "123" }). Returned in verify response. |
| return_type | string | Optional | Set to "POST" to receive redirect as POST request. Default: "GET" |
Example Request
curl -X POST https://secure-payment.bohudurpay.com/api/payment/create \
-H "API-KEY: your_brand_api_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"cus_name": "John Doe",
"cus_email": "[email protected]",
"success_url": "https://yoursite.com/success",
"cancel_url": "https://yoursite.com/cancel",
"webhook_url": "https://yoursite.com/api/webhook",
"metadata": { "order_id": "ORD-001", "plan": "premium" }
}'Success Response 200
{
"status": 1,
"message": "Payment Link",
"payment_url": "https://secure-payment.bohudurpay.com/pay/abc123def456...",
"transaction_id": "BP7A8B9C0D1E2F3G"
}Error Response 4xx
{
"status": 0,
"message": "Required fields: amount, success_url, cancel_url"
}payment_url. After payment, they'll be redirected to your success_url./api/payment/verifyVerify a payment's status. Call this after receiving a webhook or when the customer returns to your site.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| transaction_id | string | Required | The transaction_id from the create response |
curl -X POST https://secure-payment.bohudurpay.com/api/payment/verify \
-H "API-KEY: your_brand_api_key" \
-H "Content-Type: application/json" \
-d '{ "transaction_id": "BP7A8B9C0D1E2F3G" }'Response
{
"status": "COMPLETED",
"transaction_id": "BP7A8B9C0D1E2F3G",
"amount": 500,
"cus_name": "John Doe",
"cus_email": "[email protected]",
"payment_method": "bkash_personal",
"metadata": { "order_id": "ORD-001", "plan": "premium" }
}Status Values
| Status | Description |
|---|---|
| PENDING | Payment created but not yet completed |
| COMPLETED | Payment verified and completed |
| ERROR | Payment failed or expired |
Payment Links (No-Code)
You can also generate shareable payment links directly from your dashboard — no API integration needed. Go to Dashboard → Payment Links → Generate.
https://marchant.bohudurpay.com, not the public API-KEY header.# Merchant-authenticated endpoints
POST https://marchant.bohudurpay.com/api/payment-link
GET https://marchant.bohudurpay.com/api/payment-link
DELETE https://marchant.bohudurpay.com/api/payment-link
GET https://marchant.bohudurpay.com/api/payment-link/{ids}
POST https://marchant.bohudurpay.com/api/payment-link/{ids}
PATCH https://marchant.bohudurpay.com/api/payment-link/{ids}
GET https://marchant.bohudurpay.com/api/payment-link/{ids}/paymentsFeatures include:
- Set custom amount
- Add custom input fields (name, email, phone, etc.)
- Attach line items with quantities
- Include shipping, VAT, discounts
- Set success/cancel/webhook URLs
- Create reusable payment templates
Webhooks
Receive real-time notifications when payment events occur.
Webhook Setup
Pass a webhook_url in your create payment request. When the payment completes, we'll POST to that URL.
Webhook Payload
We send a POST with JSON body:
{
"paymentMethod": "bkash_personal",
"transactionId": "BP7A8B9C0D1E2F3G",
"paymentAmount": "500.00",
"paymentFee": "0.00",
"status": "completed"
}| Parameter | Type | Required | Description |
|---|---|---|---|
| paymentMethod | string | Optional | Payment method used (e.g., bkash_personal, nagad_personal) |
| transactionId | string | Optional | Unique transaction identifier |
| paymentAmount | string | Optional | Original payment amount (before fees) |
| paymentFee | string | Optional | Fee amount charged |
| status | string | Optional | Always "completed" for successful webhooks |
Security & Retry
/api/payment/verify with the transaction_id to confirm the payment is genuine.Best practices:
- Respond with HTTP 200 to acknowledge receipt
- Always verify via the verify API — don't trust webhooks blindly
- Process webhooks idempotently (you may receive duplicates)
- Use HTTPS for your webhook URL
SDKs & Examples
Download our official SDKs or use the code examples below.
composer require bohudurpay/bohudurpay-phpnpm install bohudurpaypip install bohudurpaycomposer require bohudurpay/bohudurpay-laravelPHP
<?php
$apiKey = 'your_brand_api_key';
$baseUrl = 'https://secure-payment.bohudurpay.com';
// Create Payment
$ch = curl_init("$baseUrl/api/payment/create");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"API-KEY: $apiKey",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => 500,
'cus_name' => 'John Doe',
'cus_email' => '[email protected]',
'success_url' => 'https://yoursite.com/success',
'cancel_url' => 'https://yoursite.com/cancel',
'webhook_url' => 'https://yoursite.com/webhook',
'metadata' => ['order_id' => 'ORD-001'],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if ($response['status'] === 1) {
// Redirect customer to payment page
header("Location: " . $response['payment_url']);
exit;
}
// Verify Payment
$ch = curl_init("$baseUrl/api/payment/verify");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"API-KEY: $apiKey",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'transaction_id' => $response['transaction_id'],
]),
]);
$verify = json_decode(curl_exec($ch), true);
curl_close($ch);
if ($verify['status'] === 'COMPLETED') {
echo "Payment successful!";
}Node.js
const API_KEY = 'your_brand_api_key';
const BASE_URL = 'https://secure-payment.bohudurpay.com';
// Create Payment
async function createPayment(amount, customerName, customerEmail) {
const res = await fetch(`${BASE_URL}/api/payment/create`, {
method: 'POST',
headers: {
'API-KEY': API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount,
cus_name: customerName,
cus_email: customerEmail,
success_url: 'https://yoursite.com/success',
cancel_url: 'https://yoursite.com/cancel',
webhook_url: 'https://yoursite.com/api/webhook',
}),
});
return res.json();
}
// Verify Payment
async function verifyPayment(transactionId) {
const res = await fetch(`${BASE_URL}/api/payment/verify`, {
method: 'POST',
headers: {
'API-KEY': API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ transaction_id: transactionId }),
});
return res.json();
}
// Express webhook handler
app.post('/api/webhook', async (req, res) => {
const { transactionId, status } = req.body;
// Always verify the payment
const payment = await verifyPayment(transactionId);
if (payment.status === 'COMPLETED') {
// Update your order as paid
await updateOrder(payment.metadata.order_id, 'paid');
}
res.json({ received: true });
});Python
import requests
API_KEY = 'your_brand_api_key'
BASE_URL = 'https://secure-payment.bohudurpay.com'
headers = {
'API-KEY': API_KEY,
'Content-Type': 'application/json',
}
# Create Payment
def create_payment(amount, name, email):
response = requests.post(f'{BASE_URL}/api/payment/create',
headers=headers,
json={
'amount': amount,
'cus_name': name,
'cus_email': email,
'success_url': 'https://yoursite.com/success',
'cancel_url': 'https://yoursite.com/cancel',
'webhook_url': 'https://yoursite.com/webhook',
}
)
return response.json()
# Verify Payment
def verify_payment(transaction_id):
response = requests.post(f'{BASE_URL}/api/payment/verify',
headers=headers,
json={'transaction_id': transaction_id}
)
return response.json()
# Usage
result = create_payment(500, 'John Doe', '[email protected]')
if result['status'] == 1:
print(f"Redirect to: {result['payment_url']}")
# After webhook
verification = verify_payment(result['transaction_id'])
if verification['status'] == 'COMPLETED':
print("Payment verified!")Laravel
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
class PaymentController extends Controller
{
private $apiKey;
private $baseUrl;
public function __construct()
{
$this->apiKey = config('services.bohudurpay.key');
$this->baseUrl = config('services.bohudurpay.url');
}
public function createPayment(Request $request)
{
$response = Http::withHeaders([
'API-KEY' => $this->apiKey,
])->post("{$this->baseUrl}/api/payment/create", [
'amount' => $request->amount,
'cus_name' => $request->name,
'cus_email' => $request->email,
'success_url' => route('payment.success'),
'cancel_url' => route('payment.cancel'),
'webhook_url' => route('payment.webhook'),
'metadata' => ['order_id' => $request->order_id],
]);
$data = $response->json();
if ($data['status'] === 1) {
return redirect($data['payment_url']);
}
return back()->with('error', $data['message']);
}
public function webhook(Request $request)
{
$verification = Http::withHeaders([
'API-KEY' => $this->apiKey,
])->post("{$this->baseUrl}/api/payment/verify", [
'transaction_id' => $request->transactionId,
]);
$payment = $verification->json();
if ($payment['status'] === 'COMPLETED') {
// Mark order as paid
Order::where('id', $payment['metadata']['order_id'])
->update(['status' => 'paid']);
}
return response()->json(['received' => true]);
}
}
// config/services.php
// 'bohudurpay' => [
// 'key' => env('BOHUDURPAY_API_KEY'),
// 'url' => env('BOHUDURPAY_URL', 'https://secure-payment.bohudurpay.com'),
// ],
// routes/web.php
// Route::post('/pay', [PaymentController::class, 'createPayment']);
// Route::post('/webhook', [PaymentController::class, 'webhook'])->name('payment.webhook');
// Route::get('/success', fn() => view('success'))->name('payment.success');
// Route::get('/cancel', fn() => view('cancel'))->name('payment.cancel');Modules & Plugins
Ready-made integrations for popular platforms. Download, install, and start accepting payments in minutes.
Accept BohudurPay payments directly on your WooCommerce store. Customers can pay with bKash, Nagad, Rocket, and more at checkout.
Features
Integrate BohudurPay into your SMM panel for automatic payment processing. Supports all major SMM panel scripts.
Features
Accept BohudurPay payments for hosting, domains, and services in WHMCS. Full gateway integration with invoice support.
Features
Payment gateway module for Perfex CRM. Accept invoice payments from your clients via BohudurPay.
Features
Dedicated integration module for FLAVOR SMM Panel. Seamless payment flow with auto fund adding.
Features
Sell digital products with BohudurPay on WordPress using Easy Digital Downloads plugin.
Features
Error Codes
| HTTP Code | Message | Solution |
|---|---|---|
| 400 | Required fields missing | Include amount, success_url, cancel_url in request body |
| 400 | Amount out of range | Amount must be between 0.01 and 1,000,000 |
| 401 | API-KEY header is required | Add API-KEY header with your brand key |
| 402 | Plan expired / limit reached | Upgrade your subscription plan or wait for the next cycle |
| 404 | Invalid API Key | Check your API key in Dashboard → Brands |
| 404 | Transaction not found | Verify the transaction_id is correct |
| 500 | Internal server error | Contact support if this persists |
Frequently Asked Questions
Do I need a merchant/business account to use BohudurPay?
No! You can use your personal bKash, Nagad, or Rocket number. Our SMS-based verification works with any number — no merchant API credentials needed.
How fast is the payment verification?
Under 2 seconds. As soon as the customer submits their TrxID, we match it against the forwarded SMS in real-time.
What if the SMS isn't forwarded in time?
The customer can retry entering their TrxID. SMS forwarding typically happens within seconds. If there's a delay, the payment will still match once the SMS arrives.
Can I use multiple phone numbers for the same method?
Yes! You can add multiple numbers for the same provider (e.g., 2 bKash numbers). BohudurPay will rotate between them automatically to distribute load.
Is there a test/sandbox mode?
The free plan with 100 transactions/month is essentially your sandbox. Use it to test your integration before upgrading to a paid plan.
What happens when a payment session expires?
Payment sessions expire after 24 hours by default. The customer will see an "expired" message and the status will be marked as ERROR.
Can I customize the checkout page?
Yes. In Dashboard → Brands → Edit → Theme tab, you can set brand colors, logo, and choose from different checkout themes (Default, Modern, Minimal, Dark).
Need Help?
Can't find what you're looking for? Our support team is here to help.
