{
  "openapi": "3.0.1",
  "info": {
    "title": "paid-api/price_prediction",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/webapi/bazaar/v1/price_prediction_api": {
      "post": {
        "summary": "Ставки в похожих грузах - API",
        "operationId": "price_prediction_v1_price_prediction_api_post",
        "parameters": [
          {
            "name": "demo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Demo"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadParamsApi"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricePredictionResponseFormatRoot"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorFormatResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorFormatResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ConcretePricePredictionResponseFormat": {
        "properties": {
          "price": {
            "type": "integer",
            "title": "Price"
          }
        },
        "type": "object",
        "required": [
          "price"
        ],
        "title": "ConcretePricePredictionResponseFormat"
      },
      "ErrorFormatResponse": {
        "properties": {
          "error_body": {
            "type": "string",
            "title": "Error Body",
            "description": "основное тело ошибки с описанием"
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "description": "тип ошибки если имеется"
          },
          "details": {
            "type": "object",
            "title": "Details",
            "description": "какие-либо дополнительные детали ошибки"
          }
        },
        "type": "object",
        "required": [
          "error_body",
          "reason",
          "details"
        ],
        "title": "ErrorFormatResponse"
      },
      "LoadParamsApi": {
        "properties": {
          "from_city": {
            "type": "integer",
            "minimum": 1,
            "title": "ID города загрузки",
            "description": "Значение поля `id` в структуре `city` из [словаря  ATI.SU](https://ati.su/developers/api/dictionaries/geo/#post-v1-autocomplete-suggestions)"
          },
          "to_city": {
            "type": "integer",
            "minimum": 1,
            "title": "ID города разгрузки",
            "description": "Значение поля `id` в структуре `city` из [словаря  ATI.SU](https://ati.su/developers/api/dictionaries/geo/#post-v1-autocomplete-suggestions)"
          },
          "cargo_type": {
            "type": "integer",
            "title": "Идентификатор наименования груза",
            "description": "Идентификатор наименования груза. Значение поля `Id` из [словаря грузов ATI.SU](https://ati.su/developers/api/dictionaries/cargoes/#get-v1.0-dictionaries-cargoTypes)"
          },
          "car_type": {
            "type": "integer",
            "minimum": 1,
            "title": "Тип кузова",
            "description": "Тип кузова. Значение поля `Id` из [словаря кузовов ATI.SU](https://ati.su/developers/api/dictionaries/cargoes/#get-v1.0-dictionaries-carTypes)"
          },
          "volume": {
            "type": "number",
            "title": "Объем груза в кубических метрах",
            "description": "Объем груза в кубических метрах. Обязательный параметр, если не задан параметр weight.",
            "default": 0
          },
          "weight": {
            "type": "number",
            "title": "Вес груза в тоннах",
            "description": "Вес груза в тоннах. Обязательный параметр, если не задан параметр volume.",
            "default": 0
          },
          "distance": {
            "type": "number",
            "title": "Расстояние маршрута в километрах",
            "description": "Расстояние маршрута в километрах"
          },
          "adr": {
            "type": "integer",
            "maximum": 9,
            "minimum": 0,
            "title": "Параметр, определяющий степень опасности груза. Допустимое значение: Null, либо от 0 до 9.",
            "description": "Параметр, определяющий степень опасности груза. Допустимое значение: Null, либо от 0 до 9.",
            "default": 0
          },
          "dogruz": {
            "type": "string",
            "title": "dogruz",
            "description": "Загрузка:\r\n- `ftl` — отдельной машиной\r\n- `dont-care` — отдельной машиной или догрузом"
          },
          "path_type": {
            "type": "string",
            "enum": [
              "one_way",
              "roundtrip"
            ],
            "description": "Тип маршрута: односторонний или кругорейс",
            "default": "one_way"
          },
          "pallet_count": {
            "type": "integer",
            "title": "количество упаковок",
            "description": "Количество упаковок",
            "default": 0
          },
          "pack_type_id": {
            "type": "integer",
            "title": "Тип упоковки, по дефолту зануляем",
            "description": "ID типа упаковок из [словаря типов упаковок ATI.SU](https://ati.su/developers/api/dictionaries/cargoes/#get-v1.0-dictionaries-packTypes)",
            "default": 0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "from_city",
          "to_city",
          "car_type",
          "dogruz"
        ],
        "title": "Запрос: входные параметры для API `Ставки в похожих грузах`",
        "example": {
          "car_type": 1,
          "distance": 700,
          "dogruz": "ftl",
          "from_city": 1,
          "to_city": 3611,
          "volume": 0,
          "weight": 15
        }
      },
      "PricePredictionResponseFormatRoot": {
        "properties": {
          "price_with_tax": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ConcretePricePredictionResponseFormat"
              }
            ],
            "description": "Цена с НДС, руб"
          },
          "price_without_tax": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ConcretePricePredictionResponseFormat"
              }
            ],
            "description": "Цена без НДС, руб"
          },
          "price_with_cash": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ConcretePricePredictionResponseFormat"
              }
            ],
            "description": "Цена наличными, руб"
          },
          "is_approximated": {
            "type": "boolean",
            "description": "В случае, если параметр `true`, то у нас недостаточно данных по направлению. Учтены дополнительные данные с похожих направлений.",
            "default": false
          }
        },
        "type": "object",
        "title": "Ответ: ставки в похожих грузах "
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}