$API_KEY, "action" => "balance", ]; return callAPI($API_URL, $data); } /** * 2) Get the list of available services * ------------------------------------------------------------- */ function getServices($API_URL, $API_KEY) { $data = [ "key" => $API_KEY, "action" => "services", ]; return callAPI($API_URL, $data); } /** * 3) Place a new order * ------------------------------------------------------------- * service : Service ID (required) * link : Link/target for the order (required) * quantity : Quantity (required, depending on the service) * runs : Number of runs (optional - for drip-feed services) * interval : Interval in minutes (optional - for drip-feed services) */ function addOrder($API_URL, $API_KEY, $serviceId, $link, $quantity, $runs = null, $interval = null) { $data = [ "key" => $API_KEY, "action" => "add", "service" => $serviceId, "link" => $link, "quantity" => $quantity, ]; if ($runs !== null) { $data["runs"] = $runs; } if ($interval !== null) { $data["interval"] = $interval; } return callAPI($API_URL, $data); } /** * 4) Check the status of an order * ------------------------------------------------------------- * order : Order ID (required) */ function getOrderStatus($API_URL, $API_KEY, $orderId) { $data = [ "key" => $API_KEY, "action" => "status", "order" => $orderId, ]; return callAPI($API_URL, $data); } /* ==================================================================== * Usage examples (uncomment the line you want to try) * ==================================================================== */ // Example 1: Get balance // $result = getBalance($API_URL, $API_KEY); // print_r($result); // // Expected result: ["balance" => "100.84292", "currency" => "USD"] // Example 2: Get the list of services // $result = getServices($API_URL, $API_KEY); // print_r($result); // Example 3: Place a new order // $result = addOrder($API_URL, $API_KEY, 1, "https://example.com/profile", 1000); // print_r($result); // // Expected result: ["order" => 23501] // Example 4: Check order status // $result = getOrderStatus($API_URL, $API_KEY, 23501); // print_r($result); // // Expected result: // // ["charge" => "0.27819", "start_count" => "3572", "status" => "Partial", "remains" => "157", "currency" => "USD"]