Orders
Options like product_id, location_id, and more can be retrieved using the Products endpoint.
Get Orders
GET
/orders
Query Parameters
Example request:
curl -X GET "https://apid.iproyal.com/v1/reseller/orders?product_id=123&page=1&per_page=10&location_id=456&status=in-progress¬e_search=example%20note&order_ids=789,1011" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json"
<?php
$api_token = '<your_access_token>';
$params = [
'product_id' => 123,
'page' => 1,
'per_page' => 10,
'location_id' => 456,
'status' => 'in-progress',
'note_search' => 'example note',
'order_ids' => [789, 1011]
];
$query = http_build_query($params);
$url = "https://apid.iproyal.com/v1/reseller/orders?$query";
$options = [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-Access-Token: $api_token",
'Content-Type: application/json'
]
];
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>
import requests
api_token = '<your_access_token>'
params = {
'product_id': 123,
'page': 1,
'per_page': 10,
'location_id': 456,
'status': 'in-progress',
'note_search': 'example note',
'order_ids': '789,1011'
}
url = 'https://apid.iproyal.com/v1/reseller/orders'
headers = {
'X-Access-Token': api_token,
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers, params=params)
print(response.status_code)
print(response.json())
const https = require('https');
const api_token = '<your_access_token>';
const params = new URLSearchParams({
product_id: 123,
page: 1,
per_page: 10,
location_id: 456,
status: 'in-progress',
note_search: 'example note',
order_ids: [789, 1011].join(',')
}).toString();
const options = {
hostname: 'apid.iproyal.com',
path: `/v1/reseller/orders?${params}`,
method: 'GET',
headers: {
'X-Access-Token': api_token,
'Content-Type': 'application/json'
}
};
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
console.log(responseData);
});
});
req.on('error', (error) => {
console.error('Error:', error.message);
});
req.end();
Example response:
{
"data": [
{
"id": 420,
"note": null,
"product_name": "Static Residential",
"expire_date": "2024-04-20 10:25:12",
"plan_name": "30 Days",
"status": "confirmed",
"location": "United States",
"quantity": 5,
"questions_answers": [
{
"question": "Extra requirements (if you have any):",
"answer": "I need 128.158.97"
}
],
"proxy_data": {
"ports": {
"socks5": 12324,
"http|https": 12323
},
"proxies": []
},
"auto_extend_settings": null,
"extended_history": []
},
...
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"path": "https://apid.iproyal.com/v1/reseller/orders",
"per_page": 10,
"to": 10,
"total": 14
}
}
Get Order
GET
/orders/{order_id}
Example request:
curl -X GET "https://apid.iproyal.com/v1/reseller/orders/12345" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json"
<?php
$api_token = '<your_access_token>';
$order_id = 12345;
$url = "https://apid.iproyal.com/v1/reseller/orders/$order_id";
$options = [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-Access-Token: $api_token",
'Content-Type: application/json'
]
];
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>
import requests
api_token = '<your_access_token>'
order_id = 12345
url = f'https://apid.iproyal.com/v1/reseller/orders/{order_id}'
headers = {
'X-Access-Token': api_token,
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
const https = require('https');
const api_token = '<your_access_token>';
const order_id = 12345;
const options = {
hostname: 'apid.iproyal.com',
path: `/v1/reseller/orders/${order_id}`,
method: 'GET',
headers: {
'X-Access-Token': api_token,
'Content-Type': 'application/json'
}
};
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
console.log(responseData);
});
});
req.on('error', (error) => {
console.error('Error:', error.message);
});
req.end();
Example response:
{
"id": 420,
"note": null,
"product_name": "Static Residential",
"expire_date": "2024-04-20 10:25:12",
"plan_name": "30 Days",
"status": "expired",
"location": "Canada",
"quantity": 5,
"questions_answers": [],
"proxy_data": {
"ports": {
"socks5": 12324,
"http|https": 12323
},
"proxies": []
},
"auto_extend_settings": null,
"extended_history": []
}
Calculate Pricing
GET
/orders/calculate-pricing
Query Parameters
Example request:
curl -X GET "https://apid.iproyal.com/v1/reseller/orders/calculate-pricing?product_id=123&product_plan_id=456&product_location_id=789&quantity=10&coupon_code=DISCOUNT2024" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json"
<?php
$api_token = '<your_access_token>';
$params = [
'product_id' => 123,
'product_plan_id' => 456,
'product_location_id' => 789,
'quantity' => 10,
'coupon_code' => 'DISCOUNT2024'
];
$query = http_build_query($params);
$url = "https://apid.iproyal.com/v1/reseller/orders/calculate-pricing?$query";
$options = [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-Access-Token: $api_token",
'Content-Type: application/json'
]
];
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>
import requests
api_token = '<your_access_token>'
params = {
'product_id': 123,
'product_plan_id': 456,
'product_location_id': 789,
'quantity': 10,
'coupon_code': 'DISCOUNT2024'
}
url = 'https://apid.iproyal.com/v1/reseller/orders/calculate-pricing'
headers = {
'X-Access-Token': api_token,
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers, params=params)
print(response.status_code)
print(response.json())
const https = require('https');
const api_token = '<your_access_token>';
const params = new URLSearchParams({
product_id: 123,
product_plan_id: 456,
product_location_id: 789,
quantity: 10,
coupon_code: 'DISCOUNT2024'
}).toString();
const options = {
hostname: 'apid.iproyal.com',
path: `/v1/reseller/orders/calculate-pricing?${params}`,
method: 'GET',
headers: {
'X-Access-Token': api_token,
'Content-Type': 'application/json'
}
};
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
console.log(responseData);
});
});
req.on('error', (error) => {
console.error('Error:', error.message);
});
req.end();
Example response:
{
"pre_discount_price": 30,
"price_with_vat": 30,
"vat": null,
"price": 30,
"pre_discount_price_per_item": 3,
"price_per_item": 3,
"plan_discount_percent": 0,
"location_discount_percent": 0,
"coupon_discount_percent": 0,
"quantity_discount_percent": 0,
"total_discount_percent": 0,
"quantity_required_for_next_discount": {
"quantity": 90,
"discount": 5
},
"message": null
}
Create Order
POST
/orders
Body Parameters:
Example request:
curl -X POST "https://apid.iproyal.com/v1/reseller/orders" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"product_id": 123,
"product_plan_id": 456,
"product_location_id": 789,
"quantity": 10,
"coupon_code": "DISCOUNT2024",
"auto_extend": true,
"product_question_answers": {
"question_id_1": "answer_1",
"question_id_2": "answer_2"
}
}'
<?php
$api_token = '<your_access_token>';
$url = "https://apid.iproyal.com/v1/reseller/orders";
$data = [
'product_id' => 123,
'product_plan_id' => 456,
'product_location_id' => 789,
'quantity' => 10,
'coupon_code' => 'DISCOUNT2024',
'auto_extend' => true,
'product_question_answers' => [
'question_id_1' => 'answer_1',
'question_id_2' => 'answer_2'
]
];
$options = [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-Access-Token: $api_token",
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode($data)
];
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>
import requests
api_token = '<your_access_token>'
url = 'https://apid.iproyal.com/v1/reseller/orders'
data = {
'product_id': 123,
'product_plan_id': 456,
'product_location_id': 789,
'quantity': 10,
'coupon_code': 'DISCOUNT2024',
'auto_extend': True,
'product_question_answers': {
'question_id_1': 'answer_1',
'question_id_2': 'answer_2'
}
}
headers = {
'X-Access-Token': api_token,
'Content-Type': 'application/json'
}
response = requests.post(url, json=data, headers=headers)
print(response.status_code)
print(response.json())
const https = require('https');
const api_token = '<your_access_token>';
const data = JSON.stringify({
product_id: 123,
product_plan_id: 456,
product_location_id: 789,
quantity: 10,
coupon_code: 'DISCOUNT2024',
auto_extend: true,
product_question_answers: {
question_id_1: 'answer_1',
question_id_2: 'answer_2'
}
});
const options = {
hostname: 'apid.iproyal.com',
path: '/v1/reseller/orders',
method: 'POST',
headers: {
'X-Access-Token': api_token,
'Content-Type': 'application/json',
'Content-Length': data.length
}
};
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
console.log(responseData);
});
});
req.on('error', (error) => {
console.error('Error:', error.message);
});
req.write(data);
req.end();
Example response:
{
"id": 420,
"note": null,
"product_name": "Static Residential",
"plan_name": "30 Days",
"expire_date": "2024-04-20 10:25:12",
"status": "expired",
"location": "Canada",
"quantity": 5,
"questions_answers": [],
"proxy_data": {
"ports": {
"socks5": 12324,
"http|https": 12323
},
"proxies": []
},
"auto_extend_settings": null,
"extended_history": []
}
Extend Order
POST
/orders/{order_id}/extend
Body Parameters
Example request:
curl -X POST "https://apid.iproyal.com/v1/reseller/orders/12345/extend" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"product_plan_id": 678
}'
<?php
$api_token = '<your_access_token>';
$order_id = 12345;
$product_plan_id = 678;
$url = "https://apid.iproyal.com/v1/reseller/orders/$order_id/extend";
$data = [
'product_plan_id' => $product_plan_id
];
$options = [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-Access-Token: $api_token",
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode($data)
];
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>
import requests
api_token = '<your_access_token>'
order_id = 12345 # pakeiskite su tikru order_id
url = f'https://apid.iproyal.com/v1/reseller/orders/{order_id}/extend'
data = {
'product_plan_id': 678 # pakeiskite su tikru product_plan_id
}
headers = {
'X-Access-Token': api_token,
'Content-Type': 'application/json'
}
response = requests.post(url, json=data, headers=headers)
print(response.status_code)
print(response.json())
const https = require('https');
const api_token = '<your_access_token>';
const order_id = 12345;
const data = JSON.stringify({
product_plan_id: 678
});
const options = {
hostname: 'apid.iproyal.com',
path: `/v1/reseller/orders/${order_id}/extend`,
method: 'POST',
headers: {
'X-Access-Token': api_token,
'Content-Type': 'application/json',
'Content-Length': data.length
}
};
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
console.log(responseData);
});
});
req.on('error', (error) => {
console.error('Error:', error.message);
});
req.write(data);
req.end();
Example response:
{
"id": 420,
"note": null,
"product_name": "Static Residential",
"plan_name": "30 Days",
"expire_date": "2024-04-20 10:25:12",
"status": "expired",
"location": "Canada",
"quantity": 5,
"questions_answers": [],
"proxy_data": {
"ports": {
"socks5": 12324,
"http|https": 12323
},
"proxies": []
},
"auto_extend_settings": null,
"extended_history": []
}
Last updated