{
    "openapi": "3.0.3",
    "info": {
        "title": "Donat24 Reseller API",
        "version": "1.0.0",
        "description": "O'z saytingiz yoki botingizdan Donat24 katalogini sotish uchun. Asosiy manzil: `https://donat24.uz/api/v1`\n\n**Kalit** — kabinetdagi [Sozlamalar](/sozlamalar) sahifasidan olinadi. Yuqoridagi **Authorize** tugmasiga qo'ysangiz, quyidagi so'rovlar shu kalit bilan ketadi.\n\n**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. IP qo'shgan bo'lsangiz «Try it out» brauzeringiz IP sidan ketadi va 403 qaytishi mumkin.\n\n**Chegara** — daqiqada 120 so'rov.\n\n**To'lov** — buyurtma ochilishi bilan pul balansdan yechiladi. Yetkazish darhol emas: `paid → sending → delivered`. Bajarilmasa `refunded` va pul balansga qaytariladi.",
        "contact": {
            "name": "Donat24",
            "url": "https://donat24.uz/sozlamalar"
        }
    },
    "servers": [
        {
            "url": "https://donat24.uz/api/v1",
            "description": "API v1"
        }
    ],
    "externalDocs": {
        "description": "Xom OpenAPI 3.0 spetsifikatsiyasi (JSON) — Postman, Insomnia yoki kod generatorlariga shu manzilni bering",
        "url": "https://donat24.uz/api/docs.json"
    },
    "security": [
        {
            "api_key": []
        }
    ],
    "components": {
        "securitySchemes": {
            "api_key": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key",
                "description": "Kabinet → Sozlamalar → API kaliti. Ko'rinishi: d24_…"
            }
        },
        "schemas": {
            "Envelope": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": true
                    },
                    "message": {
                        "type": "string",
                        "example": ""
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "message": {
                        "type": "string",
                        "description": "Foydalanuvchiga ko'rsatsa bo'ladigan matn"
                    }
                }
            },
            "Order": {
                "type": "object",
                "properties": {
                    "order_id": {
                        "type": "string",
                        "example": "LS-AB12CD",
                        "description": "Donat24 buyurtma raqami"
                    },
                    "client_ref": {
                        "type": "string",
                        "nullable": true,
                        "example": "MY-1001"
                    },
                    "game": {
                        "type": "string",
                        "example": "Telegram Stars"
                    },
                    "product": {
                        "type": "string",
                        "example": "50 Stars"
                    },
                    "product_id": {
                        "type": "integer",
                        "example": 5084
                    },
                    "player_id": {
                        "type": "string",
                        "example": "durov"
                    },
                    "server_id": {
                        "type": "string",
                        "nullable": true,
                        "example": null,
                        "description": "Mobile Legends kabi o'yinlarda Server (Zone) ID"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "paid",
                            "sending",
                            "delivered",
                            "failed",
                            "refunded"
                        ],
                        "example": "paid"
                    },
                    "price_uzs": {
                        "type": "number",
                        "example": 11000
                    },
                    "error": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "delivered_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                }
            },
            "Product": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 5084,
                        "description": "order da product_id sifatida yuboriladi"
                    },
                    "name": {
                        "type": "string",
                        "example": "50 Stars"
                    },
                    "price_uzs": {
                        "type": "number",
                        "example": 11000
                    },
                    "offer_id": {
                        "type": "string",
                        "example": "stars_50"
                    }
                }
            },
            "Game": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string",
                        "example": "telegram-stars"
                    },
                    "name": {
                        "type": "string",
                        "example": "Telegram Stars"
                    },
                    "provider": {
                        "type": "string",
                        "example": "socapi"
                    },
                    "image_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "id_type": {
                        "type": "string",
                        "enum": [
                            "telegram_username",
                            "player_id"
                        ],
                        "description": "player_id maydoniga nima yuborilishi: Telegram username yoki o'yin ichidagi ID"
                    },
                    "needs_server_id": {
                        "type": "boolean",
                        "description": "true bo'lsa buyurtmada server_id ham yuborilishi shart (Mobile Legends)"
                    },
                    "available": {
                        "type": "boolean",
                        "description": "false bo'lsa bu o'yin API orqali yetkazilmaydi (503)"
                    }
                }
            }
        }
    },
    "tags": [
        {
            "name": "Do'kon",
            "description": "Hisob va balans"
        },
        {
            "name": "Katalog",
            "description": "O'yinlar va paketlar"
        },
        {
            "name": "Buyurtma",
            "description": "Tekshirish, berish, holat"
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "tags": [
                    "Do'kon"
                ],
                "summary": "Do'kon va balans",
                "operationId": "me",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "user": {
                                                            "type": "object"
                                                        },
                                                        "wallet": {
                                                            "type": "object"
                                                        },
                                                        "api": {
                                                            "type": "object"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ],
                                    "example": {
                                        "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": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "IP oq ro'yxatda yo'q yoki hisob bloklangan",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Bu IP (203.0.113.50) oq ro'yxatda yo'q.",
                                    "error": "ip_blocked"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Daqiqadagi chegara oshdi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Daqiqadagi so'rov chegarasi (120) oshdi.",
                                    "error": "rate_limit"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/games": {
            "get": {
                "tags": [
                    "Katalog"
                ],
                "summary": "Faol o'yinlar",
                "operationId": "games",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "games": {
                                                            "type": "array",
                                                            "items": {
                                                                "$ref": "#/components/schemas/Game"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/games/{slug}": {
            "get": {
                "tags": [
                    "Katalog"
                ],
                "summary": "O'yin va uning paketlari",
                "operationId": "game",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "O'yin slug'i (/games dan)",
                        "schema": {
                            "type": "string",
                            "example": "telegram-stars"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "game": {
                                                            "$ref": "#/components/schemas/Game"
                                                        },
                                                        "products": {
                                                            "type": "array",
                                                            "items": {
                                                                "$ref": "#/components/schemas/Product"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "O'yin topilmadi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Bunday o'yin yo'q.",
                                    "error": "no_game"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/games/{slug}/products": {
            "get": {
                "tags": [
                    "Katalog"
                ],
                "summary": "Faqat paketlar",
                "operationId": "products",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "O'yin slug'i (/games dan)",
                        "schema": {
                            "type": "string",
                            "example": "telegram-stars"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "products": {
                                                            "type": "array",
                                                            "items": {
                                                                "$ref": "#/components/schemas/Product"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "O'yin topilmadi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Bunday o'yin yo'q.",
                                    "error": "no_game"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/games/{slug}/products/{product_id}": {
            "get": {
                "tags": [
                    "Katalog"
                ],
                "summary": "Bitta paket",
                "operationId": "product",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "O'yin slug'i (/games dan)",
                        "schema": {
                            "type": "string",
                            "example": "telegram-stars"
                        }
                    },
                    {
                        "name": "product_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 5084
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "product": {
                                                            "$ref": "#/components/schemas/Product"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "O'yin yoki paket topilmadi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Bunday paket yo'q.",
                                    "error": "no_product"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/games/{slug}/validate-player": {
            "post": {
                "tags": [
                    "Buyurtma"
                ],
                "summary": "O'yinchi ID / username tekshiruvi",
                "operationId": "validatePlayer",
                "description": "Buyurtmadan oldin chaqiring — noto'g'ri qabul qiluvchiga pul ketmaydi.",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "O'yin slug'i (/games dan)",
                        "schema": {
                            "type": "string",
                            "example": "telegram-stars"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "player_id"
                                ],
                                "properties": {
                                    "player_id": {
                                        "type": "string",
                                        "example": "durov",
                                        "description": "Telegram username (@ siz) yoki o'yin ichidagi ID"
                                    },
                                    "server_id": {
                                        "type": "string",
                                        "example": "1234",
                                        "description": "Faqat needs_server_id=true o'yinlarda (Mobile Legends): Server/Zone ID"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Tekshiruv natijasi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "valid": {
                                                            "type": "boolean"
                                                        },
                                                        "username": {
                                                            "type": "string",
                                                            "nullable": true
                                                        },
                                                        "is_premium": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ],
                                    "example": {
                                        "success": true,
                                        "message": "",
                                        "data": {
                                            "valid": true,
                                            "username": "durov",
                                            "is_premium": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Ma'lumot noto'g'ri yoki bu o'yinda tekshiruv yo'q",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Telegram username noto'g'ri.",
                                    "error": "bad_username"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Tekshiruv xizmati javob bermadi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Tekshiruv xizmati javob bermadi.",
                                    "error": "upstream"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "IP oq ro'yxatda yo'q yoki hisob bloklangan",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Bu IP (203.0.113.50) oq ro'yxatda yo'q.",
                                    "error": "ip_blocked"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Daqiqadagi chegara oshdi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Daqiqadagi so'rov chegarasi (120) oshdi.",
                                    "error": "rate_limit"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/games/{slug}/order": {
            "post": {
                "tags": [
                    "Buyurtma"
                ],
                "summary": "Buyurtma berish",
                "operationId": "createOrder",
                "description": "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.",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "O'yin slug'i (/games dan)",
                        "schema": {
                            "type": "string",
                            "example": "telegram-stars"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "product_id",
                                    "player_id"
                                ],
                                "properties": {
                                    "product_id": {
                                        "type": "integer",
                                        "example": 5084,
                                        "description": "/products dan olingan id"
                                    },
                                    "player_id": {
                                        "type": "string",
                                        "example": "monk",
                                        "description": "Telegram username (Stars/Premium) yoki o'yinchi ID. Kanal/bot username'i qabul qilinmaydi."
                                    },
                                    "server_id": {
                                        "type": "string",
                                        "example": "1234",
                                        "description": "needs_server_id=true o'yinlarda majburiy (Mobile Legends): Server/Zone ID, faqat raqam"
                                    },
                                    "client_ref": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "example": "MY-1001",
                                        "description": "Sizning buyurtma raqamingiz — idempotentlik kaliti"
                                    },
                                    "webhook_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "example": "https://sayt.uz/donat24/webhook",
                                        "description": "Yakuniy holat shu manzilga POST qilinadi. Faqat https://, bir marta yuboriladi."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Buyurtma qabul qilindi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "order": {
                                                            "$ref": "#/components/schemas/Order"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Shu client_ref bilan buyurtma allaqachon bor (duplicate)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "order": {
                                                            "$ref": "#/components/schemas/Order"
                                                        },
                                                        "duplicate": {
                                                            "type": "boolean",
                                                            "example": true
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Balans yetarli emas — buyurtma `new` holatida qoladi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Balansda mablag' yetarli emas.",
                                    "error": "insufficient_balance"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "product_id yoki player_id noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "product_id noto'g'ri.",
                                    "error": "no_product"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "O'yin topilmadi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Bunday o'yin yo'q.",
                                    "error": "no_game"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Bu o'yin API orqali yetkazilmaydi (no_delivery) yoki username tekshiruvi javob bermadi (upstream) — tekshiruvsiz buyurtma ochilmaydi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Bu o'yin hozircha API orqali yetkazilmaydi.",
                                    "error": "no_delivery"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "IP oq ro'yxatda yo'q yoki hisob bloklangan",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Bu IP (203.0.113.50) oq ro'yxatda yo'q.",
                                    "error": "ip_blocked"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Daqiqadagi chegara oshdi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Daqiqadagi so'rov chegarasi (120) oshdi.",
                                    "error": "rate_limit"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders": {
            "get": {
                "tags": [
                    "Buyurtma"
                ],
                "summary": "Buyurtmalar ro'yxati",
                "operationId": "orders",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 50,
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "orders": {
                                                            "type": "array",
                                                            "items": {
                                                                "$ref": "#/components/schemas/Order"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/{order_id}": {
            "get": {
                "tags": [
                    "Buyurtma"
                ],
                "summary": "Bitta buyurtma holati",
                "operationId": "order",
                "parameters": [
                    {
                        "name": "order_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "LS-AB12CD"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "order": {
                                                            "$ref": "#/components/schemas/Order"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Buyurtma topilmadi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Buyurtma topilmadi.",
                                    "error": "no_order"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/games/{slug}/order/status": {
            "post": {
                "tags": [
                    "Buyurtma"
                ],
                "summary": "O'yin bo'yicha buyurtma holati",
                "operationId": "gameOrderStatus",
                "description": "Buyurtma shu o'yinga tegishli bo'lmasa 404 qaytadi. O'yin nomini bilmasangiz `/orders/status` dan foydalaning.",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "O'yin slug'i (/games dan)",
                        "schema": {
                            "type": "string",
                            "example": "telegram-stars"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "order_id"
                                ],
                                "properties": {
                                    "order_id": {
                                        "type": "string",
                                        "example": "LS-AB12CD"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "order": {
                                                            "$ref": "#/components/schemas/Order"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Buyurtma topilmadi yoki boshqa o'yinga tegishli",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Buyurtma topilmadi.",
                                    "error": "no_order"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/status": {
            "post": {
                "tags": [
                    "Buyurtma"
                ],
                "summary": "Holat (order_id tanada)",
                "operationId": "orderStatus",
                "description": "GET /orders/{order_id} bilan bir xil natija — POST kutayotgan integratsiyalar uchun.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "order_id"
                                ],
                                "properties": {
                                    "order_id": {
                                        "type": "string",
                                        "example": "LS-AB12CD"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "order": {
                                                            "$ref": "#/components/schemas/Order"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Buyurtma topilmadi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Buyurtma topilmadi.",
                                    "error": "no_order"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Kalit yo'q yoki noto'g'ri",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "success": false,
                                    "message": "Kalit noto'g'ri yoki o'chirilgan.",
                                    "error": "bad_key"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}