Calculate order
This endpoint calculates the cost of an order based on the specified proxy configurations, which you can obtain from the reference list. It is designed to provide you with an estimate before finalizing the purchase, aiding in your planning and budgeting for proxy needs.
Headers
Name | Value |
|---|---|
Content-Type |
|
Path Parameters
Name | Type | Description |
|---|---|---|
| string | API key to authorize requests |
Body parameters
Name | Type | For Proxy Type | Description |
|---|---|---|---|
| string | All | Optional promotional code for discounts. |
| integer | IPV4, IPV6, ISP, Mobile | Country ID for the proxy location. |
| string | All | Duration for proxy rental, e.g., "30d" for 30 days. |
| integer | IPV4, IPV6, ISP, Mobile | Number of proxies required. |
| string | IPV4, IPV6, ISP, Mobile | IP address for authorization (optional). |
| integer | IPV4, ISP, Resident | Section ID for specific proxy targets (optional). |
| integer | IPV4, ISP, Resident | ID of the target website or service, 0 for custom. |
| string | IPV4, ISP, IPV6*, Resident | Name of the custom target, used when targetId is 0. |
| string | IPV6, potentially others | Proxy protocol (HTTPS/SOCKS5). |
| string | Mobile | Operator ID for mobile proxies. |
| integer | Mobile | Rotation settings for mobile proxies. |
| integer | Resident | Tariff ID for resident proxies. |
Request examples
curl -X 'POST' \
'https://geonix.com/personal/api/v1/YOUR_API_KEY_HERE/order/calc' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"coupon": "OZGCNK_1",
"countryId": 3350393,
"periodId": "30d",
"quantity": 5,
"authorization": "127.0.0.1",
"targetSectionId": 99,
"targetId": 0,
"customTargetName": "Another target"
}'<?php
$url = 'https://geonix.com/personal/api/v1/YOUR_API_KEY_HERE/order/calc';
$data = array(
'coupon' => 'OZGCNK_1',
'countryId' => 3350393,
'periodId' => '30d',
'quantity' => 5,
'authorization' => '127.0.0.1',
'targetSectionId' => 99,
'targetId' => 0,
'customTargetName' => 'Another target'
);
$payload = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($payload)
));
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class CalcOrderExample {
public static void main(String[] args) {
try {
URL url = new URL("https://geonix.com/personal/api/v1/YOUR_API_KEY_HERE/order/calc");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("accept", "application/json");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
String input = "{\"coupon\": \"OZGCNK_1\",\"countryId\": 3350393,\"periodId\": \"30d\",\"quantity\": 5,\"authorization\": \"127.0.0.1\",\"targetSectionId\": 99,\"targetId\": 0,\"customTargetName\": \"Another target\"}";
try (OutputStream os = conn.getOutputStream()) {
byte[] inputBytes = input.getBytes("utf-8");
os.write(inputBytes, 0, inputBytes.length);
}
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String output;
while ((output = br.readLine()) != null) {
System.out.println(output);
}
conn.disconnect();
} 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": {
"price": 1.8,
"warning": "Insufficient funds. Total $4.38. Not enough $4.62",
"balance": 4.38,
"total": 9,
"quantity": 5,
"currency": "USD",
"discount": 0
},
"errors": []
}