{
  "openapi": "3.0.4",
  "info": {
    "title": "api/billing",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1.0/balance": {
      "get": {
        "tags": [
          "VirtualAccounts"
        ],
        "summary": "Получает текущий баланс контакта.",
        "operationId": "get_v1.0_billing_virtual-accounts_balance",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          },
          "400": {
            "description": "Неверные входные данные.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "Неверные входные данные."
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          },
          "402": {
            "description": "Метод доступен только платным пользователям.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "payment_required",
                  "reason": "Метод доступен только платным пользователям."
                }
              }
            }
          },
          "403": {
            "description": "Отсутствует разрешение.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "forbidden",
                  "reason": "Отсутствует разрешение."
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "not_found",
                  "reason": "Ресурс не найден"
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка во время выполнения запроса.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "internal_error",
                  "reason": "Произошла ошибка во время выполнения запроса."
                }
              }
            }
          },
          "504": {
            "description": "Сервер не ответил во время.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "timeout",
                  "reason": "Сервер не ответил во время."
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Код ошибки",
            "nullable": true,
            "example": "invalid_input_data"
          },
          "reason": {
            "type": "string",
            "description": "Описание ошибки",
            "nullable": true,
            "example": "Неверные входные данные."
          }
        },
        "additionalProperties": false,
        "description": "Стандартный ответ с описанием ошибки"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}