POST /apiv2/address/rotate
ڈپازٹ ایڈریس کی تبدیلی (روٹیشن) کی درخواست کریں۔ موجودہ ڈپازٹ ایڈریس کو ایک نئے ایڈریس سے تبدیل کر دیا جائے گا۔ درخواست کو پروسیسنگ کی قطار میں رکھا جاتا ہے اور یہ 5 منٹ کے اندر خودکار طور پر مکمل ہو جاتی ہے۔
Endpoint کا URL
POST https://netts.io/apiv2/address/rotateدرخواست کے Headers
| ہیڈر | لازمی | تفصیل |
|---|---|---|
| Content-Type | ہاں | application/json |
| X-API-KEY | ہاں | آپ کی API کی Netts ڈیش بورڈ سے |
| X-Real-IP | ہاں | آپ کی وائٹ لسٹ سے IP ایڈریس |
درخواست کا Body
json
{
"user_id": 1234,
"address_type": "web"
}پیرامیٹرز
| پیرامیٹر | قسم | لازمی | طے شدہ | تفصیل |
|---|---|---|---|---|
| user_id | integer | نہیں | تصدیق شدہ صارف | ہدف صارف کی ID۔ اپنا ایڈریس تبدیل کرنے کے لیے اسے خالی چھوڑ دیں۔ پیرنٹ صارفین اپنے SUB-صارف کی ID درج کر سکتے ہیں |
| address_type | string | نہیں | "web" | تبدیل کرنے کے لیے ایڈریس کی قسم: web یا tg |
تصدیق اور اجازت
اس اینڈ پوائنٹ کے لیے تصدیق (authentication) اور اجازت (authorization) دونوں درکار ہیں:
- تصدیق: درست API کی + وائٹ لسٹ سے IP (دیگر اینڈ پوائنٹس کی طرح)
- اجازت:
- اپنا ایڈریس تبدیل کرنا — ہمیشہ اجازت ہے
- اپنے SUB-صارف کا ایڈریس تبدیل کرنا — پیرنٹ صارفین کے لیے اجازت ہے
- کسی دوسرے صارف کا ایڈریس تبدیل کرنا —
403 Forbiddenکے ساتھ مسترد کر دیا جائے گا
نمونہ درخواستیں
cURL
bash
# Rotate own address
curl -X POST https://netts.io/apiv2/address/rotate \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip" \
-d '{"address_type": "web"}'bash
# Rotate SUB-user's address (parent user only)
curl -X POST https://netts.io/apiv2/address/rotate \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip" \
-d '{"user_id": 1234, "address_type": "web"}'Python
python
import requests
url = "https://netts.io/apiv2/address/rotate"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "your_api_key",
"X-Real-IP": "your_whitelisted_ip"
}
# Rotate own address
response = requests.post(url, headers=headers, json={"address_type": "web"})
data = response.json()
if response.status_code == 200:
print(f"Rotation ID: {data['rotation_id']}")
print(f"Old Address: {data['old_address']}")
print(f"Status: {data['status']}")
print(f"Estimated Completion: {data['estimated_completion']}")
else:
print(f"Error: {data.get('detail', 'Unknown error')}")Node.js
javascript
const axios = require('axios');
async function rotateAddress(apiKey, whitelistedIp, addressType = 'web', userId = null) {
const url = 'https://netts.io/apiv2/address/rotate';
const body = { address_type: addressType };
if (userId) body.user_id = userId;
const response = await axios.post(url, body, {
headers: {
'Content-Type': 'application/json',
'X-API-KEY': apiKey,
'X-Real-IP': whitelistedIp
},
timeout: 30000
});
const data = response.data;
console.log(`Rotation ID: ${data.rotation_id}`);
console.log(`Status: ${data.status}`);
console.log(`Old Address: ${data.old_address}`);
return data;
}
// Rotate own address
rotateAddress('your_api_key', 'your_whitelisted_ip')
.then(result => console.log('Submitted:', result.message))
.catch(err => console.error('Error:', err.response?.data || err.message));PHP
php
<?php
$url = 'https://netts.io/apiv2/address/rotate';
$data = json_encode([
'address_type' => 'web'
]);
$options = [
'http' => [
'header' => implode("\r\n", [
"Content-Type: application/json",
"X-API-KEY: your_api_key",
"X-Real-IP: your_whitelisted_ip"
]),
'method' => 'POST',
'content' => $data,
'timeout' => 30
]
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$result = json_decode($response, true);
echo "Rotation ID: {$result['rotation_id']}\n";
echo "Old Address: {$result['old_address']}\n";
echo "Status: {$result['status']}\n";
echo "Message: {$result['message']}\n";
?>جواب
کامیاب جواب (200 OK)
json
{
"rotation_id": 42,
"user_id": 1234,
"address_type": "web",
"old_address": "TCurrentAddress1234567890123456789",
"status": "pending",
"message": "Address rotation request submitted. New address will be assigned within 5 minutes.",
"estimated_completion": "2026-03-14T12:35:00Z"
}جواب کے فیلڈز
| فیلڈ | قسم | تفصیل |
|---|---|---|
| rotation_id | integer | روٹیشن کی درخواست کی منفرد ID (حیثیت چیک کرنے کے لیے استعمال کریں) |
| user_id | integer | وہ صارف جس کا ایڈریس تبدیل کیا جا رہا ہے |
| address_type | string | ایڈریس کی قسم جو تبدیل کی جا رہی ہے (web یا tg) |
| old_address | string | تبدیلی سے پہلے کا موجودہ TRON ڈپازٹ ایڈریس |
| status | string | درخواست کی حیثیت: pending |
| message | string | پڑھنے کے قابل وضاحتی پیغام |
| estimated_completion | string | ISO 8601 فارمیٹ میں تکمیل کا متوقع وقت |
روٹیشن کی حیثیت چیک کریں
GET /apiv2/address/rotate/status/
پہلے سے جمع کرائی گئی روٹیشن کی درخواست کی حیثیت چیک کریں۔
bash
curl https://netts.io/apiv2/address/rotate/status/42 \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip"جواب:
json
{
"rotation_id": 42,
"user_id": 1234,
"address_type": "web",
"status": "completed",
"old_address": "TOldAddress1234567890123456789012",
"new_address": "TNewAddress1234567890123456789012",
"created_at": "2026-03-14T12:30:00Z",
"completed_at": "2026-03-14T12:34:15Z"
}حیثیت کی اقدار
| حیثیت | تفصیل |
|---|---|
pending | درخواست جمع کر دی گئی ہے، پروسیس ہونے کا انتظار ہے |
processing | فی الوقت پروسیس کی جا رہی ہے |
completed | نیا ایڈریس کامیابی کے ساتھ تفویض کر دیا گیا ہے |
failed | روٹیشن کے دوران خرابی پیش آ گئی |
زیر التواء روٹیشن چیک کریں
GET /apiv2/address/rotate/pending
چیک کریں کہ کیا کسی صارف کی روٹیشن کی درخواست زیر التواء ہے (روٹیشن بٹن کو غیر فعال کرنے کے لیے مفید ہے)۔
bash
curl "https://netts.io/apiv2/address/rotate/pending?address_type=web" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip"جواب:
json
{
"user_id": 1234,
"address_type": "web",
"has_pending": true,
"pending_rotation": {
"rotation_id": 42,
"status": "pending",
"created_at": "2026-03-14T12:30:00Z"
}
}اہم نکات
ایڈریس کی تبدیلی
روٹیشن مکمل ہونے کے بعد، آپ کا موجودہ ڈپازٹ ایڈریس مزید ڈپازٹس قبول نہیں کرے گا۔ یقینی بنائیں کہ:
- روٹیشن کی درخواست کرنے سے پہلے موجودہ ایڈریس سے تمام بقایا رقم نکال لیں
- کسی بھی ایسے بیرونی سسٹم کو اپ ڈیٹ کریں جو آپ کے پرانے ڈپازٹ ایڈریس کا حوالہ دیتا ہے
- مستقبل کے تمام ڈپازٹس کے لیے نیا ایڈریس استعمال کریں
پروسیسنگ کا وقت
روٹیشن کی درخواستیں خودکار طور پر پروسیس کی جاتی ہیں۔ عام طور پر درخواست جمع کرانے کے 5 منٹ کے اندر نیا ایڈریس تفویض کر دیا جاتا ہے۔
- 7 دن کی مدت کے اندر فی صارف فی ایڈریس کی قسم صرف ایک زیر التواء روٹیشن کی اجازت ہے
- اگر آپ کی پہلے ہی کوئی روٹیشن زیر التواء ہے، تو درخواست کو
409 Conflictکے ساتھ مسترد کر دیا جائے گا webاورtgدونوں ایڈریسز کو آزادانہ طور پر تبدیل کیا جا سکتا ہے- پیرنٹ صارفین
user_idپیرامیٹر فراہم کر کے اپنے SUB-صارفین کے ایڈریسز تبدیل کر سکتے ہیں
خرابی کے جوابات
Conflict (409)
json
{
"detail": "User 1234 already has a pending web address rotation request"
}Bad Request (400)
json
{
"detail": "User 1234 has no web deposit address"
}json
{
"detail": "address_type must be 'web' or 'tg'"
}Not Found (404)
json
{
"detail": "User 9999 not found"
}Forbidden (403)
json
{
"detail": "Not authorized to rotate this user's address"
}Authentication Error (401)
json
{
"detail": "X-API-KEY header required"
}خرابی کے کوڈز کا حوالہ
| HTTP حیثیت | تفصیل |
|---|---|
200 | روٹیشن کی درخواست کامیابی سے جمع کر دی گئی |
400 | غلط درخواست (کوئی ایڈریس نہیں، غلط قسم) |
401 | API کی کا ہیڈر موجود نہیں ہے |
403 | مجاز نہیں ہے / غلط API کی یا IP |
404 | صارف نہیں ملا / روٹیشن نہیں ملی |
409 | زیر التواء روٹیشن پہلے سے موجود ہے |
500 | اندرونی سرور کی خرابی |
متعلقہ اینڈ پوائنٹس
- POST /apiv2/subusergen — نیا SUB-صارف بنائیں
- DELETE /apiv2/subuserdel — ایک SUB-صارف حذف کریں
- GET /apiv2/userinfo — صارف کی معلومات حاصل کریں