Welcome To Trust Pay Bd Docs Last updated: 2025-12-19

Trust Pay Bd is a simple and Secure payment automation tool designed to use your personal account as a payment gateway. Accept payments seamlessly from customers through your website with full API control.

API Introduction

Trust Pay Bd connects multiple payment terminals including card systems, MFS, and local/international wallets. After payment, customers are returned to your site with instant transaction notifications.

API Operation

Ensure your server supports cURL. Use Sandbox for testing and Live for production.

POST https://pay.trustpaybd.cfd/api/payment/create
POST https://pay.trustpaybd.cfd/api/payment/verify

Parameter Details

Note: Required variables for POST request to initialize payment.

Field Name Description Required Example
cus_nameCustomer Full NameYesJohn Doe
cus_emailCustomer EmailYesjohn@gmail.com
amountPayable amount (Numbers only)Yes10.50
success_urlSuccess Callback URLYeshttps://site.com/success
cancel_urlCancel Callback URLYeshttps://site.com/cancel

Verification: Required variables for Payment Verify API.

Field NameDescriptionRequiredExample
transaction_idID from success URL queryYesOVKPXW165414

Authentication Headers

Header NameValue / Source
Content-Typeapplication/json
API-KEYApp key from credentials
SECRET-KEYSecret key from credentials
BRAND-KEYBrand key from Brands section

Integration Guides

Choose your platform and follow the sample requests or download our modules.

Sample Requests (PHP/cURL)

 <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://pay.trustpaybd.cfd/api/payment/create', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","metadata":{"phone":"016****"},"amount":"10"}', CURLOPT_HTTPHEADER => array( 'API-KEY: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type: application/json', 'SECRET-KEY: YourSecretKeyHere', 'BRAND-KEY: YourBrandKeyHere' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ?> 
 <?php $client = new Client(); $headers = [ 'API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type' => 'application/json', 'SECRET-KEY' => 'YourSecretKeyHere', 'BRAND-KEY' => 'YourBrandKeyHere' ]; $body = '{ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10" }'; $request = new Request('POST', 'https://pay.trustpaybd.cfd/api/payment/create', $headers, $body); $res = $client->sendAsync($request)->wait(); echo $res->getBody(); ?> 
 const axios = require('axios'); let data = JSON.stringify({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://pay.trustpaybd.cfd/api/payment/create', headers: { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json', 'SECRET-KEY': 'YourSecretKeyHere', 'BRAND-KEY': 'YourBrandKeyHere' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); 
 import requests import json url = "https://pay.trustpaybd.cfd/api/payment/create" payload = json.dumps({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10" }) headers = { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json', 'SECRET-KEY': 'YourSecretKeyHere', 'BRAND-KEY': 'YourBrandKeyHere' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) 
 package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://pay.trustpaybd.cfd/api/payment/create" method := "POST" payload := strings.NewReader(`{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","metadata":{"phone":"01521412457"},"amount":"10"}`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef") req.Header.Add("Content-Type", "application/json") req.Header.Add("SECRET-KEY", "YourSecretKeyHere") req.Header.Add("BRAND-KEY", "YourBrandKeyHere") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } 

Response Details

Field Name Type Description
Success Response
status bool TRUE
message String Message for Status
payment_url String Payment Link (where customers will complete their payment)
Error Response
status bool FALSE
message String Message associated with the error response
Completing Payment Page task you will be redirected to success or cancel page based on transaction status with the following Query Parameters: yourdomain.com/(success/cancel)?transactionId=******&paymentMethod=***&paymentAmount=**.**&paymentFee=**.**&status=pending or success or failed
<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'https://pay.trustpaybd.cfd/api/payment/verify', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{"transaction_id":"ABCDEFH"}', CURLOPT_HTTPHEADER => array( 'API-KEY: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type: application/json', 'SECRET-KEY: Secret key From API credentials', 'BRAND-KEY: Brand key From Brands' ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?> 
<?php
$client = new Client();
$headers = [ 'API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type' => 'application/json', 'SECRET-KEY' => 'Secret key From API credentials', 'BRAND-KEY' => 'Brand key From Brands'
];
$body = '{ "transaction_id": "ABCDEFH"
}';
$request = new Request('POST', 'https://pay.trustpaybd.cfd/api/payment/verify', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
?> 
const axios = require('axios');
let data = JSON.stringify({ "transaction_id": "ABCDEFH"
});
let config = { method: 'post', maxBodyLength: Infinity, url: 'https://pay.trustpaybd.cfd/api/payment/verify', headers: { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json', 'SECRET-KEY': 'Secret key From API credentials', 'BRAND-KEY': 'Brand key From Brands' }, data : data
};
axios.request(config)
.then((response) => { console.log(JSON.stringify(response.data));
})
.catch((error) => { console.log(error);
}); 
import http.client
import json
conn = http.client.HTTPSConnection("local.pay.expensivepay.com")
payload = json.dumps({ "transaction_id": "ABCDEFH"
})
headers = { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json', 'SECRET-KEY': 'Secret key From API credentials', 'BRAND-KEY': 'Brand key From Brands'
}
conn.request("POST", "/api/payment/verify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8")) 
package main
import ( "fmt" "strings" "net/http" "io/ioutil"
)
func main() { url := "https://pay.trustpaybd.cfd/api/payment/verify" method := "POST" payload := strings.NewReader(`{"transaction_id":"ABCDEFH"}`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef") req.Header.Add("Content-Type", "application/json") req.Header.Add("SECRET-KEY", "Secret key From API credentials") req.Header.Add("BRAND-KEY", "Brand key From Brands") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))
} 
Sample Response
{ "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "900.000", "transaction_id": "OVKPXW165414", "metadata": { "phone": "015****", }, "payment_method": "bkash", "status": "COMPLETED"
} 

Response Details

Field Name Type Description
Success Response
status string COMPLETED or PENDING or ERROR
cus_name String Customer Name
cus_email String Customer Email
amount String Amount
transaction_id String Transaction id Generated by System
metadata json Metadata used for Payment creation
Error Response
status bool FALSE
message String Message associated with the error response

Modules & Plugins

WordPress / WooCommerce

Setup Video: Watch Here

Download Plugin

WHMCS Gateway

Setup Video: Watch Here

Download Module

Sketchware (SWB + Blocks)

Setup Video: Watch Here

Download Assets