Proxy Sale
  • Introduction
  • Getting Started
  • API Reference
    • Balance
      • Get Balance
      • Add Balance
      • Pay Methods
    • Proxies
      • List Proxies
      • Download Proxies
      • Set Proxy Comments
    • Order
      • Reference List
      • Calculate Order
      • Create Order
    • Renewal
      • Calculate Renewal
      • Create Renewal Order
    • Residential Proxies
      • Package Info
      • Download Geo
      • Get IP Lists
      • Create IP List
      • Rename IP List
      • Delete IP List
      • API-TOOL
  • Users Links
    • FAQ
    • Blog
  • Support
    • support@proxy-sale.com
    • Telegram
Powered by GitBook
On this page
  1. API Reference
  2. Renewal

Calculate Renewal

POST https://proxy-sale.com/personal/api/v1/{apiKey}/prolong/calc/{type}

Find out how much it will cost to renew your proxies with this endpoint. It gives you an estimate based on the proxy type and renewal period you choose.

Headers

Name
Value

Content-Type

application/json

Accept

application/json

Path parameters

Name
Type
Description

apiKey*

string

API key to authorize requests

type*

string

Available values : ipv4, ipv6, mobile, isp, resident

Body parameters

Name
Type
Description

ids*

array of integers

IDs of the proxies you want to renew. Ensure that the proxy type of the provided IDs matches the "type" path parameter.

periodId*

string

Request examples

curl -X 'POST' \
  'https://proxy-sale.com/personal/api/v1/YOUR_API_KEY_HERE/prolong/calc/mobile' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "ids": [
    105487,
    458746,
    354841,
    845123,
    103547
  ],
  "periodId": "30d",
  "coupon": "OZGCNK_1"
}'
<?php

$apiKey = "YOUR_API_KEY_HERE";
$url = "https://proxy-sale.com/personal/api/v1/$apiKey/prolong/calc/mobile";
$data = array(
    "ids" => [105487, 458746, 354841, 845123, 103547],
    "periodId" => "30d",
    "coupon" => "OZGCNK_1"
);
$data_string = json_encode($data);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Accept: application/json',
    'Content-Type: application/json'
));

$result = curl_exec($ch);
curl_close($ch);

echo $result;

?>
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class ProlongCalcExample {
    public static void main(String[] args) {
        String apiKey = "YOUR_API_KEY_HERE";
        String url = "https://proxy-sale.com/personal/api/v1/" + apiKey + "/prolong/calc/mobile";
        String data = "{\"ids\": [105487, 458746, 354841, 845123, 103547], \"periodId\": \"30d\", \"coupon\": \"OZGCNK_1\"}";

        try {
            URL obj = new URL(url);
            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");

            con.setDoOutput(true);
            DataOutputStream wr = new DataOutputStream(con.getOutputStream());
            wr.writeBytes(data);
            wr.flush();
            wr.close();

            int responseCode = con.getResponseCode();
            System.out.println("Response Code: " + responseCode);

            BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
            String inputLine;
            StringBuffer response = new StringBuffer();

            while ((inputLine = in.readLine()) != null) {
                response.append(inputLine);
            }
            in.close();

            System.out.println("Response Body: " + response.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Response examples

If you receive a "warning" in the response, please fix the issue mentioned before making your order.

{
  "status": "success",
  "data": {
    "warning": "Insufficient funds. Total $2. Not enough $33.10",
    "balance": 2,
    "total": 35.1,
    "quantity": 5,
    "currency": "USD",
    "discount": 0.22,
    "items": [
      {
        "id": 10,
        "order_id": 1000000,
        "ip": "127.0.0.1",
        "port_http": 80,
        "port_socks": 443,
        "login": "login",
        "password": "password",
        "auth_ip": "127.0.0.2",
        "country": "USA",
        "date_start": "d.m.Y H:i:s",
        "date_end": "d.m.Y H:i:s",
        "comment": "d.m.Y H:i:s",
        "status": "ACTIVE",
        "rotation": "5",
        "link_reboot": "https://proxy-sale.com/api/proxy/reboot?token=12345",
        "can_prolong": true
      }
    ],
    "orders": 2
  },
  "errors": []
}
{
  "status": "error",
  "data": null,
  "errors": [
    {
      "message": "IP not found",
      "code": 0,
      "customData": null
    }
  ]
}
PreviousRenewalNextCreate Renewal Order

Last updated 1 year ago

How long you want to renew your proxies for, as identified in the (e.g., "30d" for 30 days).

reference list