BD Pay API v1.0
RESTful Payment API v1.0 • Enterprise Automation

Developer Documentation & Seamless Integration

Integrate automated Mobile Banking (bKash, Nagad, Rocket) and Cards into your web or mobile application with sub-second response times and 1-Click plugins.

curl -X POST https://pay.bdpayment.online/api/payment/create -H "API-KEY: your_key"
< 200ms API Response Time
256-Bit SSL & Token Auth
6+ Plugins Ready-to-Install Modules
99.99% Automated Uptime

Redirect Flow

Secure hosted checkout flow for frictionless payments without PCI compliance headaches.

2 REST Endpoints

Create invoice links with /create, then confirm server-side status with /verify.

Multi-Language

Copy-paste integration code ready for PHP, Node.js, Python, and Go applications.

Mobile Companion

Real-time SMS forwarder & transaction listener app for personal accounts.

Welcome to Bd Payment Developer Docs

REST API v1.0

Bd Payment is an automated payment orchestrator that empowers merchants to use personal or merchant mobile accounts (bKash, Nagad, Rocket) as a payment gateway. With simple JSON payloads and fast HTTP endpoints, you can accept payments on WordPress, WooCommerce, WHMCS, custom PHP apps, Node.js, or mobile applications in under 5 minutes.

API Operations & Endpoints

JSON over HTTPS

All API requests must be sent over secure HTTPS using standard POST requests with an application/json payload. Authenticate your requests using the API-KEY header available in your merchant dashboard.

1. Create Payment Invoice Endpoint

POST https://pay.bdpayment.online/api/payment/create
Generates a hosted payment URL
Field Type Status Description Example
cus_name string Required Customer's full name John Doe
cus_email string Required Customer's email address john@example.com
amount numeric Required Total payable amount in BDT (e.g. 10 or 150.50) 500
success_url url Required URL to redirect the customer upon payment completion https://site.com/success
cancel_url url Required URL to redirect the customer if payment is canceled https://site.com/cancel
meta_data json / string Optional Custom metadata or order ID to be returned upon verification {"order_id": 1042}

2. Verify Transaction Endpoint

POST https://pay.bdpayment.online/api/payment/verify
Server-side verification of completed transaction
Field Type Status Description Example
transaction_id string Required Transaction ID received via query string on your success_url OVKPXW165414

Required Authentication Headers

Header Type Value / Description
Content-Type header application/json
API-KEY header Your private API key from Dashboard > API Credentials

3-Step Integration Guide

Interactive Code Sandbox

Follow these 3 simple steps to integrate Bd Payment into your checkout flow.

1

Initiate Payment Request

Send a POST request with your order details to generate a unique checkout invoice URL.

<?php

$curl = curl_init();

$payload = [
    "cus_name"    => "John Doe",
    "cus_email"   => "john@gmail.com",
    "amount"      => "500",
    "success_url" => "https://yourdomain.com/success.php",
    "cancel_url"  => "https://yourdomain.com/cancel.php",
    "meta_data"   => json_encode(["order_id" => 1042])
];

curl_setopt_array($curl, [
    CURLOPT_URL            => 'https://pay.bdpayment.online/api/payment/create',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_POSTFIELDS     => json_encode($payload),
    CURLOPT_HTTPHEADER     => [
        'API-KEY: your_api_key_here',
        'Content-Type: application/json'
    ],
]);

$response = json_decode(curl_exec($curl), true);
curl_close($curl);

if (!empty($response['status']) && !empty($response['payment_url'])) {
    header('Location: ' . $response['payment_url']);
    exit();
} else {
    echo "Error: " . ($response['message'] ?? 'Unable to create payment invoice.');
}
<?php
use GuzzleHttp\Client;

$client = new Client();
$headers = [
    'API-KEY'      => 'your_api_key_here',
    'Content-Type' => 'application/json'
];

$body = json_encode([
    "cus_name"    => "John Doe",
    "cus_email"   => "john@gmail.com",
    "amount"      => "500",
    "success_url" => "https://yourdomain.com/success.php",
    "cancel_url"  => "https://yourdomain.com/cancel.php"
]);

$response = $client->post('https://pay.bdpayment.online/api/payment/create', [
    'headers' => $headers,
    'body'    => $body
]);

$data = json_decode($response->getBody(), true);
if ($data['status']) {
    header('Location: ' . $data['payment_url']);
    exit();
}
const axios = require('axios');

const initiatePayment = async () => {
  try {
    const payload = {
      cus_name: "John Doe",
      cus_email: "john@gmail.com",
      amount: "500",
      success_url: "https://yourdomain.com/success",
      cancel_url: "https://yourdomain.com/cancel",
      meta_data: { order_id: 1042 }
    };

    const response = await axios.post('https://pay.bdpayment.online/api/payment/create', payload, {
      headers: {
        'API-KEY': 'your_api_key_here',
        'Content-Type': 'application/json'
      }
    });

    if (response.data.status) {
      console.log('Redirect user to:', response.data.payment_url);
    }
  } catch (error) {
    console.error('Payment initiation error:', error.response?.data || error.message);
  }
};

initiatePayment();
import requests
import json

url = "https://pay.bdpayment.online/api/payment/create"
payload = {
    "cus_name": "John Doe",
    "cus_email": "john@gmail.com",
    "amount": "500",
    "success_url": "https://yourdomain.com/success",
    "cancel_url": "https://yourdomain.com/cancel"
}

headers = {
    'API-KEY': 'your_api_key_here',
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()

if data.get('status'):
    print("Payment URL:", data['payment_url'])
else:
    print("Error:", data.get('message'))
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://pay.bdpayment.online/api/payment/create"
    payload := map[string]interface{}{
        "cus_name":    "John Doe",
        "cus_email":   "john@gmail.com",
        "amount":      "500",
        "success_url": "https://yourdomain.com/success",
        "cancel_url":  "https://yourdomain.com/cancel",
    }
    jsonPayload, _ := json.Marshal(payload)

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
    req.Header.Set("API-KEY", "your_api_key_here")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}
HTTP 200 OK • Success Response
{
  "status": true,
  "payment_url": "https://pay.bdpayment.online/invoice/INV8923481239"
}
2

Redirect Customer & Complete Payment

Redirect the customer's browser to the returned payment_url. The customer completes payment via bKash, Nagad, Rocket, or Card on our hosted gateway. Upon completion, the customer is redirected back to your success_url with a transactionId query parameter:

https://yourdomain.com/success.php?transactionId=OVKPXW165414
3

Verify Transaction Server-Side

On your success_url handler, extract transactionId and make a server-side verification request to validate that the transaction was legitimately settled:

<?php

$transactionId = $_GET['transactionId'] ?? '';

if (empty($transactionId)) {
    die("Invalid transaction ID.");
}

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL            => 'https://pay.bdpayment.online/api/payment/verify',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_POSTFIELDS     => json_encode(["transaction_id" => $transactionId]),
    CURLOPT_HTTPHEADER     => [
        'API-KEY: your_api_key_here',
        'Content-Type: application/json'
    ],
]);

$response = json_decode(curl_exec($curl), true);
curl_close($curl);

if (!empty($response['status']) && $response['status'] === 'COMPLETED') {
    // 1. Transaction verified successfully!
    $amount = $response['amount'];
    $customer = $response['cus_name'];
    
    // 2. Mark order as paid in your database
    // updateOrderStatus($transactionId, 'PAID');
    
    echo "Payment Successful! Transaction ID: " . htmlspecialchars($transactionId);
} else {
    echo "Payment Verification Failed: " . ($response['message'] ?? 'Unverified transaction.');
}
const axios = require('axios');

app.get('/success', async (req, res) => {
  const { transactionId } = req.query;

  try {
    const response = await axios.post('https://pay.bdpayment.online/api/payment/verify', {
      transaction_id: transactionId
    }, {
      headers: {
        'API-KEY': 'your_api_key_here',
        'Content-Type': 'application/json'
      }
    });

    if (response.data.status === 'COMPLETED') {
      // Order verified: fulfill service / deliver product
      return res.render('success', { transaction: response.data });
    } else {
      return res.status(400).send('Payment not verified.');
    }
  } catch (error) {
    return res.status(500).send('Verification server error.');
  }
});
import requests

def verify_payment(transaction_id):
    url = "https://pay.bdpayment.online/api/payment/verify"
    payload = {"transaction_id": transaction_id}
    headers = {
        'API-KEY': 'your_api_key_here',
        'Content-Type': 'application/json'
    }

    response = requests.post(url, headers=headers, json=payload)
    result = response.json()

    if result.get('status') == 'COMPLETED':
        print(f"Verified payment of ৳{result.get('amount')} from {result.get('cus_name')}")
        return True
    return False
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func verifyTransaction(txID string) {
    url := "https://pay.bdpayment.online/api/payment/verify"
    payload, _ := json.Marshal(map[string]string{"transaction_id": txID})

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
    req.Header.Set("API-KEY", "your_api_key_here")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    fmt.Println("Verification Response Code:", resp.StatusCode)
}
Verification Response Payload
{
  "status": "COMPLETED",
  "transaction_id": "OVKPXW165414",
  "amount": "500.00",
  "cus_name": "John Doe",
  "cus_email": "john@gmail.com"
}
Critical Security Rule: Always verify payments server-side using the /api/payment/verify endpoint before updating order statuses or providing services. Never trust client-side browser redirects alone.

Ready-Made Modules & Pre-built Plugins

Zero-Code Integration

Skip custom coding! Download and install our pre-built plugins for popular CMS, billing platforms, and mobile apps in seconds.

WordPress Plugin

v2.1.0 • Zip Package

Accept payments effortlessly on any WordPress blog, store, membership, or donation site.

Download Plugin

WHMCS Module

v1.8.4 • Zip Package

Automate hosting invoices, instant provisioning, and recurring payment receipts in WHMCS.

Download Module

SMM Panel Gateway

v3.0.0 • Drop-in PHP

Direct drop-in gateway for instant user wallet balance top-ups on SMM panels.

Download Gateway

Perfect SMM Panel

v2.4.0 • Zip Package

Optimized integration for Perfect SMM Panel with instant balance credit & webhook support.

Download Script

Android Companion App

v1.5.0 • APK Package

Track and automatically forward live transaction SMS notifications from your Android device.

Download APK

Sketchware Project

v1.0 • SWB Project

Ready Sketchware project file for mobile developers building custom client applications.

Download SWB

Need Integration Support or Custom Webhooks?

Our developer engineering team is available 24/7 to help you with API authentication, custom webhook signatures, and debugging.