iTopUp বিল পেমেন্ট API ব্যবহারের ডকুমেন্টেশন

API ব্যবহার করতে হলে আপনাকে Username, Password, API Key ও API Secret ব্যবহার করে credential পাঠাতে হবে। যদি আপনার অ্যাকাউন্ট না থাকে, এখান থেকে রেজিস্ট্রেশন করুন

Base URL

https://itopup.world/api/v1/

API এন্ডপয়েন্টস

এন্ডপয়েন্টমেথডবর্ণনা
get_protistans.phpPOSTপ্রোভাইডার লিস্ট ফেরত দেয়
get_services.phpPOSTনির্দিষ্ট প্রোভাইডারের সার্ভিস লিস্ট দেয়
place_bill_order.phpPOSTপ্রিপেইড বা পোস্টপেইড অর্ডার প্লেস করে

1. get_protistans.php

Parameters: cURL উদাহরণ:
curl -X POST https://itopup.world/api/v1/get_protistans.php \
-H "Content-Type: application/json" \
-d '{
  "username":"your_username",
  "password":"your_password",
  "api_key":"your_api_key",
  "api_secret":"your_api_secret"
}'

        
PHP উদাহরণ:
<?php
$data = [
  "username"=>"your_username",
  "password"=>"your_password",
  "api_key"=>"your_api_key",
  "api_secret"=>"your_api_secret"
];
$ch = curl_init("https://itopup.world/api/v1/get_protistans.php");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($data));
curl_setopt($ch,CURLOPT_HTTPHEADER,["Content-Type: application/json"]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>

        
সফল response:
{
  "success": true,
  "protistans": [
    {"id":1,"name":"Palli Biddut"},
    {"id":2,"name":"Gas Bill"}
  ]
}
ব্যর্থ response:
{
  "success": false,
  "message": "Invalid API credentials"
}

2. get_services.php

Parameters: cURL উদাহরণ:
curl -X POST https://itopup.world/api/v1/get_services.php \
-H "Content-Type: application/json" \
-d '{
  "username":"your_username",
  "password":"your_password",
  "api_key":"your_api_key",
  "api_secret":"your_api_secret",
  "protistan_id":1
}'

        
PHP উদাহরণ:
<?php
$data = [
  "username"=>"your_username",
  "password"=>"your_password",
  "api_key"=>"your_api_key",
  "api_secret"=>"your_api_secret",
  "protistan_id"=>1
];
$ch = curl_init("https://itopup.world/api/v1/get_services.php");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($data));
curl_setopt($ch,CURLOPT_HTTPHEADER,["Content-Type: application/json"]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>

        
সফল response:
{
  "success": true,
  "services": [
    {"id":1,"name":"Gasbill","required_fields":["mobile"]},
    {"id":2,"name":"Electricity Bill","required_fields":["account","bill_month"]}
  ]
}
ব্যর্থ response:
{
  "success": false,
  "message": "Protistan not found"
}

3. place_bill_order.php

Parameters: cURL উদাহরণ:
curl -X POST https://itopup.world/api/v1/place_bill_order.php \
-H "Content-Type: application/json" \
-d '{
  "username":"your_username",
  "password":"your_password",
  "api_key":"your_api_key",
  "api_secret":"your_api_secret",
  "protistan_id":1,
  "service_id":2,
  "fields":{"account":"1234567890"},
  "amount":500,
  "account_type":"postpaid",
  "bill_month":"2025-09"
}'

        
PHP উদাহরণ:
<?php
$data = [
  "username"=>"your_username",
  "password"=>"your_password",
  "api_key"=>"your_api_key",
  "api_secret"=>"your_api_secret",
  "protistan_id"=>1,
  "service_id"=>2,
  "fields"=>["account"=>"1234567890"],
  "amount"=>500,
  "account_type"=>"postpaid",
  "bill_month"=>"2025-09"
];
$ch = curl_init("https://itopup.world/api/v1/place_bill_order.php");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($data));
curl_setopt($ch,CURLOPT_HTTPHEADER,["Content-Type: application/json"]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>

        
সফল response (prepaid):
{
  "success": true,
  "order_id": 101,
  "merchant_balance": 4500,
  "message": "Prepaid order placed successfully"
}
সফল response (postpaid):
{
  "success": true,
  "order_id": 102,
  "merchant_balance": 4000,
  "message": "Postpaid bill order placed successfully"
}
ব্যর্থ response (Insufficient balance):
{
  "success": false,
  "message": "Insufficient balance"
}
ব্যর্থ response (Invalid credentials):
{
  "success": false,
  "message": "Invalid API credentials"
}
ব্যর্থ response (Missing required fields):
{
  "success": false,
  "message": "Required fields missing"
}