Drive Offer API Documentation

NICTBD.COM Drive Offer Recharge API Documentation

Use NICTBD.COM Drive Offer API to check active internet, minutes, bundle, rate cutter and entertainment offers, submit offer recharge requests and verify order status from your own website, Laravel application, mobile app backend or custom merchant system.

Overview

NICTBD.COM Drive Offer API allows approved merchants to fetch active offers, submit offer recharge requests and check request status using secure API credentials. This API is useful for selling internet packs, minute packs, bundle offers, rate cutter packs and entertainment offers from a merchant website or app backend.

This API is server-to-server only. Always call this API from your secure backend. Do not expose your API Secret in browser JavaScript, Android APK, iOS app, Flutter app, React Native app or public Git repository.

Core Features

Offer Recharge Submit internet, minutes, bundle, rate cutter and entertainment offer recharge requests.
Offer Check Get active offer list with operator, price, commission, type and validity.
Operator Support Supports GP, Banglalink, Robi, Airtel and Teletalk offer requests.
Wallet Balance Merchant wallet balance is used for submitted offer requests.
Commission Info API response includes offer price, merchant commission and total amount.
Verified Merchant Only Only approved merchants with active API credentials can use this API.
Status Check Merchants can check latest order status anytime using order number.
Secure API Access Every request requires Store ID, API Key and API Secret verification.

API Flow

1. Check Offers Merchant fetches active offers by operator or offer type using the check action.
2. Submit Request Merchant submits selected offer ID and customer mobile number.
3. Check Status Merchant checks latest order status using the status_check action and order number.
After submit, response status can be Processing. Use the status check API to get the latest result before confirming final delivery status to your customer.

API Credentials

Merchant can collect API credentials from NICTBD.COM Merchant Dashboard after approval.

Credential Required Example Usage
store_id Required STORE-2-FRXECLKM Identifies your merchant store.
api_key Required pk_live_xxxxxxxxx Merchant API key.
api_secret Required sk_live_xxxxxxxxx Private API secret. Keep it hidden and secure.
Merchant verification status must be approved. Inactive or unapproved merchants cannot use this API.

API Endpoint

Use the same endpoint with different action query values.

POST https://www.nictbd.com/api/drive-offer?action=check
POST https://www.nictbd.com/api/drive-offer?action=submit
POST https://www.nictbd.com/api/drive-offer?action=status_check

Headers

Headers
Accept: application/json
Content-Type: application/x-www-form-urlencoded
JSON request body is also supported if your backend sends Content-Type: application/json.

API Actions

Action Method Purpose Required Main Fields
check POST Get active offer list. store_id, api_key, api_secret
submit POST Submit selected offer request. store_id, api_key, api_secret, offer_id, phone
status_check POST Check latest request status. store_id, api_key, api_secret, order_number

Offer Types

You can filter offers using offer_type when calling the check action.

Offer Type Description
internet Internet data offers.
minutes Voice minute offers.
bundle Combo bundle offers.
ratecutter Rate cutter offers.
entertainment Entertainment related packs.

Supported Operators

Operator Code Operator Name Allowed Number Prefix Example Number
GP Grameenphone 013, 017 01700000000
BL Banglalink 014, 019 01900000000
RB Robi 018 01800000000
AT Airtel 016 01600000000
TT Teletalk 015 01500000000
Selected offer operator and customer mobile number operator must match.

Integration Examples

Swipe tabs horizontally to view more examples.

cURL Examples

Check Offers
curl -X POST "https://www.nictbd.com/api/drive-offer?action=check" \
  -H "Accept: application/json" \
  -d "store_id=YOUR_STORE_ID" \
  -d "api_key=YOUR_API_KEY" \
  -d "api_secret=YOUR_API_SECRET" \
  -d "operator_code=GP" \
  -d "offer_type=internet"
Submit Request
curl -X POST "https://www.nictbd.com/api/drive-offer?action=submit" \
  -H "Accept: application/json" \
  -d "store_id=YOUR_STORE_ID" \
  -d "api_key=YOUR_API_KEY" \
  -d "api_secret=YOUR_API_SECRET" \
  -d "offer_id=12" \
  -d "phone=01700000000"
Status Check
curl -X POST "https://www.nictbd.com/api/drive-offer?action=status_check" \
  -H "Accept: application/json" \
  -d "store_id=YOUR_STORE_ID" \
  -d "api_key=YOUR_API_KEY" \
  -d "api_secret=YOUR_API_SECRET" \
  -d "order_number=R6A1B2C3D4E5F6"

PHP cURL Example

PHP
<?php

$url = 'https://www.nictbd.com/api/drive-offer?action=submit';

$data = [
    'store_id' => 'YOUR_STORE_ID',
    'api_key' => 'YOUR_API_KEY',
    'api_secret' => 'YOUR_API_SECRET',
    'offer_id' => '12',
    'phone' => '01700000000',
];

$ch = curl_init($url);

curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => http_build_query($data),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 60,
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
    ],
]);

$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);

if ($error) {
    echo 'Curl Error: ' . $error;
    exit;
}

$result = json_decode($response, true);

if (!empty($result['success']) && $result['success'] === true) {
    echo 'Request Submitted. Order: ' . $result['order_number'];
} else {
    echo 'Request Failed. Reason: ' . ($result['error'] ?? 'Unknown error');
}

print_r($result);

Laravel HTTP Client Example

Laravel
use Illuminate\Support\Facades\Http;

$response = Http::asForm()
    ->acceptJson()
    ->timeout(60)
    ->post('https://www.nictbd.com/api/drive-offer?action=submit', [
        'store_id' => config('services.nictbd.store_id'),
        'api_key' => config('services.nictbd.api_key'),
        'api_secret' => config('services.nictbd.api_secret'),
        'offer_id' => 12,
        'phone' => '01700000000',
    ]);

$result = $response->json();

if (($result['success'] ?? false) === true) {
    // Request submitted
    // Save order_number and check status later if needed
} else {
    // Request failed
    // Show $result['error']
}

Node.js Example

Node.js
const payload = new URLSearchParams({
  store_id: "YOUR_STORE_ID",
  api_key: "YOUR_API_KEY",
  api_secret: "YOUR_API_SECRET",
  offer_id: "12",
  phone: "01700000000"
});

const response = await fetch("https://www.nictbd.com/api/drive-offer?action=submit", {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/x-www-form-urlencoded"
  },
  body: payload
});

const result = await response.json();

if (result.success === true) {
  console.log("Request Submitted:", result.order_number);
} else {
  console.log("Request Failed:", result.error);
}

Python Example

Python
import requests

payload = {
    "store_id": "YOUR_STORE_ID",
    "api_key": "YOUR_API_KEY",
    "api_secret": "YOUR_API_SECRET",
    "offer_id": "12",
    "phone": "01700000000"
}

response = requests.post(
    "https://www.nictbd.com/api/drive-offer?action=submit",
    data=payload,
    headers={"Accept": "application/json"},
    timeout=60
)

result = response.json()

if result.get("success") is True:
    print("Request Submitted:", result.get("order_number"))
else:
    print("Request Failed:", result.get("error"))

Check Offers Response

Use action=check to get active offer list. You can filter by operator_code and offer_type.

Request Parameters

Field Required Example Description
store_id Required STORE-2-FRXECLKM Your Store ID.
api_key Required pk_live_xxxxxxxxx Your API Key.
api_secret Required sk_live_xxxxxxxxx Your API Secret.
operator_code Optional GP Filter offers by operator.
offer_type Optional internet Filter offers by type.

Success Response

JSON Response
{
  "success": true,
  "offers": [
    {
      "id": "12",
      "operator_code": "GP",
      "operator_name": "Grameenphone",
      "offer_name": "1GB Internet",
      "offer_price": "99.0000",
      "merchant_commission": "2.0000",
      "user_commission": "2.0000",
      "offer_type": "internet",
      "validity": "7 Days"
    }
  ]
}

Submit Request Response

Use action=submit with selected offer_id and customer mobile number. A successful submit response means the request has been accepted for processing.

Request Parameters

Field Required Example Description
store_id Required STORE-2-FRXECLKM Your Store ID.
api_key Required pk_live_xxxxxxxxx Your API Key.
api_secret Required sk_live_xxxxxxxxx Your API Secret.
offer_id Required 12 Offer ID from check response.
phone Required 01700000000 Customer mobile number.

Success Response

JSON Response
{
  "success": true,
  "order_number": "R6A1B2C3D4E5F6",
  "status": "Processing",
  "offer": "1GB Internet",
  "offer_type": "internet",
  "validity": "7 Days",
  "phone": "017XXXX0000",
  "operator": "GP",
  "amount": "99.00",
  "commission": "2.00",
  "total_amount": "97.00",
  "before_balance": "500.00",
  "after_balance": "401.00"
}
Merchant should save the order_number and use status check API to get final order result.

Status Check Response

Use action=status_check with order_number to check latest request status.

Request Parameters

Field Required Example Description
store_id Required STORE-2-FRXECLKM Your Store ID.
api_key Required pk_live_xxxxxxxxx Your API Key.
api_secret Required sk_live_xxxxxxxxx Your API Secret.
order_number Required R6A1B2C3D4E5F6 Order number from submit response.

Processing Response

JSON Response
{
  "success": true,
  "order_number": "R6A1B2C3D4E5F6",
  "status": "Processing",
  "offer": "1GB Internet",
  "offer_type": "internet",
  "validity": "7 Days",
  "amount": "99.00",
  "commission": "2.00",
  "total_amount": "97.00",
  "phone": "017XXXX0000",
  "operator": "GP",
  "response": "Recharge request submitted"
}

Success Response

JSON Response
{
  "success": true,
  "order_number": "R6A1B2C3D4E5F6",
  "status": "Success",
  "offer": "1GB Internet",
  "offer_type": "internet",
  "validity": "7 Days",
  "amount": "99.00",
  "commission": "2.00",
  "total_amount": "97.00",
  "phone": "017XXXX0000",
  "operator": "GP",
  "operator_transaction_id": "123456789"
}

Cancelled Response

JSON Response
{
  "success": true,
  "order_number": "R6A1B2C3D4E5F6",
  "status": "Cancelled",
  "offer": "1GB Internet",
  "offer_type": "internet",
  "validity": "7 Days",
  "amount": "99.00",
  "commission": "2.00",
  "total_amount": "97.00",
  "phone": "017XXXX0000",
  "operator": "GP",
  "cancel_note": "Request could not be completed."
}

Error Responses

Missing API Credentials

JSON
{
  "success": false,
  "error": "Missing API credentials."
}

Invalid API Credentials

JSON
{
  "success": false,
  "error": "Invalid API credentials."
}

Merchant Verification Not Approved

JSON
{
  "success": false,
  "error": "Merchant verification is not approved."
}

Invalid Offer Type

JSON
{
  "success": false,
  "error": "Invalid offer type.",
  "allowed_types": [
    "internet",
    "minutes",
    "bundle",
    "ratecutter",
    "entertainment"
  ]
}

Invalid Offer ID

JSON
{
  "success": false,
  "error": "Invalid offer ID."
}

Invalid Operator Number

JSON
{
  "success": false,
  "error": "Invalid operator number for this offer."
}

Insufficient Balance

JSON
{
  "success": false,
  "error": "Insufficient balance."
}

Transaction Not Found

JSON
{
  "success": false,
  "error": "Transaction not found."
}

Security Guidelines

  • Call Drive Offer API only from your backend server.
  • Never expose api_secret in frontend JavaScript, mobile app source code or public repository.
  • Keep credentials inside environment variables or secure configuration.
  • Validate phone number and operator before submitting request.
  • Use order_number from submit response to check final status.
  • Do not show final success to customer until status check returns Success.
  • Contact support immediately if API Secret is leaked.
If your API Secret is compromised, regenerate credentials from merchant dashboard or contact NICTBD.COM support.

Important Notes

Topic Explanation
Merchant Approval Only approved merchants can use Drive Offer API.
Check Action Use check action to get latest available offer list.
Submit Action Use submit action to submit selected offer request.
Status Check Use status_check action to check latest order status.
Phone Operator Customer mobile number must match the selected offer operator.
Final Status Final result should be confirmed using status check API.
API Security Always keep api_secret private and call this API from backend only.
For API support, please contact NICTBD.COM support team with your Store ID and order number.