Donat24 API

O'z saytingiz yoki botingizdan Donat24 katalogini soting: katalog, buyurtma, holat.

Asosiy manzilhttps://donat24.uz/api/v1
Kalit sarlavhasiX-API-Key: d24_…
Chegara120 / 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 https://donat24.uz/api/v1/games \
  -H "X-API-Key: d24_..."

Do'kon

Hisob va balans

GET/me

Do'kon va balans

curl https://donat24.uz/api/v1/me \
  -H "X-API-Key: d24_..."
200OK
{
    "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
        }
    }
}
401Kalit yo'q yoki noto'g'ri
{
    "success": false,
    "message": "Kalit noto'g'ri yoki o'chirilgan.",
    "error": "bad_key"
}
403IP 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"
}
429Daqiqadagi 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 https://donat24.uz/api/v1/games \
  -H "X-API-Key: d24_..."
200OK
{
    "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
            }
        ]
    }
}
401Kalit 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

ParametrJoyiIzoh
slugmajburiypathO'yin slug'i (/games dan)
curl https://donat24.uz/api/v1/games/telegram-stars \
  -H "X-API-Key: d24_..."
200OK
{
    "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"
            }
        ]
    }
}
404O'yin topilmadi
{
    "success": false,
    "message": "Bunday o'yin yo'q.",
    "error": "no_game"
}
401Kalit 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

ParametrJoyiIzoh
slugmajburiypathO'yin slug'i (/games dan)
curl https://donat24.uz/api/v1/games/telegram-stars/products \
  -H "X-API-Key: d24_..."
200OK
{
    "success": true,
    "message": "",
    "data": {
        "products": [
            {
                "id": 5084,
                "name": "50 Stars",
                "price_uzs": 11000,
                "offer_id": "stars_50"
            }
        ]
    }
}
404O'yin topilmadi
{
    "success": false,
    "message": "Bunday o'yin yo'q.",
    "error": "no_game"
}
401Kalit 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

ParametrJoyiIzoh
slugmajburiypathO'yin slug'i (/games dan)
product_idmajburiypathinteger
curl https://donat24.uz/api/v1/games/telegram-stars/products/5084 \
  -H "X-API-Key: d24_..."
200OK
{
    "success": true,
    "message": "",
    "data": {
        "product": {
            "id": 5084,
            "name": "50 Stars",
            "price_uzs": 11000,
            "offer_id": "stars_50"
        }
    }
}
404O'yin yoki paket topilmadi
{
    "success": false,
    "message": "Bunday paket yo'q.",
    "error": "no_product"
}
401Kalit 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.

ParametrJoyiIzoh
slugmajburiypathO'yin slug'i (/games dan)
JSON maydonTurIzoh
player_idmajburiystringTelegram username (@ siz) yoki o'yin ichidagi ID
server_idstringFaqat needs_server_id=true o'yinlarda (Mobile Legends): Server/Zone ID
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"
}'
200Tekshiruv natijasi
{
    "success": true,
    "message": "",
    "data": {
        "valid": true,
        "username": "durov",
        "is_premium": false
    }
}
422Ma'lumot noto'g'ri yoki bu o'yinda tekshiruv yo'q
{
    "success": false,
    "message": "Telegram username noto'g'ri.",
    "error": "bad_username"
}
503Tekshiruv xizmati javob bermadi
{
    "success": false,
    "message": "Tekshiruv xizmati javob bermadi.",
    "error": "upstream"
}
401Kalit yo'q yoki noto'g'ri
{
    "success": false,
    "message": "Kalit noto'g'ri yoki o'chirilgan.",
    "error": "bad_key"
}
403IP 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"
}
429Daqiqadagi 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.

ParametrJoyiIzoh
slugmajburiypathO'yin slug'i (/games dan)
JSON maydonTurIzoh
product_idmajburiyinteger/products dan olingan id
player_idmajburiystringTelegram username (Stars/Premium) yoki o'yinchi ID. Kanal/bot username'i qabul qilinmaydi.
server_idstringneeds_server_id=true o'yinlarda majburiy (Mobile Legends): Server/Zone ID, faqat raqam
client_refstringSizning buyurtma raqamingiz — idempotentlik kaliti
webhook_urlstringYakuniy holat shu manzilga POST qilinadi. Faqat https://, bir marta yuboriladi.
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"
}'
201Buyurtma 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"
        }
    }
}
200Shu 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
    }
}
402Balans yetarli emas — buyurtma `new` holatida qoladi
{
    "success": false,
    "message": "Balansda mablag' yetarli emas.",
    "error": "insufficient_balance"
}
422product_id yoki player_id noto'g'ri
{
    "success": false,
    "message": "product_id noto'g'ri.",
    "error": "no_product"
}
404O'yin topilmadi
{
    "success": false,
    "message": "Bunday o'yin yo'q.",
    "error": "no_game"
}
503Bu 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"
}
401Kalit yo'q yoki noto'g'ri
{
    "success": false,
    "message": "Kalit noto'g'ri yoki o'chirilgan.",
    "error": "bad_key"
}
403IP 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"
}
429Daqiqadagi chegara oshdi
{
    "success": false,
    "message": "Daqiqadagi so'rov chegarasi (120) oshdi.",
    "error": "rate_limit"
}

GET/orders

Buyurtmalar ro'yxati

ParametrJoyiIzoh
limitqueryinteger
curl https://donat24.uz/api/v1/orders \
  -H "X-API-Key: d24_..."
200OK
{
    "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"
            }
        ]
    }
}
401Kalit 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

ParametrJoyiIzoh
order_idmajburiypathstring
curl https://donat24.uz/api/v1/orders/LS-AB12CD \
  -H "X-API-Key: d24_..."
200OK
{
    "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"
        }
    }
}
404Buyurtma topilmadi
{
    "success": false,
    "message": "Buyurtma topilmadi.",
    "error": "no_order"
}
401Kalit 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.

ParametrJoyiIzoh
slugmajburiypathO'yin slug'i (/games dan)
JSON maydonTurIzoh
order_idmajburiystring
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"
}'
200OK
{
    "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"
        }
    }
}
404Buyurtma topilmadi yoki boshqa o'yinga tegishli
{
    "success": false,
    "message": "Buyurtma topilmadi.",
    "error": "no_order"
}
401Kalit 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 maydonTurIzoh
order_idmajburiystring
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"
}'
200OK
{
    "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"
        }
    }
}
404Buyurtma topilmadi
{
    "success": false,
    "message": "Buyurtma topilmadi.",
    "error": "no_order"
}
401Kalit yo'q yoki noto'g'ri
{
    "success": false,
    "message": "Kalit noto'g'ri yoki o'chirilgan.",
    "error": "bad_key"
}