{
  "openapi": "3.1.1",
  "info": {
    "title": "Savdolar API",
    "version": "1.0.0",
    "description": "O‘zbekcha raqamli do‘kon integratsiyasi. Barcha pul qiymatlari butun UZS. Xarid token egasining balansidan to‘lanadi. Faqat HTTPS va server tomoni.",
    "termsOfService": "https://apishop.nexa.uz/terms"
  },
  "servers": [
    {
      "url": "https://apishop.nexa.uz"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/me": {
      "get": {
        "operationId": "getAccount",
        "summary": "Hisob va limitlar",
        "tags": [
          "Hisob"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Me"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [],
        "description": "Hisob va limitlar. Faqat token egasiga tegishli ma’lumot qaytariladi."
      }
    },
    "/v1/balance": {
      "get": {
        "operationId": "getBalance",
        "summary": "Token egasining joriy balansi",
        "tags": [
          "Hisob"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Money"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [],
        "description": "Token egasining joriy balansi. Faqat token egasiga tegishli ma’lumot qaytariladi."
      }
    },
    "/v1/balance/transactions": {
      "get": {
        "operationId": "listTransactions",
        "summary": "Balans harakatlari",
        "tags": [
          "Hisob"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Transaction"
                      }
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            },
            "description": "Bir sahifadagi natijalar."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Oldingi javobdagi meta.next_cursor. null bo‘lsa tugadi."
          }
        ],
        "description": "Balans harakatlari. Faqat token egasiga tegishli ma’lumot qaytariladi."
      }
    },
    "/v1/services": {
      "get": {
        "operationId": "listServices",
        "summary": "Xizmatlar va eng arzon mavjud tarif",
        "tags": [
          "Katalog"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Service"
                      }
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [],
        "description": "Xizmatlar va eng arzon mavjud tarif. Faqat token egasiga tegishli ma’lumot qaytariladi."
      }
    },
    "/v1/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "Tariflar, narxlar va mavjudlik",
        "tags": [
          "Katalog"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            },
            "description": "Bir sahifadagi natijalar."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Oldingi javobdagi meta.next_cursor. null bo‘lsa tugadi."
          },
          {
            "name": "service_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "available",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "true yuborilsa faqat mavjudlari."
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "description": "Faqat yoqilgan xizmat va tariflar. Narx bot bilan bir xil UZS; exact stock va yetkazib beruvchi tannarxi berilmaydi. Mavjudlik xaridoldi qayta tekshiriladi."
      }
    },
    "/v1/products/{pid}": {
      "get": {
        "operationId": "getProduct",
        "summary": "Tarifning to‘liq tavsifi",
        "tags": [
          "Katalog"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": "Tarifning to‘liq tavsifi. Faqat token egasiga tegishli ma’lumot qaytariladi."
      }
    },
    "/v1/quotes": {
      "post": {
        "operationId": "createQuote",
        "summary": "5 daqiqalik narx taklifi; pul yechilmaydi",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "201": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [],
        "description": "Narx va mavjudlik yangidan tekshiriladi. Quote 300 soniya amal qiladi va balansdan pul yechmaydi. Miqdor faqat 1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteInput"
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{oid}": {
      "get": {
        "operationId": "getQuote",
        "summary": "O‘zingiz yaratgan narx taklifi",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "oid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{16}$"
            }
          }
        ],
        "description": "O‘zingiz yaratgan narx taklifi. Faqat token egasiga tegishli ma’lumot qaytariladi."
      }
    },
    "/v1/orders": {
      "post": {
        "operationId": "createOrder",
        "summary": "Xaridni navbatga qabul qilish",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "202": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Token egasi balansi yetarli emas; yangi xarid qabul qilinmadi.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "200": {
            "description": "Avval qabul qilingan bir xil xarid; qayta pul yechilmaydi.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{8,128}$"
            },
            "description": "Bitta biznes xarid uchun doim bir xil kalit va bir xil JSON. User bo‘yicha yagona, token almashtirilganda ham saqlanadi."
          }
        ],
        "description": "Intent tranzaksiyada saqlanadi va asinxron bajariladi. 202 yetkazish yoki debit tasdig‘i emas. Bir xil user/key/tana qayta yuborilsa o‘sha order qaytadi. Pul yetmasa 402, narx rezervdan oldin o‘zgarsa order failed/PRICE_CHANGED bo‘ladi.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderInput"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listOrders",
        "summary": "API orqali yaratilgan o‘z buyurtmalaringiz",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            },
            "description": "Bir sahifadagi natijalar."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Oldingi javobdagi meta.next_cursor. null bo‘lsa tugadi."
          }
        ],
        "description": "API orqali yaratilgan o‘z buyurtmalaringiz. Faqat token egasiga tegishli ma’lumot qaytariladi."
      }
    },
    "/v1/orders/lookup": {
      "get": {
        "operationId": "lookupOrder",
        "summary": "Idempotency-Key orqali avvalgi buyurtma",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "idempotency_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Tarmoq xatosidan keyin avvalgi key bo‘yicha tiklash. 404 pul yechilmaganiga isbot emas: ayni key va ayni JSON bilan POST qaytarilishi mumkin; yangi key yaratmang."
      }
    },
    "/v1/orders/{oid}": {
      "get": {
        "operationId": "getOrder",
        "summary": "Buyurtmaning joriy holati",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "oid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{16}$"
            }
          }
        ],
        "description": "Buyurtmaning joriy holati. Faqat token egasiga tegishli ma’lumot qaytariladi."
      }
    },
    "/v1/orders/{oid}/delivery": {
      "get": {
        "operationId": "getDelivery",
        "summary": "Faqat yakunlangan xaridning maxfiy ma’lumotlari",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Delivery"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "oid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{16}$"
            }
          }
        ],
        "description": "Faqat completed va o‘z hisobiga tegishli API xaridi. Matn har qanday credential formatini saqlaydi; HTML sifatida bajarmang. Aktivatsiya tugaganda matn bo‘sh bo‘lishi mumkin. Javobni umumiy keshga saqlamang."
      }
    },
    "/v1/orders/{oid}/cancel": {
      "post": {
        "operationId": "cancelOrder",
        "summary": "Faqat hali rezerv qilinmagan queued buyurtmani bekor qilish",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "oid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{16}$"
            }
          }
        ],
        "description": "Faqat hali rezerv qilinmagan queued order. Parallel rezerv allaqachon boshlangan bo‘lsa 409; pul holati charged/refunded maydonlarida."
      }
    },
    "/v1/orders/{oid}/activation": {
      "post": {
        "operationId": "submitActivation",
        "summary": "Aktivatsiya ma’lumotini bir marta yuborish",
        "tags": [
          "Xarid"
        ],
        "responses": {
          "200": {
            "description": "Muvaffaqiyatli javob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Standart xato; barcha maydonlar doim mavjud. 429 uchun Retry-After, barcha javoblar uchun X-Request-ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Standart xato. error.code/title/description/details/retryable va request_id ni tekshiring.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "202": {
            "description": "Yuborilgan aktivatsiya tekshirilmoqda; yana yubormang.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "order_id": {
                          "type": "string"
                        },
                        "status": {
                          "const": "review_required"
                        }
                      },
                      "required": [
                        "order_id",
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "oid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{16}$"
            }
          }
        ],
        "description": "Faqat activation_required buyurtma. Mutation bir marta yuboriladi; timeoutdan keyin qayta chaqirilmaydi. So‘rov 202 review_required bo‘lsa GET order orqali kuzating yoki yordamga murojaat qiling.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivationInput"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "sav_live_…"
      }
    },
    "schemas": {
      "Money": {
        "type": "object",
        "properties": {
          "amount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "currency": {
            "const": "UZS"
          }
        },
        "required": [
          "amount",
          "currency"
        ],
        "additionalProperties": false
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "guide": {
            "type": [
              "string",
              "null"
            ]
          },
          "service_id": {
            "type": "string"
          },
          "service_title": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "available": {
            "type": "boolean"
          },
          "delivery_type": {
            "enum": [
              "activation",
              "credentials"
            ]
          },
          "delivery_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "warranty": {
            "enum": [
              "none",
              "partial"
            ]
          },
          "catalogue_stale": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "price",
          "available"
        ],
        "additionalProperties": false
      },
      "Quote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "product_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "quantity": {
            "const": 1
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "expires_at": {
            "type": "integer"
          },
          "activation_identifier": {
            "type": [
              "string",
              "null"
            ]
          },
          "expired": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "product_id",
          "quantity",
          "price",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "product_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "processing",
              "review_required",
              "completed",
              "failed",
              "cancelled",
              "pending_delivery",
              "activation_required",
              "activating"
            ]
          },
          "quantity": {
            "const": 1
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "customer_reference": {
            "type": "string"
          },
          "charged": {
            "type": "boolean"
          },
          "refunded": {
            "type": "boolean"
          },
          "delivery_available": {
            "type": "boolean"
          },
          "created_at": {
            "type": "integer"
          },
          "updated_at": {
            "type": "integer"
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrderError"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "product_id",
          "status",
          "price",
          "charged",
          "refunded",
          "delivery_available"
        ],
        "additionalProperties": false
      },
      "OrderError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "title",
          "description"
        ],
        "additionalProperties": false
      },
      "Delivery": {
        "type": "object",
        "properties": {
          "order_id": {
            "type": "string"
          },
          "type": {
            "enum": [
              "activation",
              "credentials"
            ]
          },
          "text": {
            "type": "string"
          },
          "links": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "format": {
            "const": "plain_text"
          },
          "activation_completed": {
            "type": "boolean"
          }
        },
        "required": [
          "order_id",
          "type",
          "text",
          "links",
          "format",
          "activation_completed"
        ],
        "additionalProperties": false
      },
      "Service": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "min_price": {
            "$ref": "#/components/schemas/Money"
          },
          "product_count": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "title",
          "available",
          "min_price",
          "product_count"
        ],
        "additionalProperties": false
      },
      "Me": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "integer"
          },
          "balance": {
            "$ref": "#/components/schemas/Money"
          },
          "token_prefix": {
            "type": "string"
          },
          "maintenance": {
            "type": "boolean"
          },
          "limits": {
            "type": "object",
            "properties": {
              "requests_per_minute": {
                "type": "integer"
              },
              "writes_per_minute": {
                "type": "integer"
              }
            },
            "required": [
              "requests_per_minute",
              "writes_per_minute"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "user_id",
          "balance",
          "token_prefix",
          "maintenance",
          "limits"
        ],
        "additionalProperties": false
      },
      "Transaction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "amount": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "created": {
            "type": "integer"
          },
          "currency": {
            "const": "UZS"
          }
        },
        "required": [
          "id",
          "amount",
          "kind",
          "reference",
          "created",
          "currency"
        ],
        "additionalProperties": false
      },
      "QuoteInput": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "integer",
            "minimum": 1
          },
          "quantity": {
            "type": "integer",
            "const": 1,
            "default": 1
          },
          "activation_identifier": {
            "type": "string",
            "maxLength": 320
          }
        },
        "required": [
          "product_id"
        ],
        "additionalProperties": false
      },
      "OrderInput": {
        "type": "object",
        "properties": {
          "quote_id": {
            "type": "string",
            "pattern": "^[a-f0-9]{16}$"
          },
          "customer_reference": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "quote_id"
        ],
        "additionalProperties": false
      },
      "ActivationInput": {
        "type": "object",
        "properties": {
          "activation_identifier": {
            "type": "string",
            "minLength": 1,
            "maxLength": 320
          }
        },
        "required": [
          "activation_identifier"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "retryable": {
                "type": "boolean"
              }
            },
            "required": [
              "code",
              "title",
              "description",
              "details",
              "retryable"
            ],
            "additionalProperties": false
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "error",
          "request_id"
        ],
        "additionalProperties": false
      }
    }
  }
}
