NICTBD.COM Balance Check API Documentation
Use the Balance Check API to show merchant live wallet balance inside recharge software, reseller panel, merchant dashboard, desktop application, Laravel project or any custom API integration.
Overview
Balance Check API allows an approved merchant to check current wallet balance using Store ID, API Key and API Secret. This API is useful for recharge desktop software, reseller recharge panel and merchant-side wallet display.
Core Features
API Flow
The Balance Check API follows a simple merchant credential verification flow.
API Credentials
Merchant needs valid API credentials from NICTBD.COM merchant dashboard.
| Credential | Example | Visibility | Usage |
|---|---|---|---|
| Store ID | STORE-XXXXXXXXXX |
Private app/server | Identifies merchant store. |
| API Key | pk_xxxxxxxxxxxxxxxxx |
Private app/server | Used for merchant API authentication. |
| API Secret | sk_xxxxxxxxxxxxxxxxx |
Private | Used to verify merchant API access. Keep it secure. |
Balance Check API
Use this endpoint to check merchant wallet balance.
https://www.nictbd.com/api/balance-check
Headers
Content-Type: application/json Accept: application/json
Request Body
| Field | Required | Type | Description |
|---|---|---|---|
| store_id | Required | string | Your NICTBD.COM Store ID. |
| api_key | Required | string | Your merchant API key. |
| api_secret | Required | string | Your merchant API secret. |
JSON Request Example
{
"store_id": "STORE-XXXXXXXXXX",
"api_key": "pk_xxxxxxxxxxxxxxxxx",
"api_secret": "sk_xxxxxxxxxxxxxxxxx"
}
Success Response
If credentials are valid and merchant is active/approved, API will return current wallet balance.
{
"success": true,
"merchant_name": "DEMO MERCHANT",
"balance": "2835.60",
"currency": "BDT"
}
Merchant: DEMO MERCHANT
Balance: ৳ 2835.60
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | API request status. |
| merchant_name | string | Merchant owner/business/name. |
| balance | decimal string | Merchant wallet balance. |
| currency | string | Balance currency. Default: BDT. |
Integration Examples
Use any of the examples below to connect your software or backend with Balance Check API.
PowerShell Test
Invoke-RestMethod `
-Uri "https://www.nictbd.com/api/balance-check" `
-Method POST `
-ContentType "application/json" `
-Body '{
"store_id": "STORE-XXXXXXXXXX",
"api_key": "pk_xxxxxxxxxxxxxxxxx",
"api_secret": "sk_xxxxxxxxxxxxxxxxx"
}'
cURL
curl -X POST "https://www.nictbd.com/api/balance-check" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"store_id": "STORE-XXXXXXXXXX",
"api_key": "pk_xxxxxxxxxxxxxxxxx",
"api_secret": "sk_xxxxxxxxxxxxxxxxx"
}'
PHP
$payload = [
"store_id" => "STORE-XXXXXXXXXX",
"api_key" => "pk_xxxxxxxxxxxxxxxxx",
"api_secret" => "sk_xxxxxxxxxxxxxxxxx",
];
$ch = curl_init("https://www.nictbd.com/api/balance-check");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Accept: application/json",
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if (($result["success"] ?? false) === true) {
echo "Balance: ৳ " . $result["balance"];
} else {
echo $result["error"] ?? "Balance check failed";
}
Laravel
use Illuminate\Support\Facades\Http;
$response = Http::acceptJson()
->asJson()
->post('https://www.nictbd.com/api/balance-check', [
'store_id' => 'STORE-XXXXXXXXXX',
'api_key' => 'pk_xxxxxxxxxxxxxxxxx',
'api_secret' => 'sk_xxxxxxxxxxxxxxxxx',
]);
$result = $response->json();
if (($result['success'] ?? false) === true) {
return 'Balance: ৳ ' . $result['balance'];
}
return $result['error'] ?? 'Balance check failed';
C# Desktop App
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class BalanceClient
{
public static async Task CheckBalance()
{
using var client = new HttpClient();
var payload = new
{
store_id = "STORE-XXXXXXXXXX",
api_key = "pk_xxxxxxxxxxxxxxxxx",
api_secret = "sk_xxxxxxxxxxxxxxxxx"
};
string json = JsonSerializer.Serialize(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://www.nictbd.com/api/balance-check",
content
);
string body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
}
Node.js
const payload = {
store_id: "STORE-XXXXXXXXXX",
api_key: "pk_xxxxxxxxxxxxxxxxx",
api_secret: "sk_xxxxxxxxxxxxxxxxx"
};
const response = await fetch("https://www.nictbd.com/api/balance-check", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify(payload)
});
const result = await response.json();
if (result.success === true) {
console.log("Balance: ৳ " + result.balance);
} else {
console.log(result.error || "Balance check failed");
}
Error Codes
| HTTP Code | Error | Reason |
|---|---|---|
| 422 | Missing API credentials. |
store_id, api_key or api_secret is missing. |
| 401 | Invalid API credentials. |
Store ID, API Key or API Secret is incorrect or inactive. |
| 403 | Merchant account is not active. |
Merchant account has been disabled. |
| 403 | Merchant verification is not approved. |
Merchant verification is pending, submitted or rejected. |
Error Response Example
{
"success": false,
"error": "Invalid API credentials."
}
Security Best Practices
- Keep API Secret private and never publish it publicly.
- For desktop software, store API credentials using encrypted local storage if possible.
- Do not expose merchant credentials in frontend JavaScript or public source code.
- Regenerate API Secret if it is leaked or shared accidentally.
- Refresh balance every 10–30 seconds instead of every second to reduce server load.
- Use HTTPS only for live API requests.