{
  "openapi": "3.0.0",
  "info": {
    "title": "api/billing",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1.0/balance": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserBalance"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "VirtualAccounts"
        ],
        "operationId": "GetBalance",
        "summary": "Получает текущий баланс контакта."
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "properties": {
          "error": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UserBalance": {
        "description": "Представляет модель результата операции по получению баланса кошелька.",
        "properties": {
          "balance": {
            "description": "Текущий баланс кошелька.",
            "format": "double",
            "type": "number"
          },
          "contactId": {
            "description": "Идентификатор контакта",
            "format": "int32",
            "type": "integer"
          },
          "departmentId": {
            "description": "Идентификатор подразделения",
            "format": "int32",
            "type": "integer"
          },
          "firmId": {
            "description": "Идентификатор фирмы",
            "format": "int32",
            "type": "integer"
          },
          "isCommonWallet": {
            "description": "Флаг общего кошелька",
            "type": "boolean"
          },
          "isDepartmentWallet": {
            "readOnly": true,
            "type": "boolean"
          },
          "isPersonalWallet": {
            "readOnly": true,
            "type": "boolean"
          },
          "operationsForbidden": {
            "description": "Операции с кошельком запрещены пользователю.",
            "type": "boolean"
          },
          "walletId": {
            "description": "Идентификатор кошелька.",
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}