Offer API ডকুমেন্টেশন

Base URL

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

1. অফার লিস্ট

Endpoint: checkoffer.php

Method: POST

প্রয়োজনীয় Parameter:

ParameterRequiredDescription
usernameYesAPI username
passwordYesAPI password
api_keyYesAPI Key
api_secretYesAPI Secret
operatorYesযে অপারেটরের অফার লিস্ট চাও (GP, BL, RB, AT, TT)

cURL উদাহরণ:

curl -X POST https://itopup.world/api/v1/checkoffer.php \
-H "Content-Type: application/json" \
-d '{
  "username": "your_username",
  "password": "your_password",
  "api_key": "your_api_key",
  "api_secret": "your_api_secret",
  "operator": "GP"
}'

    

PHP উদাহরণ:

<?php
$data = [
  "username" => "your_username",
  "password" => "your_password",
  "api_key" => "your_api_key",
  "api_secret" => "your_api_secret",
  "operator" => "GP"
];

$ch = curl_init("https://itopup.world/api/v1/checkoffer.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;
?>

    

Example Response (Success):

{
  "success": true,
  "operator": "GP",
  "offers": [
    {
      "id": 1,
      "offer_name": "GP 50tk Package",
      "operator_code": "GP",
      "offer_price": 50,
      "validity": "7 days",
      "merchant_commission": 2
    },
    {
      "id": 2,
      "offer_name": "GP 100tk Package",
      "operator_code": "GP",
      "offer_price": 100,
      "validity": "15 days",
      "merchant_commission": 4
    }
  ]
}
    

Example Response (Error):

{
  "success": false,
  "message": "Invalid API credentials"
}
    

2. অফার টপআপ

Endpoint: sendrequest.php

Method: POST

প্রয়োজনীয় Parameter:

ParameterRequiredDescription
usernameYesAPI username
passwordYesAPI password
api_keyYesAPI Key
api_secretYesAPI Secret
offer_idYesটপআপ করার অফারের ID
mobileYesগ্রাহকের মোবাইল নম্বর
webhook_urlYeswebhook URL মার্চেন্ট প্যানেল থেকে আপডেট করুন

cURL উদাহরণ:

curl -X POST https://itopup.world/api/v1/sendrequest.php \
-H "Content-Type: application/json" \
-d '{
  "username": "your_username",
  "password": "your_password",
  "api_key": "your_api_key",
  "api_secret": "your_api_secret",
  "offer_id": 4,
  "mobile": "019XXXXXXXX",
  "webhook_url": "https://yourwebhook.com"
}'>

    

PHP উদাহরণ:

<?php
$data = [
  "username" => "your_username",
  "password" => "your_password",
  "api_key" => "your_api_key",
  "api_secret" => "your_api_secret",
  "offer_id" => 4,
  "mobile" => "019XXXXXXXX",
  "webhook_url" => "https://yourwebhook.com"
];

$ch = curl_init("https://itopup.world/api/v1/sendrequest.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;
?>

    

Example Response (Success):

{
  "success": true,
  "message": "Your offer topup request is now processing.",
  "order_number": "ORD1699999999",
  "previous_balance": 500,
  "deducted_amount": 100,
  "commission": 4,
  "new_balance": 404,
  "status": "processing",
  "mobile": "019XXXXXXXX",
  "offer_id": 4,
  "offer_name": "GP 100tk Package"
}
    

Example Response (Error - Insufficient Balance):

{
  "success": false,
  "message": "Insufficient balance",
  "previous_balance": 50
}
    

Example Response (Error - Invalid API Credentials):

{
  "success": false,
  "message": "Invalid API credentials"
}