FynxAPI hujjatlari
Telegram Stars, Premium, Gift, PUBG UC va virtual raqamlarni o‘z loyihangizdan soting. REST · JSON · UTF-8. Barcha summalar so‘mda.
Boshlash
1) Kabinetda ro‘yxatdan o‘ting. 2) Balansni to‘ldiring. 3) API kalit yarating. 4) So‘rovlarni o‘z serveringizdan yuboring.
Bazaviy manzil:
{{BASE}}
Muvaffaqiyatda {"ok":true,"result":{...}}, xatoda {"ok":false,"code":"...","message":"..."}. HTTP statusni ham tekshiring.
Autentifikatsiya
X-API-Key: SIZNING_KALITINGIZ # yoki Authorization: Bearer SIZNING_KALITINGIZ
Kalitni brauzer yoki mobil ilova ichiga yozmang. So‘rovlar faqat serveringizdan yuborilsin. Kalit sizib chiqsa, kabinetdan yangilang: eski kalit darhol ishlamay qoladi.
curl '{{BASE}}/balance' -H 'X-API-Key: SIZNING_KALITINGIZ'
Umumiy limit: daqiqasiga 120 so‘rov. Xaridlar: 10 soniyada 5 ta. 429 bo‘lsa Retry-After sarlavhasiga amal qiling.
Xavfsiz xarid (idempotency)
Har bir xarid so‘roviga noyob X-Idempotency-Key yuboring (1–128 belgi: A-Z a-z 0-9 . _ : -). Tarmoq uzilsa, aynan o‘sha kalit va parametrlar bilan qayta yuboring: pul ikki marta yechilmaydi, avvalgi natija qaytadi. Kalit boshqa parametrlar bilan ishlatilsa, IDEMPOTENCY_CONFLICT keladi.
REQUEST_IN_PROGRESS kelsa, yangi xarid yubormang: javobdagi order_id bilan GET /order/{id} orqali holatni tekshiring.
Umumiy
GET/pricing (kalitsiz)
{"ok":true,"result":{
"stars":{"unit_uzs":201.96,"min_amount":50,"max_amount":1000000},
"premium":[{"months":3,"price_uzs":162000},{"months":6,"price_uzs":216000},{"months":12,"price_uzs":383292}],
"gift":{"list_endpoint":"/gifts"},"uc":{"list_endpoint":"/uc/tariffs"},"numbers":{"list_endpoint":"/numbers/countries"}}}
GET/balance
{"ok":true,"result":{"user_id":"tg123456","balance_uzs":500000,"balance_text":"500 000"}}
POST/getInfo
Telegram username mavjudligini tekshiradi.
curl -X POST '{{BASE}}/getInfo' -H 'X-API-Key: KEY' -H 'Content-Type: application/json' -d '{"username":"durov"}'
Stars va Premium
POST/stars/buy
| Parametr | Turi | Izoh |
|---|---|---|
| username | string | Majburiy. 4–32 belgi, @ bilan yoki usiz. |
| amount | integer | Majburiy. 50 dan 1 000 000 gacha. |
curl -X POST '{{BASE}}/stars/buy' \
-H 'X-API-Key: KEY' -H 'X-Idempotency-Key: stars-20261022-0001' \
-H 'Content-Type: application/json' \
-d '{"username":"durov","amount":100}'
{"ok":true,"result":{"order_id":"5f1c0a...","status":"success","cost_uzs":20196,"balance_uzs":479804,"username":"durov","amount":100}}
POST/premium/buy
| Parametr | Turi | Izoh |
|---|---|---|
| username | string | Majburiy. |
| duration | integer | Majburiy. Faqat 3, 6 yoki 12 (oy). |
Gift
GET/gifts
Mavjud sovg‘alar va narxlar. Katalogni xarid oldidan oling.
{"ok":true,"result":[{"gift_id":"5170233102089322756","title":"Bear","emoji":"🧸","stars":15,"price_uzs":3110,"purchasable":true}]}
POST/gift/buy
| Parametr | Turi | Izoh |
|---|---|---|
| username | string | Majburiy. |
| gift_id | string | Majburiy. /gifts dagi ID. |
| comment | string | Ixtiyoriy, 128 belgigacha. |
| anonymous | boolean | Ixtiyoriy. |
PUBG Mobile UC
GET/uc/tariffs
{"ok":true,"result":{"tariffs":[{"tariff_id":9,"uc_amount":660,"bonus_uc":60,"total_uc":720,"price_uzs":141610,"currency":"UZS"}],"currency":"UZS"}}
POST/uc/buy
| Parametr | Turi | Izoh |
|---|---|---|
| account_id | string | Majburiy. 6–12 xonali PUBG ID. |
| tariff_id | integer | Majburiy. /uc/tariffs dagi ID. |
Virtual raqam
GET/numbers/countries?server=1|2|3
{"ok":true,"result":[{"code":"UZ","name":"O‘zbekiston","server":1,"price_uzs":9575}]}
POST/numbers/buy
| Parametr | Turi | Izoh |
|---|---|---|
| country_code | string | Majburiy. Ikki harf: UZ, RU, US. |
| server | integer | Ixtiyoriy. Yuborilmasa eng arzon server tanlanadi. |
{"ok":true,"result":{"order_id":"5f1c0a...","status":"success","cost_uzs":9575,"balance_uzs":470000,"country_code":"UZ","server":1,"phone":"+998901234567"}}
GET/numbers/code/{order_id}
SMS kodni oladi. Kod kelguncha status: "waiting", so‘ng "finished". 5–10 soniyada bir marta so‘rang.
{"ok":true,"result":{"order_id":"5f1c0a...","status":"finished","phone":"+998901234567","code":"12345","password":""}}
Buyurtmalar
GET/order/{order_id}
status: processing, success yoki failed. Xato bo‘lsa refunded:true bo‘lib, pul balansga qaytariladi.
GET/orders?limit=20
Oxirgi buyurtmalar (1–100).
Xatolar
| HTTP | Kod | Ma’nosi |
|---|---|---|
| 400 | VALIDATION_ERROR | Parametr noto‘g‘ri yoki xizmat mavjud emas. |
| 401 | UNAUTHORIZED | Kalit yo‘q yoki noto‘g‘ri. |
| 402 | INSUFFICIENT_BALANCE | Balans yetarli emas. Pul yechilmaydi. |
| 404 | ORDER_NOT_FOUND / NOT_FOUND | Buyurtma yoki endpoint topilmadi. |
| 409 | IDEMPOTENCY_CONFLICT | Kalit boshqa parametrlar bilan ishlatilgan. |
| 409 | REQUEST_IN_PROGRESS | Natija aniq emas. Yangi xarid yubormang, /order/{id} ni tekshiring. |
| 429 | RATE_LIMITED | So‘rovlar ko‘p. Retry-After ni kuting. |
| 502/503 | PROVIDER_ERROR / SERVICE_UNAVAILABLE | Xizmat xatosi. refunded:true bo‘lsa pul qaytarilgan. |
{"ok":false,"code":"INSUFFICIENT_BALANCE","message":"Balans yetarli emas. Kerak: 20 196 so'm, mavjud: 10 000 so'm","refunded":false}
Misol (PHP)
$ch = curl_init('{{BASE}}/stars/buy');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180,
CURLOPT_HTTPHEADER => ['X-API-Key: KEY', 'X-Idempotency-Key: ' . $orderId, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['username' => 'durov', 'amount' => 100]),
]);
$res = json_decode(curl_exec($ch), true);
Timeoutni kamida 180 soniya qiling: ba’zi xizmatlar ko‘proq vaqt oladi.