Skip to main content

MidnightStreamer Docs & API

Server Api Resellers

Manage IPTV resellers using the MidnightStreamer Pro Server API. Learn how to create, edit, credit and list resellers programmatically.

🤝 MidnightStreamer Pro API – Resellers Management

MidnightStreamer Pro provides a full set of API endpoints for reseller management. You can create resellers, modify their details, add credits and retrieve a complete list, all through authenticated POST requests.


✅ API Access Prerequisite

Before interacting with the API:

  • Go to General Settings → API Settings
  • Add your server IP to Allowed IPs
  • Generate or copy your API Key

The API key may be passed:

  • Via POST parameter api_key
  • As the 4th segment in the URL

➕ Add a New Reseller

Endpoint:

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

Required: name

Optional: 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:

$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

Required: none

Example:

$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);

This guide covers all main operations for reseller automation using the MidnightStreamer Pro Server API.