OpenAPI Integration SpecificationJSON / UTF-8
Standard host-to-host (H2H) API for automated BDT collections and payouts.
https://api.lv-pay.cfd
Authentication & Signature Standard
Every request needs your merchant credentials and a signature (sign). Exclude sign, sign_type and empty fields, sort the remaining parameters alphabetically by key (A-Z), join them as key1=val1&key2=val2, append &key=YOUR_SECRET_KEY, and take the uppercase MD5 hash.
sign = strtoupper( md5( "amount=1000.00&merOrderNo=DEP_01&mer_no=LVPAY_XXXXXXXXXXXX&payMethod=bkash×tamp=1793450000&key=" + secret_key ) )| Parameter | Format | Requirement | Example | Description |
|---|---|---|---|---|
mer_no / appId | String(32) | REQUIRED | LVPAY_XXXXXXXXXXXX | Your App ID (merchant identifier) |
secret_key | String(28) | REQUIRED | k3j9... | Secret key for signing. Keep it on your server only. |
timestamp | String(10) | REQUIRED | 1793450000 | Current Unix time. Must be within 15 minutes of server time. |
sign | String(32) | REQUIRED | 5D41402A... | Uppercase MD5 signature |
Live Balance Query API
Returns the live available BDT balance of your merchant account.
https://api.lv-pay.cfd/open/api/merchant/balance| Parameter | Format | Requirement | Description |
|---|---|---|---|
mer_no | String | REQUIRED | Your App ID (merchant identifier) |
timestamp / sign | String | REQUIRED | See Authentication |
Request payload
{
"mer_no": "LVPAY_XXXXXXXXXXXX",
"timestamp": "1793450000",
"sign": "UPPERCASE_MD5_SIGNATURE"
}Response JSON
{
"code": 200,
"success": true,
"status": "SUCCESS",
"message": "Merchant balance retrieved successfully.",
"data": {
"mer_no": "LVPAY_XXXXXXXXXXXX",
"merchant_id": "MID123456",
"allowed_currencies": "BDT",
"bdt_balance": "5000.00",
"inr_balance": "0.00",
"usdt_balance": "0.00",
"wallets": {
"BDT": { "currency": "BDT", "balance": "5000.00", "supported_methods": ["bkash", "nagad"] }
}
},
"timestamp": 1793450000,
"datetime": "2026-12-03 12:00:00"
}Inbound Deposit Order API (Pay-In)
Creates a deposit session for bKash or Nagad. Send the customer to the returned payment page.
https://api.lv-pay.cfd/open/api/order/in| Parameter | Format | Requirement | Description |
|---|---|---|---|
mer_no | String | REQUIRED | Your App ID (merchant identifier) |
merOrderNo | String(100) | REQUIRED | Unique invoice ID from your system. Duplicates are rejected. |
amount | Decimal | REQUIRED | Amount in BDT (for example 1000.00), within the platform limits. |
payMethod | String | REQUIRED | bkash or nagad |
notifyUrl | URL | REQUIRED | Public https address that receives the payment result (webhook) |
returnUrl | URL | REQUIRED | Page the customer returns to after checkout |
response_type | String | OPTIONAL | Set to json to receive payment_url in the response instead of a redirect |
timestamp / sign | String | REQUIRED | See Authentication |
Request payload
{
"mer_no": "LVPAY_XXXXXXXXXXXX",
"merOrderNo": "DEP_20261203_8842",
"amount": "1000.00",
"payMethod": "bkash",
"notifyUrl": "https://merchant-site.com/webhook/notify.php",
"returnUrl": "https://merchant-site.com/payment-success",
"response_type": "json",
"timestamp": "1793450000",
"sign": "UPPERCASE_MD5_SIGNATURE"
}JSON response preview
{
"code": 200,
"success": true,
"status": "SUCCESS",
"message": "Payment session created successfully.",
"data": {
"order_no": "DEP_1793450000",
"sys_no": "SP202612031200001234",
"cashier_order_id": "DEP_20261203120000_1234",
"currency": "BDT",
"method": "bkash",
"amount": "1000.00",
"expire_at": "2026-12-03 12:15:00",
"payment_url": "https://cashier.lv-pay.cfd/payment/?order_id=DEP_20261203120000_1234"
},
"timestamp": 1793450000,
"datetime": "2026-12-03 12:00:00"
}PHP integration sample
<?php
$apiUrl = "https://api.lv-pay.cfd/open/api/order/in";
$appId = "LVPAY_XXXXXXXXXXXX"; // Your App ID (mer_no)
$secretKey = "YOUR_SECRET_KEY"; // Keep this on the server only
$payload = [
'mer_no' => $appId,
'merOrderNo' => 'DEP_' . time(), // unique per merchant
'amount' => '1000.00',
'payMethod' => 'bkash', // bkash | nagad
'notifyUrl' => 'https://merchant-site.com/webhook/notify.php',
'returnUrl' => 'https://merchant-site.com/payment-success',
'response_type' => 'json',
'timestamp' => (string)time(),
];
// Sign: sort by key, skip empty values, append &key=SECRET, MD5 uppercase
$d = $payload; ksort($d); $pairs = [];
foreach ($d as $k => $v) if ($v !== '' && $v !== null) $pairs[] = $k . '=' . trim((string)$v);
$payload['sign'] = strtoupper(md5(implode('&', $pairs) . '&key=' . $secretKey));
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!empty($res['success'])) { header('Location: ' . $res['data']['payment_url']); exit; }
echo $res['message'] ?? 'Error';Deposit Status Query API
Checks the current status of a deposit order.
https://api.lv-pay.cfd/open/api/query/inRequest payload
{
"mer_no": "LVPAY_XXXXXXXXXXXX",
"order_no": "DEP_20261203_8842",
"timestamp": "1793451200",
"sign": "UPPERCASE_MD5_SIGNATURE"
}Response JSON
{
"code": 200,
"success": true,
"status": "SUCCESS",
"message": "Deposit order status retrieved successfully.",
"data": {
"mer_no": "LVPAY_XXXXXXXXXXXX",
"merchant_id": "MID123456",
"order_no": "DEP_20261203_8842",
"sys_no": "SP202612031200001234",
"method": "bkash",
"amount": "1000.00",
"fee": "25.00",
"net_amount": "975.00",
"trade_state": "SUCCESS",
"status": "paid",
"created_at": "2026-12-03 12:00:00"
},
"timestamp": 1793450000,
"datetime": "2026-12-03 12:01:00"
}Status values
| trade_state | Status | Meaning |
|---|---|---|
SUCCESS | paid | Payment confirmed and credited |
PENDING | pending | Waiting for the customer or payment verification |
FAILED | failed | Payment could not be verified |
EXPIRED | expired | Payment window ended without payment |
Outbound Payout API (Disbursement)
Pays out to a bKash or Nagad wallet. The request is accepted as PROCESSING and paid after review.
https://api.lv-pay.cfd/open/api/order/out| Parameter | Format | Requirement | Description |
|---|---|---|---|
mer_no | String | REQUIRED | Your App ID (merchant identifier) |
order_no | String(100) | REQUIRED | Unique payout reference from your system. Duplicates are rejected. |
amount | Decimal | REQUIRED | Amount in BDT within the allowed range. Fees are deducted from your balance. |
method | String | REQUIRED | bkash or nagad |
account | String(11) | REQUIRED | 11-digit wallet number starting with 01 |
name | String | REQUIRED | Account holder name |
timestamp / sign | String | REQUIRED | See Authentication |
Request payload
{
"mer_no": "LVPAY_XXXXXXXXXXXX",
"order_no": "PAYOUT_20261203_001",
"amount": "500.00",
"method": "nagad",
"name": "Rahim Uddin",
"account": "01712345678",
"timestamp": "1793451500",
"sign": "UPPERCASE_MD5_SIGNATURE"
}JSON response preview
{
"code": 200,
"success": true,
"status": "SUCCESS",
"message": "Outbound disbursement order accepted.",
"data": {
"mer_no": "LVPAY_XXXXXXXXXXXX",
"order_no": "PAYOUT_20261203_001",
"sys_no": "WD_20261203120000_1234",
"currency": "BDT",
"method": "nagad",
"amount": "500.00",
"fee": "10.00",
"net_amount": "490.00",
"total_deducted": "500.00",
"target_account": "01712345678",
"status": "PROCESSING"
},
"timestamp": 1793450000,
"datetime": "2026-12-03 12:00:00"
}Payout Status Query API
Checks the live status of a payout using your reference or the platform reference.
https://api.lv-pay.cfd/open/api/query/outRequest payload
{
"mer_no": "LVPAY_XXXXXXXXXXXX",
"order_no": "PAYOUT_20261203_001",
"timestamp": "1793451900",
"sign": "UPPERCASE_MD5_SIGNATURE"
}Response JSON
{
"code": 200,
"success": true,
"status": "SUCCESS",
"message": "Withdrawal order details retrieved successfully.",
"data": {
"mer_no": "LVPAY_XXXXXXXXXXXX",
"merchant_id": "MID123456",
"order_no": "PAYOUT_20261203_001",
"sys_no": "WD_20261203120000_1234",
"currency": "BDT",
"method": "nagad",
"target_account": "01712345678",
"account_name": "Rahim Uddin",
"amount": "500.00",
"fee": "10.00",
"net_amount": "490.00",
"total_deducted": "500.00",
"trade_state": "SUCCESS",
"status": "Success",
"created_at": "2026-12-03 12:00:00"
},
"timestamp": 1793450000,
"datetime": "2026-12-03 12:05:00"
}Status values
| trade_state | Meaning |
|---|---|
PROCESSING | Request received, waiting for review |
SUCCESS | Payout completed |
FAILED | Rejected. The amount is returned to your balance. |
Asynchronous Webhook (IPN) Callback Setup
When a deposit is paid, LV PAY sends an HTTP POST with a JSON body to your notifyUrl. Verify the sign before crediting anything, then reply success with HTTP 200.
| Field | Format | Description |
|---|---|---|
merOrderNo | String | Your invoice ID passed when the order was created |
amount | Decimal | Settled gross amount in BDT |
platformOrder | String | LV PAY platform order reference |
orderStatus / status | String | Always Success when payment is completed |
payMethod / currency | String | BKASH or NAGAD, and currency BDT |
fee / net_amount | Decimal | Fee charged and the amount credited to you |
trx_id | String | bKash or Nagad transaction ID |
api_key / timestamp / sign | String | Your App ID, Unix time and the signature |
Response JSON
{
"merOrderNo": "DEP_20261203_8842",
"amount": 1000,
"platformOrder": "SP202612031200001234",
"orderStatus": "Success",
"status": "Success",
"payMethod": "BKASH",
"currency": "BDT",
"fee": 25,
"net_amount": 975,
"trx_id": "8N7K3J2L1M",
"api_key": "LVPAY_XXXXXXXXXXXX",
"timestamp": "1793451300",
"sign": "UPPERCASE_MD5_SIGNATURE"
}PHP integration sample
<?php
// notify.php - receives the payment result from LV PAY
$secretKey = 'YOUR_SECRET_KEY';
$data = json_decode(file_get_contents('php://input'), true) ?: $_POST;
$sign = (string)($data['sign'] ?? '');
unset($data['sign'], $data['sign_type'], $data['secret_key']);
ksort($data); $pairs = [];
foreach ($data as $k => $v) if ($v !== '' && $v !== null && !is_array($v)) $pairs[] = $k . '=' . trim((string)$v);
$calc = strtoupper(md5(implode('&', $pairs) . '&key=' . $secretKey));
if (!hash_equals($calc, strtoupper($sign))) { http_response_code(401); exit('fail'); }
// 1. Find your order by $data['merOrderNo']
// 2. Check $data['amount'] matches your order
// 3. Mark the order as paid only once (ignore repeats)
echo 'success';Responses & Errors
Every response has the same structure: code, success, status, message, data (on success), timestamp and datetime.
| HTTP | Meaning |
|---|---|
| 200 | Success |
| 400 | Invalid or missing parameter (see message) |
| 401 | Wrong signature, or the timestamp is outside the 15-minute window |
| 403 | Merchant account is blocked |
| 404 | Order not found |
| 405 | Wrong HTTP method (use POST) |
| 429 | Too many failed requests. Wait and try again. |
| 500 | Server error. Try again later. |
Error example
{
"code": 401,
"success": false,
"status": "FAILED",
"message": "Invalid merchant or signature.",
"timestamp": 1793450000,
"datetime": "2026-12-03 12:00:00"
}