راهنمای توسعهدهندگان (API)
با استفاده از این وبسرویس میتوانید سایت یا ربات تلگرامی خود را به سیستم فروش شماره مجازی ما متصل کنید.
آدرس پایه (Base URL):
https://p.vavino.ir/wp-json/vn/v1/reseller
🔐 احراز هویت (Authentication)
برای تمام درخواستها باید API Key خود را ارسال کنید. کلید خود را میتوانید از پنل کاربری دریافت کنید.
شما میتوانید کلید را به دو روش ارسال کنید (روش Header پیشنهاد میشود):
Authorization: Bearer YOUR_API_KEY
?api_key=YOUR_API_KEY
GET
/prices
دریافت لیست کامل قیمتها
این متد لیست تمام سرویسها و قیمتهای بهروز را برمیگرداند. پیشنهاد میشود این لیست را هر ۱۰ دقیقه یکبار در سیستم خود کش کنید.
curl --location --request GET 'https://p.vavino.ir/wp-json/vn/v1/reseller/prices' \
--header 'Authorization: Bearer YOUR_API_KEY'
'https://p.vavino.ir/wp-json/vn/v1/reseller/prices',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://p.vavino.ir/wp-json/vn/v1/reseller/prices"
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
const axios = require('axios');
let config = {
method: 'get',
url: 'https://p.vavino.ir/wp-json/vn/v1/reseller/prices',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
نمونه پاسخ موفق:
{
"_meta": {
"updated_at": "2025-12-25 15:51:34",
"timestamp": 1766665294,
"currency": "IRT",
"strategy": "priority"
},
"services": {
"telegram": [
{
"id": 1450,
"country": "ec",
"country_name": "اکوادور",
"flag": "https://kandopanel.local/wp-content/plugins/wp-numbers-pro/assets/images/flags/flag_ec.png",
"price": 38400,
"count": 18,
"operator": "any"
},
{
"id": 1451,
"country": "do",
"country_name": "جمهوری دومینیکن",
"flag": "https://kandopanel.local/wp-content/plugins/wp-numbers-pro/assets/images/flags/flag_do.png",
"price": 96840,
"count": 272,
"operator": "any"
},
]
}
}
GET
/balance
دریافت موجودی حساب
نمایش موجودی کیف پول کاربر نماینده.
curl --location --request GET 'https://p.vavino.ir/wp-json/vn/v1/reseller/balance' \
--header 'Authorization: Bearer YOUR_API_KEY'
'https://p.vavino.ir/wp-json/vn/v1/reseller/balance',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://p.vavino.ir/wp-json/vn/v1/reseller/balance"
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
const axios = require('axios');
let config = {
method: 'get',
url: 'https://p.vavino.ir/wp-json/vn/v1/reseller/balance',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
نمونه پاسخ موفق:
{
"success": true,
"balance": 150000,
"currency": "IRT"
}
POST
/buy
خرید شماره (ثبت سفارش)
درخواست خرید یک شماره جدید. مبلغ به صورت آنی از کیف پول کسر میشود.
پارامترهای ورودی:
| پارامتر | توضیحات |
|---|---|
sid |
شناسه عددی محصول (ID) - این عدد را از فیلد id در لیست قیمتها بگیرید (مثلاً 1450). |
curl --location --request POST 'https://p.vavino.ir/wp-json/vn/v1/reseller/buy' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'sid=VALUE'
'https://p.vavino.ir/wp-json/vn/v1/reseller/buy',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(array('sid' => 'VALUE')),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://p.vavino.ir/wp-json/vn/v1/reseller/buy"
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
payload = {'sid': 'VALUE'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let config = {
method: 'post',
url: 'https://p.vavino.ir/wp-json/vn/v1/reseller/buy',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
data: { sid: 'VALUE' }
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
نمونه پاسخ موفق:
{
"success": true,
"id": 1450,
"phone": "+79123456789",
"price": 5000
}
نمونه خطا:
{
"code": "purchase_failed",
"message": "موجودی کیف پول کافی نیست.",
"data": { "status": 400 }
}
GET
/getcode
دریافت کد پیامک
بررسی وضعیت دریافت پیامک. این متد را باید هر ۵ ثانیه صدا بزنید تا کد دریافت شود.
پارامترهای ورودی:
| پارامتر | توضیحات |
|---|---|
id |
شناسه عددی سفارش (Order ID) که در مرحله خرید دریافت کردید. |
curl --location --request GET 'https://p.vavino.ir/wp-json/vn/v1/reseller/getcode' \
--header 'Authorization: Bearer YOUR_API_KEY'
'https://p.vavino.ir/wp-json/vn/v1/reseller/getcode?id=VALUE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://p.vavino.ir/wp-json/vn/v1/reseller/getcode"
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
params = {'id': 'VALUE'}
response = requests.request("GET", url, headers=headers, params=params)
print(response.text)
const axios = require('axios');
let config = {
method: 'get',
url: 'https://p.vavino.ir/wp-json/vn/v1/reseller/getcode',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
params: { id: 'VALUE' }
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
نمونه پاسخ موفق:
{
"success": true,
"code": "12345",
"status": "received"
}
نمونه خطا:
{
"success": false,
"status": "pending",
"msg": "در انتظار دریافت کد..."
}
POST
/cancel
لغو شماره
لغو سفارش قبل از دریافت کد. در صورت موفقیت، مبلغ به کیف پول برمیگردد.
پارامترهای ورودی:
| پارامتر | توضیحات |
|---|---|
id |
شناسه عددی سفارش. |
curl --location --request POST 'https://p.vavino.ir/wp-json/vn/v1/reseller/cancel' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'id=VALUE'
'https://p.vavino.ir/wp-json/vn/v1/reseller/cancel',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(array('id' => 'VALUE')),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://p.vavino.ir/wp-json/vn/v1/reseller/cancel"
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
payload = {'id': 'VALUE'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let config = {
method: 'post',
url: 'https://p.vavino.ir/wp-json/vn/v1/reseller/cancel',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
data: { id: 'VALUE' }
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
نمونه پاسخ موفق:
{
"success": true,
"msg": "سفارش لغو و مبلغ استرداد شد."
}