Payment Gateway API
Integrate ShobarBondhu seamless payment gateway into your website or application.
Welcome to the official API documentation. Our API allows merchants to create payment requests and receive instant callbacks when a customer successfully completes a payment using their account balance.
Authentication
All API requests require authentication. You must include your api-key and api-secret in the HTTP Headers of every request. You can generate these keys from your Merchant Dashboard.
| Header Key | Description |
|---|---|
| api-key | Your public merchant API Key (e.g., MERCH_XXXXXX) |
| api-secret | Your private merchant API Secret. Keep this secure! |
Create Payment
Initialize a new payment request. This will return a secure payment URL where you need to redirect your customer to complete the transaction.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | Number | Yes | The payment amount in BDT. Minimum is 10. |
| callback_url | String | Yes | The URL on your website where the user will be redirected after a successful payment. |
Example Request (PHP / cURL)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://shobarbondhu.com/api/create-payment',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
"amount" => 500,
"callback_url" => "https://your-website.com/success"
]),
CURLOPT_HTTPHEADER => array(
'api-key: YOUR_API_KEY',
'api-secret: YOUR_API_SECRET',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response Validation
If the request is successful, you will receive a payment_url. You must redirect your customer to this URL.
Success Response (200 OK)
{
"success": true,
"invoice_id": "INV168452ABCDEF",
"payment_url": "https://shobarbondhu.com/payment-gateway/checkout/INV168452ABCDEF"
}
Payment Callback
Once the customer successfully enters their OTP and PIN on our secure gateway, their account balance is deducted, and the funds are instantly added to your merchant balance.
After this process, we redirect the customer back to the callback_url you provided during the "Create Payment" request.
Callback Parameters
| Parameter | Description |
|---|---|
| status | Will always return success upon completion. |
| invoice_id | The unique Invoice ID generated during the payment creation. Use this to update your database order status. |
status=success, you can mark the customer's order as Paid in your system.