Documentation

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:

1

Merchant creates payment

Your server calls our API with the amount and redirect URLs. We return a payment_url.

2

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.

3

SMS auto-forwarded

The merchant's phone has our Android companion app. It automatically forwards the payment confirmation SMS to our servers.

4

Instant verification

Customer enters TrxID on checkout. We match it against the forwarded SMS — verified in under 2 seconds. No manual checking needed.

5

Webhook + redirect

We send a webhook to your server and redirect the customer to your success_url with payment details.

No merchant account needed! Unlike traditional payment gateways, you can use your personal bKash/Nagad number. Our SMS-based verification works with any number.

Quick Start Guide

Get up and running in 5 minutes.

1

Create Your Account

Sign up at marchant.bohudurpay.com/register. No documents or approvals needed — instant access.

2

Create a Brand

Go to Dashboard → Brands → New Brand. Enter your brand name and domain. You'll get an API Key instantly.

Each brand gets its own API key, payment settings, and transaction history. You can run multiple brands from one account.
3

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.

4

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.

Make sure to disable battery optimization for the app so it can forward SMS reliably in the background.
5

Integrate the API

Use your brand API key to start creating payments. Here's a minimal example:

cURL — Create Payment
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
Your subscription plan determines how many brands you can create. The free plan allows 1 brand.

Setup Payment Methods

Navigate to Dashboard → Payment Settings and configure your payment methods:

  1. Select your brand from the dropdown
  2. Click "Add Payment Method"
  3. Choose the provider (bKash, Nagad, Rocket, etc.)
  4. Select account type (Personal, Agent, or API)
  5. Enter your number or API credentials
  6. Enable the method by toggling it on
You can add multiple numbers for the same provider. Each gateway entry is independent and can be configured separately.

Connect Android Device

The Android companion app forwards payment SMS to our servers for auto-verification.

  1. Go to Dashboard → Devices → New Device
  2. Give your device a name (e.g., "Main Phone")
  3. Copy the generated Device Key
  4. Download and install the companion APK from the dashboard
  5. Open the app, paste your Device Key, and tap Connect
  6. Grant SMS read permission when prompted
Keep the app running in the background. Disable battery optimization and auto-cleanup for the app in your phone settings.

API Reference

Base URL: https://secure-payment.bohudurpay.com

Authentication

All API requests require your brand API key in the API-KEY header.

Request Header
API-KEY: your_brand_api_key_here
Find your API key in Dashboard → Brands. Click the eye icon to reveal it, or the copy icon to copy. You can reset it anytime.
POST/api/payment/create

Create a new payment session. Returns a payment URL to redirect your customer to.

Request Body

ParameterTypeRequiredDescription
amountnumberRequiredPayment amount in BDT (0.01 — 1,000,000)
success_urlstringRequiredURL to redirect customer after successful payment
cancel_urlstringRequiredURL to redirect customer if they cancel
cus_namestringOptionalCustomer name (shown on checkout page)
cus_emailstringOptionalCustomer email address
cus_phonestringOptionalCustomer phone number
webhook_urlstringOptionalURL to receive webhook notification on payment completion
metadataobjectOptionalCustom JSON object (e.g., { order_id: "123" }). Returned in verify response.
return_typestringOptionalSet to "POST" to receive redirect as POST request. Default: "GET"

Example Request

cURL
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

Response
{
  "status": 1,
  "message": "Payment Link",
  "payment_url": "https://secure-payment.bohudurpay.com/pay/abc123def456...",
  "transaction_id": "BP7A8B9C0D1E2F3G"
}

Error Response 4xx

Error
{
  "status": 0,
  "message": "Required fields: amount, success_url, cancel_url"
}
Next step: Redirect the customer's browser to payment_url. After payment, they'll be redirected to your success_url.
POST/api/payment/verify

Verify a payment's status. Call this after receiving a webhook or when the customer returns to your site.

Request Body

ParameterTypeRequiredDescription
transaction_idstringRequiredThe transaction_id from the create response
cURL
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

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

StatusDescription
PENDINGPayment created but not yet completed
COMPLETEDPayment verified and completed
ERRORPayment failed or expired
Always verify on your server. Never trust client-side redirects alone. Always call /api/payment/verify from your backend to confirm payment status.

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:

Webhook POST Body
{
  "paymentMethod": "bkash_personal",
  "transactionId": "BP7A8B9C0D1E2F3G",
  "paymentAmount": "500.00",
  "paymentFee": "0.00",
  "status": "completed"
}
ParameterTypeRequiredDescription
paymentMethodstringOptionalPayment method used (e.g., bkash_personal, nagad_personal)
transactionIdstringOptionalUnique transaction identifier
paymentAmountstringOptionalOriginal payment amount (before fees)
paymentFeestringOptionalFee amount charged
statusstringOptionalAlways "completed" for successful webhooks

Security & Retry

Always verify the webhook. After receiving a webhook, call /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.

PHP SDK

PHP SDK

v1.0.0
Download
composer require bohudurpay/bohudurpay-php
Node.js SDK

Node.js SDK

v1.0.0
Download
npm install bohudurpay
Python SDK

Python SDK

v1.0.0
Download
pip install bohudurpay
Laravel SDK

Laravel SDK

v1.0.0
Download
composer require bohudurpay/bohudurpay-laravel

PHP

PHP — Create Payment
<?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

Node.js — Create & Verify Payment
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

Python — Create & Verify Payment
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

Laravel — Controller Example
<?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.

WordPress / WooCommerce

WordPress / WooCommerce

v2.1.0
Download

Accept BohudurPay payments directly on your WooCommerce store. Customers can pay with bKash, Nagad, Rocket, and more at checkout.

Features

One-click install via WordPress admin
Automatic order status updates
Refund support from admin panel
Multi-currency display
Customizable checkout text
WooCommerce Subscriptions compatible
SMM Panel Module

SMM Panel Module

v1.5.0
Download

Integrate BohudurPay into your SMM panel for automatic payment processing. Supports all major SMM panel scripts.

Features

Auto-add funds on payment
Supports Perfect Panel, SMMHeart, SMMPanel scripts
Webhook-based instant confirmation
Minimum deposit configurable
Transaction log in admin
Easy drop-in installation
WHMCS Gateway

WHMCS Gateway

v1.3.0
Download

Accept BohudurPay payments for hosting, domains, and services in WHMCS. Full gateway integration with invoice support.

Features

Invoice auto-payment detection
Client area payment button
Admin transaction log
Supports all WHMCS products
Auto invoice marking on webhook
Multi-brand support
Perfex CRM

Perfex CRM

v1.2.0
Download

Payment gateway module for Perfex CRM. Accept invoice payments from your clients via BohudurPay.

Features

Invoice payment integration
Client-facing payment button
Automatic payment recording
Supports recurring invoices
Admin payment reports
Easy module activation
FLAVOR SMM Panel

FLAVOR SMM Panel

v1.1.0
Download

Dedicated integration module for FLAVOR SMM Panel. Seamless payment flow with auto fund adding.

Features

Native FLAVOR integration
Auto-add balance on payment
Custom minimum amount
Transaction history
Webhook auto-confirmation
Drag-and-drop install
Easy Digital Downloads

Easy Digital Downloads

v1.0.0
Download

Sell digital products with BohudurPay on WordPress using Easy Digital Downloads plugin.

Features

EDD payment gateway integration
Download unlock on payment
Order status sync
Discount code compatible
Purchase receipt emails
Simple settings page
Installation help? Each module includes a README with step-by-step installation instructions. Need help? Contact our support team.

Error Codes

HTTP CodeMessageSolution
400Required fields missingInclude amount, success_url, cancel_url in request body
400Amount out of rangeAmount must be between 0.01 and 1,000,000
401API-KEY header is requiredAdd API-KEY header with your brand key
402Plan expired / limit reachedUpgrade your subscription plan or wait for the next cycle
404Invalid API KeyCheck your API key in Dashboard → Brands
404Transaction not foundVerify the transaction_id is correct
500Internal server errorContact 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.