Skip to main content

MidnightStreamer Docs & API

Server API Resellers

🤝 MidnightStreamer Pro API – Resellers Management

MidnightStreamer Pro offers a full API suite to manage resellers on your IPTV panel. You can create, update, credit, or list resellers through authenticated HTTP POST calls.


✅ API Access Prerequisite

Before using the API:

  1. Go to General Settings → API Settings
  2. Whitelist your server IP
  3. Generate your API Key

You can send the API key using POST or as the 4th segment in the URL.


➕ Add a New Reseller

Endpoint:

http://your-domain:8000/api/resellers/new

Required Parameter:

  • name

Optional Parameters:

  • max_allowed_connections
  • use_credits
  • credits

Example PHP Code:

$panel_url = 'http://your-domain:8000/';
$api_key = 'your_api_key';
$name = 'test_reseller';
$max_allowed_connections = 100;
$use_credits = true;
$credits = 50;

$post_data = array(
  'api_key' => $api_key,
  'data' => array(
    'name' => $name,
    'max_allowed_connections' => $max_allowed_connections,
    'use_credits' => $use_credits,
    'credits' => $credits
  )
);

$opts = array('http' => array(
  'method' => 'POST',
  'header' => 'Content-type: application/x-www-form-urlencoded',
  'content' => http_build_query($post_data)
));

$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/resellers/new", false, $context), true);

✏️ Edit a Reseller

Endpoint:

http://your-domain:8000/api/resellers/update

Required:

  • id or username

Example PHP Code:

$id = 5;
$credits = 100;

$post_data = array(
  'api_key' => $api_key,
  'id' => $id,
  'data' => array('credits' => $credits)
);

$opts = array('http' => array(
  'method' => 'POST',
  'header' => 'Content-type: application/x-www-form-urlencoded',
  'content' => http_build_query($post_data)
));

$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/resellers/update", false, $context), true);

💳 Add Credits to a Reseller

Endpoint:

http://your-domain:8000/api/resellers/add_credits

Required:

  • id or username
  • credits

Example PHP Code:

$id = 5;
$credits = 25;

$post_data = array(
  'api_key' => $api_key,
  'id' => $id,
  'credits' => $credits
);

$opts = array('http' => array(
  'method' => 'POST',
  'header' => 'Content-type: application/x-www-form-urlencoded',
  'content' => http_build_query($post_data)
));

$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/resellers/add_credits", false, $context), true);

📋 List All Resellers

Endpoint:

http://your-domain:8000/api/resellers/list

No parameters required.

Example PHP Code:

$post_data = array('api_key' => $api_key);

$opts = array('http' => array(
  'method' => 'POST',
  'header' => 'Content-type: application/x-www-form-urlencoded',
  'content' => http_build_query($post_data)
));

$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/resellers/list", false, $context), true);