Donat24 API
O'z saytingiz yoki botingizdan Donat24 katalogini soting: katalog, buyurtma, holat.
Asosiy manzil https://donat24.uz/api/v1
Kalit sarlavhasi X-API-Key: d24_…
Chegara 120 / daqiqa
Kalit — kabinetdagi Sozlamalar sahifasidan olinadi. So'rovlarda X-API-Key sarlavhasi bilan yuboriladi.
IP oq ro'yxati — ixtiyoriy. Sozlamalarda IP qo'shsangiz, kalit faqat o'sha IP lardan ishlaydi; ro'yxat bo'sh bo'lsa cheklov qo'llanmaydi.
Chegara — daqiqada 120 so'rov.
To'lov — buyurtma ochilishi bilan pul balansdan yechiladi. Yetkazish darhol emas: paid → sending → delivered. Bajarilmasa refunded va pul balansga qaytariladi.
Tezkor boshlash
cURL Python PHP JavaScript
Nusxa curl https://donat24.uz/api/v1/games \
-H "X-API-Key: d24_..."
Do'kon Katalog Buyurtma
Do'kon
Hisob va balans
GET /me
Do'kon va balans
cURL Python PHP JavaScript
Nusxa curl https://donat24.uz/api/v1/me \
-H "X-API-Key: d24_..."
200 OK
{
"success": true,
"message": "",
"data": {
"user": {
"id": 7,
"name": "Samariddin",
"tg_id": "6728906399"
},
"wallet": {
"balance": 250000,
"currency": "UZS"
},
"api": {
"key_prefix": "d24_5fb99f85",
"ip_only": true,
"rate_limit_per_min": 120
}
}
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
403 IP oq ro'yxatda yo'q yoki hisob bloklangan
{
"success": false,
"message": "Bu IP (203.0.113.50) oq ro'yxatda yo'q.",
"error": "ip_blocked"
}
429 Daqiqadagi chegara oshdi
{
"success": false,
"message": "Daqiqadagi so'rov chegarasi (120) oshdi.",
"error": "rate_limit"
}
Katalog
O'yinlar va paketlar
GET /games
Faol o'yinlar
cURL Python PHP JavaScript
Nusxa curl https://donat24.uz/api/v1/games \
-H "X-API-Key: d24_..."
200 OK
{
"success": true,
"message": "",
"data": {
"games": [
{
"slug": "telegram-stars",
"name": "Telegram Stars",
"provider": "socapi",
"image_url": "string",
"id_type": "string",
"needs_server_id": true,
"available": true
}
]
}
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
GET /games/{slug}
O'yin va uning paketlari
Parametr Joyi Izoh
slugmajburiy path O'yin slug'i (/games dan)
cURL Python PHP JavaScript
Nusxa curl https://donat24.uz/api/v1/games/telegram-stars \
-H "X-API-Key: d24_..."
200 OK
{
"success": true,
"message": "",
"data": {
"game": {
"slug": "telegram-stars",
"name": "Telegram Stars",
"provider": "socapi",
"image_url": "string",
"id_type": "string",
"needs_server_id": true,
"available": true
},
"products": [
{
"id": 5084,
"name": "50 Stars",
"price_uzs": 11000,
"offer_id": "stars_50"
}
]
}
}
404 O'yin topilmadi
{
"success": false,
"message": "Bunday o'yin yo'q.",
"error": "no_game"
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
GET /games/{slug}/products
Faqat paketlar
Parametr Joyi Izoh
slugmajburiy path O'yin slug'i (/games dan)
cURL Python PHP JavaScript
Nusxa curl https://donat24.uz/api/v1/games/telegram-stars/products \
-H "X-API-Key: d24_..."
200 OK
{
"success": true,
"message": "",
"data": {
"products": [
{
"id": 5084,
"name": "50 Stars",
"price_uzs": 11000,
"offer_id": "stars_50"
}
]
}
}
404 O'yin topilmadi
{
"success": false,
"message": "Bunday o'yin yo'q.",
"error": "no_game"
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
GET /games/{slug}/products/{product_id}
Bitta paket
Parametr Joyi Izoh
slugmajburiy path O'yin slug'i (/games dan) product_idmajburiy path integer
cURL Python PHP JavaScript
Nusxa curl https://donat24.uz/api/v1/games/telegram-stars/products/5084 \
-H "X-API-Key: d24_..."
200 OK
{
"success": true,
"message": "",
"data": {
"product": {
"id": 5084,
"name": "50 Stars",
"price_uzs": 11000,
"offer_id": "stars_50"
}
}
}
404 O'yin yoki paket topilmadi
{
"success": false,
"message": "Bunday paket yo'q.",
"error": "no_product"
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
Buyurtma
Tekshirish, berish, holat
POST /games/{slug}/validate-player
O'yinchi ID / username tekshiruvi
Buyurtmadan oldin chaqiring — noto'g'ri qabul qiluvchiga pul ketmaydi.
Parametr Joyi Izoh
slugmajburiy path O'yin slug'i (/games dan)
JSON maydon Tur Izoh
player_idmajburiy string Telegram username (@ siz) yoki o'yin ichidagi ID server_idstring Faqat needs_server_id=true o'yinlarda (Mobile Legends): Server/Zone ID
cURL Python PHP JavaScript
Nusxa curl -X POST https://donat24.uz/api/v1/games/telegram-stars/validate-player \
-H "X-API-Key: d24_..." \
-H "Content-Type: application/json" \
-d '{
"player_id": "durov",
"server_id": "1234"
}'
200 Tekshiruv natijasi
{
"success": true,
"message": "",
"data": {
"valid": true,
"username": "durov",
"is_premium": false
}
}
422 Ma'lumot noto'g'ri yoki bu o'yinda tekshiruv yo'q
{
"success": false,
"message": "Telegram username noto'g'ri.",
"error": "bad_username"
}
503 Tekshiruv xizmati javob bermadi
{
"success": false,
"message": "Tekshiruv xizmati javob bermadi.",
"error": "upstream"
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
403 IP oq ro'yxatda yo'q yoki hisob bloklangan
{
"success": false,
"message": "Bu IP (203.0.113.50) oq ro'yxatda yo'q.",
"error": "ip_blocked"
}
429 Daqiqadagi chegara oshdi
{
"success": false,
"message": "Daqiqadagi so'rov chegarasi (120) oshdi.",
"error": "rate_limit"
}
POST /games/{slug}/order
Buyurtma berish
Pul darhol balansdan yechiladi. client_ref yuborsangiz so'rov idempotent bo'ladi: bir xil client_ref bilan qayta yuborilsa yangi buyurtma ochilmaydi, javobda duplicate: true qaytadi. Yubormasangiz — takroriy so'rov ikkinchi buyurtma ochadi.
Parametr Joyi Izoh
slugmajburiy path O'yin slug'i (/games dan)
JSON maydon Tur Izoh
product_idmajburiy integer /products dan olingan id player_idmajburiy string Telegram username (Stars/Premium) yoki o'yinchi ID. Kanal/bot username'i qabul qilinmaydi. server_idstring needs_server_id=true o'yinlarda majburiy (Mobile Legends): Server/Zone ID, faqat raqam client_refstring Sizning buyurtma raqamingiz — idempotentlik kaliti webhook_urlstring Yakuniy holat shu manzilga POST qilinadi. Faqat https://, bir marta yuboriladi.
cURL Python PHP JavaScript
Nusxa curl -X POST https://donat24.uz/api/v1/games/telegram-stars/order \
-H "X-API-Key: d24_..." \
-H "Content-Type: application/json" \
-d '{
"product_id": 5084,
"player_id": "monk",
"server_id": "1234",
"client_ref": "MY-1001",
"webhook_url": "https://sayt.uz/donat24/webhook"
}'
201 Buyurtma qabul qilindi
{
"success": true,
"message": "",
"data": {
"order": {
"order_id": "LS-AB12CD",
"client_ref": "MY-1001",
"game": "Telegram Stars",
"product": "50 Stars",
"product_id": 5084,
"player_id": "durov",
"server_id": "string",
"status": "paid",
"price_uzs": 11000,
"error": "string",
"created_at": "string",
"delivered_at": "string"
}
}
}
200 Shu client_ref bilan buyurtma allaqachon bor (duplicate)
{
"success": true,
"message": "",
"data": {
"order": {
"order_id": "LS-AB12CD",
"client_ref": "MY-1001",
"game": "Telegram Stars",
"product": "50 Stars",
"product_id": 5084,
"player_id": "durov",
"server_id": "string",
"status": "paid",
"price_uzs": 11000,
"error": "string",
"created_at": "string",
"delivered_at": "string"
},
"duplicate": true
}
}
402 Balans yetarli emas — buyurtma `new` holatida qoladi
{
"success": false,
"message": "Balansda mablag' yetarli emas.",
"error": "insufficient_balance"
}
422 product_id yoki player_id noto'g'ri
{
"success": false,
"message": "product_id noto'g'ri.",
"error": "no_product"
}
404 O'yin topilmadi
{
"success": false,
"message": "Bunday o'yin yo'q.",
"error": "no_game"
}
503 Bu o'yin API orqali yetkazilmaydi (no_delivery) yoki username tekshiruvi javob bermadi (upstream) — tekshiruvsiz buyurtma ochilmaydi
{
"success": false,
"message": "Bu o'yin hozircha API orqali yetkazilmaydi.",
"error": "no_delivery"
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
403 IP oq ro'yxatda yo'q yoki hisob bloklangan
{
"success": false,
"message": "Bu IP (203.0.113.50) oq ro'yxatda yo'q.",
"error": "ip_blocked"
}
429 Daqiqadagi chegara oshdi
{
"success": false,
"message": "Daqiqadagi so'rov chegarasi (120) oshdi.",
"error": "rate_limit"
}
GET /orders
Buyurtmalar ro'yxati
Parametr Joyi Izoh
limitquery integer
cURL Python PHP JavaScript
Nusxa curl https://donat24.uz/api/v1/orders \
-H "X-API-Key: d24_..."
200 OK
{
"success": true,
"message": "",
"data": {
"orders": [
{
"order_id": "LS-AB12CD",
"client_ref": "MY-1001",
"game": "Telegram Stars",
"product": "50 Stars",
"product_id": 5084,
"player_id": "durov",
"server_id": "string",
"status": "paid",
"price_uzs": 11000,
"error": "string",
"created_at": "string",
"delivered_at": "string"
}
]
}
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
GET /orders/{order_id}
Bitta buyurtma holati
Parametr Joyi Izoh
order_idmajburiy path string
cURL Python PHP JavaScript
Nusxa curl https://donat24.uz/api/v1/orders/LS-AB12CD \
-H "X-API-Key: d24_..."
200 OK
{
"success": true,
"message": "",
"data": {
"order": {
"order_id": "LS-AB12CD",
"client_ref": "MY-1001",
"game": "Telegram Stars",
"product": "50 Stars",
"product_id": 5084,
"player_id": "durov",
"server_id": "string",
"status": "paid",
"price_uzs": 11000,
"error": "string",
"created_at": "string",
"delivered_at": "string"
}
}
}
404 Buyurtma topilmadi
{
"success": false,
"message": "Buyurtma topilmadi.",
"error": "no_order"
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
POST /games/{slug}/order/status
O'yin bo'yicha buyurtma holati
Buyurtma shu o'yinga tegishli bo'lmasa 404 qaytadi. O'yin nomini bilmasangiz /orders/status dan foydalaning.
Parametr Joyi Izoh
slugmajburiy path O'yin slug'i (/games dan)
JSON maydon Tur Izoh
order_idmajburiy string
cURL Python PHP JavaScript
Nusxa curl -X POST https://donat24.uz/api/v1/games/telegram-stars/order/status \
-H "X-API-Key: d24_..." \
-H "Content-Type: application/json" \
-d '{
"order_id": "LS-AB12CD"
}'
200 OK
{
"success": true,
"message": "",
"data": {
"order": {
"order_id": "LS-AB12CD",
"client_ref": "MY-1001",
"game": "Telegram Stars",
"product": "50 Stars",
"product_id": 5084,
"player_id": "durov",
"server_id": "string",
"status": "paid",
"price_uzs": 11000,
"error": "string",
"created_at": "string",
"delivered_at": "string"
}
}
}
404 Buyurtma topilmadi yoki boshqa o'yinga tegishli
{
"success": false,
"message": "Buyurtma topilmadi.",
"error": "no_order"
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}
POST /orders/status
Holat (order_id tanada)
GET /orders/{order_id} bilan bir xil natija — POST kutayotgan integratsiyalar uchun.
JSON maydon Tur Izoh
order_idmajburiy string
cURL Python PHP JavaScript
Nusxa curl -X POST https://donat24.uz/api/v1/orders/status \
-H "X-API-Key: d24_..." \
-H "Content-Type: application/json" \
-d '{
"order_id": "LS-AB12CD"
}'
200 OK
{
"success": true,
"message": "",
"data": {
"order": {
"order_id": "LS-AB12CD",
"client_ref": "MY-1001",
"game": "Telegram Stars",
"product": "50 Stars",
"product_id": 5084,
"player_id": "durov",
"server_id": "string",
"status": "paid",
"price_uzs": 11000,
"error": "string",
"created_at": "string",
"delivered_at": "string"
}
}
}
404 Buyurtma topilmadi
{
"success": false,
"message": "Buyurtma topilmadi.",
"error": "no_order"
}
401 Kalit yo'q yoki noto'g'ri
{
"success": false,
"message": "Kalit noto'g'ri yoki o'chirilgan.",
"error": "bad_key"
}