{
  "openapi": "3.0.0",
  "info": {
    "title": "api/orders/personal-invitations",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1.2/orders/invites": {
      "post": {
        "tags": [
          "Персональные приглашения"
        ],
        "summary": "Отправка приглашения",
        "description": "Отправляет приглашение оформить заказ грузоперевозчику с оповещением\n            \n*Отправленное повторно приглашение удалит предыдущее*",
        "operationId": "PersonalInvitations_Invite",
        "requestBody": {
          "x-name": "dto",
          "description": "Параметры приглашения",
          "content": {
            "application/json": {
              "schema": {
                "nullable": true,
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/PersonalInvitationDTO"
                  }
                ]
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Приглашение отправлено"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FinalExceptionModelOfFinalException"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/orders/invites/counter_offer": {
      "post": {
        "tags": [
          "Персональные приглашения"
        ],
        "summary": "Отправка приглашения по встречному предложению",
        "description": "Отправляет приглашение оформить заказ грузоперевозчику по встречному предложению",
        "operationId": "PersonalInvitations_CounterOfferInvite",
        "requestBody": {
          "x-name": "dto",
          "description": "Параметры приглашения",
          "content": {
            "application/json": {
              "schema": {
                "nullable": true,
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/PersonalOfferInvitationDTO"
                  }
                ]
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Приглашение отправлено"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FinalExceptionModelOfFinalException"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/orders/invites/{loadId}": {
      "get": {
        "tags": [
          "Персональные приглашения"
        ],
        "summary": "Получение отправленных приглашений",
        "operationId": "PersonalInvitations_Get",
        "parameters": [
          {
            "name": "loadId",
            "in": "path",
            "required": true,
            "description": "ID груза",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Отправленные приглашения",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LoadPersonalInvitationView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FinalExceptionModelOfFinalException"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/orders/invites/my": {
      "get": {
        "tags": [
          "Персональные приглашения"
        ],
        "summary": "Получение списка приглашений",
        "operationId": "PersonalInvitations_Get2",
        "parameters": [
          {
            "name": "role",
            "in": "query",
            "description": "Роль пользователя: `0` — Грузовладелец, `1` — Перевозчик",
            "schema": {
              "$ref": "#/components/schemas/OrderRole"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Список приглашений на перевозку груза",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PersonalInvitationView3"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FinalExceptionModelOfFinalException"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/orders/invites/{loadId}/{contactId}": {
      "delete": {
        "tags": [
          "Персональные приглашения"
        ],
        "summary": "Отказ от приглашения",
        "operationId": "PersonalInvitations_Delete",
        "parameters": [
          {
            "name": "loadId",
            "in": "path",
            "required": true,
            "description": "ID груза",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          },
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 2
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный отказ от приглашения"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FinalExceptionModelOfFinalException"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/orders/invites/by_taker_id/{loadId}/{takerAtiId}": {
      "delete": {
        "tags": [
          "Персональные приглашения"
        ],
        "summary": "Удаление предложения",
        "operationId": "PersonalInvitations_Delete2",
        "parameters": [
          {
            "name": "loadId",
            "in": "path",
            "required": true,
            "description": "ID груза",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          },
          {
            "name": "takerAtiId",
            "in": "path",
            "required": true,
            "description": "Id аккаунта приглашаемой фирмы",
            "schema": {
              "type": "string"
            },
            "x-position": 2
          }
        ],
        "responses": {
          "200": {
            "description": "Успешное удаление предложения"
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "DateType": {
        "type": "integer",
        "description": "Готовность груза к перевозке\n            \n* `0` — Готов к отправке сегодня или завтра\n* `1` — Готов к отправке между FirstDate и LastDate\n* `2` — Готов к отправке постоянно\n* `3` — Груза нет, запрос ставки",
        "x-enumNames": [
          "ReadyToLoading",
          "BetweenTwoDates",
          "AlwaysReady",
          "MissingLoad"
        ],
        "enum": [
          0,
          1,
          2,
          3
        ]
      },
      "Periodicity": {
        "type": "integer",
        "description": "Периодичность загрузки\n            \n* `0` — Нет\n* `1` — Ежедневно\n* `100` — Только по рабочим дням",
        "x-enumNames": [
          "None",
          "EveryDay",
          "OnlyWorkingDays"
        ],
        "enum": [
          0,
          1,
          100
        ]
      },
      "LoadPoint": {
        "type": "object",
        "description": "Точка маршрута груза",
        "additionalProperties": false,
        "properties": {
          "fias_id": {
            "type": "string",
            "description": "Id точки по базе ФИАС",
            "format": "guid",
            "nullable": true
          },
          "city_id": {
            "type": "integer",
            "description": "Id города\\\nЗначение из [словаря городов АТИ](https://ati.su/developers/api/dictionaries/geo/) ",
            "format": "int32",
            "nullable": true
          },
          "latitude": {
            "type": "number",
            "description": "Широта",
            "format": "decimal",
            "nullable": true
          },
          "longitude": {
            "type": "number",
            "description": "Долгота",
            "format": "decimal",
            "nullable": true
          },
          "street": {
            "type": "string",
            "description": "Адрес",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "description": "Id из справочника организаций",
            "format": "guid",
            "nullable": true
          },
          "address_id": {
            "type": "string",
            "description": "Id адреса в организации",
            "format": "guid",
            "nullable": true
          },
          "time_start": {
            "type": "string",
            "description": "Время \"От\"",
            "format": "date-time",
            "nullable": true
          },
          "time_end": {
            "type": "string",
            "description": "Время \"До\"",
            "format": "date-time",
            "nullable": true
          },
          "is_round_the_clock": {
            "type": "boolean",
            "description": "Круглосуточно",
            "nullable": true
          },
          "large_cities": {
            "type": "array",
            "description": "Список Id ближайших крупных городов",
            "nullable": true,
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "large_cities_with_distance": {
            "type": "array",
            "description": "Расстояния до ближайших крупных городов",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/LargeCityWithDistance"
            }
          },
          "loading_cargos": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/LoadingCargo"
            }
          },
          "organization": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/Organization"
              }
            ]
          }
        }
      },
      "LargeCityWithDistance": {
        "type": "object",
        "description": "Сущность, описывающая ближайший крупный город",
        "additionalProperties": false,
        "properties": {
          "city_id": {
            "type": "integer",
            "description": "Id города\\\nЗначение из [словаря городов АТИ](https://ati.su/developers/api/dictionaries/geo/) ",
            "format": "int64",
            "nullable": true
          },
          "distance": {
            "type": "number",
            "description": "Расстояние",
            "format": "double",
            "nullable": true
          }
        }
      },
      "LoadingCargo": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "cargo_id": {
            "type": "integer",
            "description": "Id груза",
            "format": "int32"
          },
          "name_id": {
            "type": "integer",
            "description": "Наименование груза",
            "format": "int32",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "packaging_type": {
            "type": "integer",
            "description": "Упаковка",
            "format": "int32",
            "nullable": true
          },
          "packaging_quantity": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "weight": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "volume": {
            "type": "number",
            "description": "Объем",
            "format": "double",
            "nullable": true
          },
          "sizes": {
            "description": "Габариты",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoadSize"
              }
            ]
          },
          "packaging_type_name": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "LoadSize": {
        "type": "object",
        "description": "Размеры груза",
        "additionalProperties": false,
        "properties": {
          "length": {
            "type": "number",
            "description": "Длина в метрах",
            "format": "double",
            "nullable": true
          },
          "width": {
            "type": "number",
            "description": "Ширина в метрах",
            "format": "double",
            "nullable": true
          },
          "height": {
            "type": "number",
            "description": "Высота в метрах",
            "format": "double",
            "nullable": true
          },
          "diameter": {
            "type": "number",
            "description": "Диаметр в метрах",
            "format": "double",
            "nullable": true
          },
          "length_highlight": {
            "type": "boolean",
            "description": "Подсвечивать ли длину",
            "nullable": true
          },
          "width_highlight": {
            "type": "boolean",
            "description": "Подсвечивать ли ширину",
            "nullable": true
          },
          "height_highlight": {
            "type": "boolean",
            "description": "Подсвечивать ли высоту",
            "nullable": true
          }
        }
      },
      "Organization": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "organization_id": {
            "type": "string",
            "format": "guid"
          },
          "firm_id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "ownership": {
            "type": "integer",
            "format": "int32"
          },
          "residency": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/Residency"
              }
            ]
          },
          "inn": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "extra_phone": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "docs_address": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrganizationDocsAddress"
              }
            ]
          },
          "stocks": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/Stock"
            }
          },
          "contact_persons": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/ContactPerson"
            }
          },
          "ownership_name": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Residency": {
        "type": "integer",
        "description": "Резидентство\n            \n* `1` — Россия\n* `2` — Украина\n* `3` — Беларусь\n* `10` — Казахстан\n* `200` — Международное (другое)",
        "x-enumNames": [
          "Russia",
          "Ukraine",
          "Belarus",
          "Kazakhstan",
          "International"
        ],
        "enum": [
          1,
          2,
          3,
          10,
          200
        ]
      },
      "OrganizationDocsAddress": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "city_id": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "street_name": {
            "type": "string",
            "nullable": true
          },
          "house_no": {
            "type": "string",
            "nullable": true
          },
          "office_no": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Stock": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "stock_id": {
            "type": "string",
            "format": "guid"
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "address_city_id": {
            "type": "integer",
            "format": "int32"
          },
          "address_latitude": {
            "type": "number",
            "format": "double"
          },
          "address_longitude": {
            "type": "number",
            "format": "double"
          },
          "note": {
            "type": "string",
            "nullable": true
          },
          "work_schedules": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/StockSchedule"
            }
          },
          "breaks_schedules": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/StockSchedule"
            }
          },
          "contact_persons": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/ContactPerson"
            }
          },
          "schedule_summary": {
            "type": "string",
            "nullable": true
          },
          "stock_type": {
            "$ref": "#/components/schemas/StockType"
          },
          "timeslots_binding": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/TimeslotsBinding"
              }
            ]
          }
        }
      },
      "StockSchedule": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "stock_schedule_id": {
            "type": "string",
            "format": "guid"
          },
          "day_of_week": {
            "$ref": "#/components/schemas/DayOfWeek"
          },
          "start_time": {
            "type": "string",
            "format": "duration"
          },
          "end_time": {
            "type": "string",
            "format": "duration"
          }
        }
      },
      "DayOfWeek": {
        "type": "integer",
        "description": "",
        "x-enumNames": [
          "Sunday",
          "Monday",
          "Tuesday",
          "Wednesday",
          "Thursday",
          "Friday",
          "Saturday"
        ],
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6
        ]
      },
      "ContactPerson": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contact_person_id": {
            "type": "string",
            "format": "guid"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "StockType": {
        "type": "integer",
        "description": "",
        "x-enumNames": [
          "Stock",
          "Office",
          "Store"
        ],
        "enum": [
          1,
          2,
          3
        ]
      },
      "TimeslotsBinding": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "warehouse_id": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "$ref": "#/components/schemas/TimeslotsBindingStatus"
          }
        }
      },
      "TimeslotsBindingStatus": {
        "type": "integer",
        "description": "",
        "x-enumNames": [
          "AwaitReaction",
          "Accepted",
          "Revoked",
          "Rejected"
        ],
        "enum": [
          0,
          1,
          2,
          3
        ]
      },
      "LoadExtraPoint": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "route_point_id": {
            "type": "string",
            "format": "guid"
          },
          "id": {
            "type": "string",
            "format": "guid"
          },
          "city_id": {
            "type": "integer",
            "description": "Id города\\\nЗначение из [словаря городов АТИ](https://ati.su/developers/api/dictionaries/geo/) ",
            "format": "int32",
            "nullable": true
          },
          "point_type": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoadExtraPointType"
              }
            ]
          },
          "ordinal_id": {
            "type": "integer",
            "description": "Порядковый номер в маршруте",
            "format": "int32",
            "nullable": true
          },
          "distance": {
            "type": "integer",
            "description": "Расстояние",
            "format": "int32",
            "nullable": true
          },
          "street": {
            "type": "string",
            "description": "Адрес",
            "nullable": true
          },
          "latitude": {
            "type": "number",
            "description": "Широта",
            "format": "decimal",
            "nullable": true
          },
          "longitude": {
            "type": "number",
            "description": "Долгота",
            "format": "decimal",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "description": "Id из справочника организаций",
            "format": "guid",
            "nullable": true
          },
          "address_id": {
            "type": "string",
            "description": "Id адреса в организации",
            "format": "guid",
            "nullable": true
          },
          "loading_date_start": {
            "type": "string",
            "description": "Дата начала  загрузки",
            "format": "date-time",
            "nullable": true
          },
          "loading_date_end": {
            "type": "string",
            "description": "Дата конца загрузки",
            "format": "date-time",
            "nullable": true
          },
          "loading_time_start": {
            "type": "string",
            "description": "Время начала загрузки",
            "format": "duration",
            "nullable": true
          },
          "loading_time_end": {
            "type": "string",
            "description": "Время конца загрузки",
            "format": "duration",
            "nullable": true
          },
          "is_round_the_clock": {
            "type": "boolean",
            "description": "Круглосуточно",
            "nullable": true
          },
          "city_name": {
            "type": "string",
            "nullable": true
          },
          "loading_cargos": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/LoadingCargo"
            }
          },
          "unloading_cargos": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/UnloadingCargo"
            }
          },
          "organization": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/Organization"
              }
            ]
          }
        }
      },
      "LoadExtraPointType": {
        "type": "integer",
        "description": "Тип дополнительной точки маршрута груза\n            \n* `1` — Загрузка\n* `2` — Разгрузка\n* `3` — Таможня\n* `4` — Ближайший крупный город к городу загрузки\n* `5` — Ближайший крупный город к городу разгрузки\n* `8` — Проехать через",
        "x-enumNames": [
          "LoadingExtraPoint",
          "UnloadingExtraPoint",
          "CustomExtraPoint",
          "LoadingLargeCity",
          "UnloadingLargeCity",
          "DriverThrough"
        ],
        "enum": [
          1,
          2,
          3,
          4,
          5,
          8
        ]
      },
      "UnloadingCargo": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "cargo_id": {
            "type": "integer",
            "description": "Id груза",
            "format": "int32"
          },
          "weight": {
            "type": "number",
            "description": "Вес",
            "format": "double",
            "nullable": true
          },
          "volume": {
            "type": "number",
            "description": "Объём",
            "format": "double",
            "nullable": true
          },
          "packaging_quantity": {
            "type": "integer",
            "description": "Выгружаемая часть упаковки",
            "format": "int32",
            "nullable": true
          },
          "is_defined_by_ttn": {
            "type": "boolean",
            "description": "Выгружаемая часть груза будет определена в ТТН",
            "nullable": true
          }
        }
      },
      "LoadCargo": {
        "type": "object",
        "description": "Параметры груза",
        "additionalProperties": false,
        "properties": {
          "weight": {
            "type": "number",
            "description": "Вес",
            "format": "double",
            "nullable": true
          },
          "volume": {
            "type": "number",
            "description": "Объем",
            "format": "double",
            "nullable": true
          },
          "adr": {
            "type": "integer",
            "description": "Модификатор опасности груза с 0 до 9",
            "format": "int32",
            "nullable": true
          },
          "cargo_type_id": {
            "type": "integer",
            "description": "Идентификатор наименования груза\\\nЗначение из [словаря наименований грузов](https://ati.su/developers/api/dictionaries/cargoes/#get-v1.0-dictionaries-cargoTypes)",
            "format": "int32",
            "nullable": true
          },
          "cargo_type": {
            "type": "string",
            "description": "Строковое наименование груза. Выводится если CargoTypeId не указан, либо равен `59`",
            "nullable": true
          },
          "pack_type": {
            "type": "integer",
            "description": "Тип упаковки(навалом, коробки, россыпью, запаллечен ... пирамида). Значение из словаря PackTypes",
            "format": "int32",
            "nullable": true
          },
          "pallet_count": {
            "type": "integer",
            "description": "Количество паллетов",
            "format": "int32",
            "nullable": true
          },
          "belt_count": {
            "type": "integer",
            "description": "Количество ремней",
            "format": "int32",
            "nullable": true
          },
          "dogruz_type": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/DogruzType"
              }
            ]
          },
          "sbor_gruz": {
            "type": "boolean",
            "description": "Сборный груз",
            "nullable": true
          },
          "size": {
            "description": "Размеры груза",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoadSize"
              }
            ]
          }
        }
      },
      "DogruzType": {
        "type": "integer",
        "description": "Параметр, отвечающий за способ перевозки груза\n            \n* `1` — Только отдельной машиной\n* `2` — Догруз возможен\n* `3` — Догруз",
        "x-enumNames": [
          "OnlyToSeparateCar",
          "DogruzPossible",
          "Dogruz"
        ],
        "enum": [
          1,
          2,
          3
        ]
      },
      "LoadTransport": {
        "type": "object",
        "description": "Параметры перевозки",
        "additionalProperties": false,
        "properties": {
          "car_type": {
            "type": "integer",
            "description": "Битовая сумма кузовов",
            "format": "int64",
            "nullable": true
          },
          "car_type_string": {
            "type": "string",
            "nullable": true
          },
          "loading_type": {
            "type": "integer",
            "description": "Битовая сумма типов загрузки",
            "format": "int32",
            "nullable": true
          },
          "loading_logical_operator": {
            "type": "string",
            "description": "Тип условия загрузки\n\n* `OR`\n* `AND`",
            "default": "OR",
            "nullable": true
          },
          "unloading_type": {
            "type": "integer",
            "description": "Битовая сумма типов разгрузки",
            "format": "int32",
            "nullable": true
          },
          "unloading_logical_operator": {
            "type": "string",
            "description": "Тип условия разгрузки\n            \n* `OR`\n* `AND`",
            "default": "OR",
            "nullable": true
          },
          "trucks_quantity": {
            "type": "integer",
            "description": "Количество машин",
            "format": "int32",
            "nullable": true
          },
          "temperature_from": {
            "type": "integer",
            "description": "Температура перевозки - нижнее значение",
            "format": "int32",
            "nullable": true
          },
          "temperature_to": {
            "type": "integer",
            "description": "Температура перевозки - верхнее значение",
            "format": "int32",
            "nullable": true
          },
          "truck_attribs": {
            "type": "integer",
            "description": "Настройки для машины, используются только в RMQ (Stsepka, Pnevmohod, Koniki)",
            "format": "int32",
            "nullable": true
          },
          "stsepka": {
            "type": "boolean",
            "description": "Сцепка",
            "nullable": true
          },
          "pnevmohod": {
            "type": "boolean",
            "description": "Пневмоход",
            "nullable": true
          },
          "koniki": {
            "type": "boolean",
            "description": "Коники",
            "nullable": true
          },
          "tir": {
            "type": "boolean",
            "description": "TIR",
            "nullable": true
          },
          "cmr": {
            "type": "boolean",
            "description": "CMR",
            "nullable": true
          },
          "t1": {
            "type": "boolean",
            "description": "Т1",
            "nullable": true
          },
          "san_passport": {
            "type": "boolean",
            "description": "Мед книжка",
            "nullable": true
          },
          "sanitation_logbook": {
            "type": "boolean",
            "description": "Сан. книжка",
            "nullable": true
          },
          "is_tracking": {
            "type": "boolean",
            "description": "Запрос отслеживания через АТИ Водитель",
            "nullable": true
          },
          "required_capacity": {
            "type": "number",
            "description": "Требуемая грузоподъёмность в тоннах",
            "format": "decimal",
            "nullable": true
          }
        }
      },
      "RateType": {
        "type": "integer",
        "description": "Тип оплаты\n            \n* `0` — Нет\n* `1` — Любая\n* `2` — С НДС\n* `3` — Без НДС",
        "x-enumNames": [
          "None",
          "Common",
          "Nds",
          "WithoutNds"
        ],
        "enum": [
          0,
          1,
          2,
          3
        ]
      },
      "DealKinds": {
        "type": "integer",
        "description": "Тип Заказа\n            \n* `0` — Заказ невозможен \n* `1` — Взятие груза из поиска\n* `2` — Заказ из Торгов\n* `4` — Предложение груза\n* `8` — Из перехвата машин\n* `16` — Односторонний заказ\n* `32` — Предложение груза из встречного предложения\n* `64` — Предложение груза по контракту\n* `128` — Создан вручную для тестирования черновиков\n* `256` — Создан из АТИ-Доков",
        "x-enumFlags": true,
        "x-enumNames": [
          "None",
          "OrdinaryDeal",
          "AuctionDeal",
          "PersonalDeal",
          "TruckInterDeal",
          "UnilateralDeal",
          "CounterOfferDeal",
          "ContractDeal",
          "DraftDeal",
          "AtiDocumentDeal"
        ],
        "enum": [
          0,
          1,
          2,
          4,
          8,
          16,
          32,
          64,
          128,
          256
        ]
      },
      "PaymentSource": {
        "type": "integer",
        "description": "Источник параметров оплаты\n            \n * `0` — Нет\n * `1` — Встречное предложение\n * `2` — Торги\n * `3` — Груз\n * `4` — Предложение груза\n * `5` — Предложение по контракту",
        "x-enumNames": [
          "None",
          "CounterOffer",
          "Auction",
          "Load",
          "Invitation",
          "Contract"
        ],
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5
        ]
      },
      "OrderRole": {
        "type": "integer",
        "description": "Роль\n\n* `0` — Грузовладелец\n* `1` — Перевозчик",
        "x-enumNames": [
          "CargoOwner",
          "Carrier"
        ],
        "enum": [
          0,
          1
        ]
      },
      "FinalExceptionModelOfFinalException": {
        "type": "object",
        "description": "Модель ошибки",
        "additionalProperties": false,
        "properties": {
          "reason": {
            "type": "string",
            "description": "Причина ошибки"
          },
          "error": {
            "type": "string",
            "description": "Ключ ошибки"
          }
        }
      },
      "PersonalInvitationDTO": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "load_id",
          "taker_ati_id",
          "taker_contacts_list",
          "payment"
        ],
        "properties": {
          "load_id": {
            "type": "string",
            "description": "Id груза",
            "format": "guid",
            "minLength": 1,
            "example": "7a48a9d3-55cb-48a2-8527-35ff461eeb8c"
          },
          "taker_ati_id": {
            "type": "string",
            "description": "Id аккаунта приглашаемой фирмы",
            "minLength": 1,
            "example": "14612"
          },
          "taker_contacts_list": {
            "type": "array",
            "description": "Список контактов приглашаемой фирмы",
            "example": [
              0,
              2,
              5
            ],
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "payment": {
            "description": "Параметры оплаты заказа. Обязательно указание хотя бы одной ставки и валюты для неё.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/PersonalInvitationPaymentDTO"
              }
            ]
          },
          "cancel_after_in_minutes": {
            "type": "integer",
            "description": "Через сколько минут отменить приглашение \"Оформить Заказ\".\nДопустимое значение от 1 до 4320 минут. По умолчанию - 4320 (3 суток)",
            "format": "int32",
            "deprecated": true,
            "x-deprecatedMessage": "удалить после выкладки ATIS-7844/ATIS-8074 и перехода приглашения из встречек на отдельный апи/указание точного времени",
            "nullable": true,
            "example": 60
          },
          "cancellation_date": {
            "type": "string",
            "description": "Дата отмены предложения на перевозку груза, формат ISO 8601",
            "format": "date-time",
            "nullable": true
          },
          "is_tracking": {
            "type": "boolean",
            "description": "Запрос отслеживания через АТИ Водитель"
          }
        }
      },
      "PersonalInvitationPaymentDTO": {
        "type": "object",
        "description": "Параметры оплаты заказа. Обязательно указание хотя бы одной ставки и валюты для неё.",
        "additionalProperties": false,
        "properties": {
          "price": {
            "type": "number",
            "description": "Сумма",
            "format": "decimal",
            "nullable": true,
            "example": 10000
          },
          "currency_id": {
            "type": "integer",
            "description": "ID валюты",
            "format": "int32",
            "nullable": true,
            "example": 32
          },
          "nds_price": {
            "type": "number",
            "description": "Сумма с НДС",
            "format": "decimal",
            "nullable": true
          },
          "nds_currency_id": {
            "type": "integer",
            "description": "ID валюты c НДС",
            "format": "int32",
            "nullable": true
          },
          "not_nds_price": {
            "type": "number",
            "description": "Сумма без НДС",
            "format": "decimal",
            "nullable": true
          },
          "not_nds_currency_id": {
            "type": "integer",
            "description": "ID валюты без НДС",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "PersonalOfferInvitationDTO": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "load_id": {
            "type": "string",
            "description": "Id груза",
            "format": "guid",
            "example": "7a48a9d3-55cb-48a2-8527-35ff461eeb8c"
          },
          "response_id": {
            "type": "string",
            "description": "Id встречного приглашения.\nЗначение из метода [получения отзывов](https://ati.su/developers/api/loads/published/#get-v1.0-loads-new-responses)",
            "format": "guid",
            "example": "5026ffdd-4c2a-eb11-bb90-0025906a774d"
          },
          "rate_types": {
            "type": "array",
            "description": "По каким ставкам отправить приглашение. \nТипы ставок:\n            \n* `0` — наличные\n* `1` — б/нал с НДС\n* `2` — б/нал без НДС",
            "example": [
              0,
              2
            ],
            "items": {
              "$ref": "#/components/schemas/PriceType"
            }
          },
          "cancel_after_in_minutes": {
            "type": "integer",
            "description": "Через сколько минут отменить приглашение \"Оформить Заказ\".\nДопустимое значение от 1 до 4320 минут. По умолчанию - 4320 (3 суток)",
            "format": "int32",
            "nullable": true,
            "example": 60
          },
          "is_auto": {
            "type": "boolean",
            "description": "Приглашение создано автоматически"
          },
          "need_archive_on_invite": {
            "type": "boolean",
            "description": "Архивировать заявку при срабатывании автоматического приглашения"
          }
        }
      },
      "PriceType": {
        "type": "integer",
        "description": "Тип ставки\n            \n* `0` — наличные\n* `1` — б/нал с НДС\n* `2` — б/нал без НДС",
        "x-enumNames": [
          "Cash",
          "CashlessWithNds",
          "CashlessWithoutNds"
        ],
        "enum": [
          0,
          1,
          2
        ]
      },
      "LoadPersonalInvitationView": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "load_id": {
            "type": "string",
            "description": "Id груза",
            "format": "guid"
          },
          "taker_ati_id": {
            "type": "string",
            "description": "Id приглашенной фирмы"
          },
          "taker_persistent_user_id": {
            "type": "integer",
            "description": "Постоянный Id приглашенной фирмы",
            "format": "int32"
          },
          "taker_contacts_list": {
            "type": "array",
            "description": "Список контактов приглашенной фирмы",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "taker_contact_id": {
            "type": "integer",
            "description": "Id контакта приглашенной фирмы",
            "format": "int32",
            "deprecated": true
          },
          "date": {
            "type": "string",
            "description": "Время отправки приглашения",
            "format": "date-time"
          },
          "cancellation_date": {
            "type": "string",
            "description": "Время отмены приглашения",
            "format": "date-time",
            "nullable": true
          },
          "deal_kind": {
            "description": "Тип Заказа\n            \n* `0` — Заказ невозможен \n* `1` — Взятие груза из поиска\n* `2` — Заказ из Торгов\n* `4` — Предложение груза\n* `8` — Из перехвата машин\n* `16` — Односторонний заказ\n* `32` — Предложение груза из встречного предложения\n* `64` — Предложение груза по контракту",
            "oneOf": [
              {
                "$ref": "#/components/schemas/DealKinds"
              }
            ]
          },
          "payment": {
            "description": "Предложенные параметры оплаты",
            "oneOf": [
              {
                "$ref": "#/components/schemas/InvitationPaymentView"
              }
            ]
          },
          "is_tracking": {
            "type": "boolean",
            "description": "Запрос отслеживания через АТИ Водитель"
          }
        }
      },
      "InvitationPaymentView": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "rates": {
            "type": "array",
            "description": "Список возможных ставок перевозки",
            "items": {
              "$ref": "#/components/schemas/InvitationRateView"
            }
          },
          "prepay_percent": {
            "type": "integer",
            "description": "Процент предоплаты",
            "format": "int32"
          },
          "prepay_percent_enabled": {
            "type": "boolean",
            "description": "Есть ли предоплата"
          },
          "on_unloading": {
            "type": "boolean",
            "description": "Оплата на выгрузке"
          },
          "in_fuel": {
            "type": "boolean",
            "description": "Оплата топливом"
          },
          "pay_days_enabled": {
            "type": "boolean",
            "description": "Есть ли срок оплаты"
          },
          "pay_days": {
            "type": "integer",
            "description": "Срок оплаты",
            "format": "int32"
          },
          "fixed_rate": {
            "type": "boolean",
            "description": "Указана ли в грузе ставка"
          },
          "torg": {
            "type": "boolean",
            "description": "Возможен ли торг"
          },
          "direct_contract": {
            "type": "boolean",
            "description": "Прямой договор"
          },
          "money_type": {
            "type": "integer",
            "description": "Способ оплаты",
            "format": "int32",
            "nullable": true
          },
          "payment_source": {
            "$ref": "#/components/schemas/PaymentSource"
          }
        }
      },
      "InvitationRateView": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "rate": {
            "type": "number",
            "description": "Сумма",
            "format": "decimal",
            "nullable": true
          },
          "rate_type": {
            "description": "Тип оплаты\n            \n* `0` — Нет\n* `1` — Любая\n* `2` — С НДС\n* `3` — Без НДС",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/RateType"
              }
            ]
          },
          "currency": {
            "type": "integer",
            "description": "Id валюты\\\nЗначение из [словаря валют АТИ](https://ati.su/developers/api/dictionaries/cargoes/#get-v1.0-dictionaries-currencyTypes)",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "PersonalInvitationView3": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "owner_ati_id": {
            "type": "string",
            "description": "Id фирмы грузовладельца"
          },
          "owner_persistent_user_id": {
            "type": "integer",
            "description": "Постоянный Id фирмы грузовладельца",
            "format": "int32"
          },
          "owner_contact_id": {
            "type": "integer",
            "description": "Id контакта, который отправил приглашение",
            "format": "int32",
            "nullable": true
          },
          "taker_ati_id": {
            "type": "string",
            "description": "Id приглашенной фирмы"
          },
          "taker_persistent_user_id": {
            "type": "integer",
            "description": "Постоянный Id приглашенной фирмы",
            "format": "int32"
          },
          "taker_contact_id": {
            "type": "integer",
            "description": "Id контакта приглашенной фирмы",
            "format": "int32"
          },
          "taker_contacts_list": {
            "type": "array",
            "description": "Список контактов приглашенной фирмы",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "date": {
            "type": "string",
            "description": "Время отправки приглашения",
            "format": "date-time"
          },
          "cancellation_date": {
            "type": "string",
            "description": "Время отмены приглашения",
            "format": "date-time",
            "nullable": true
          },
          "payment": {
            "description": "Предложенные параметры оплаты",
            "oneOf": [
              {
                "$ref": "#/components/schemas/InvitationPaymentView"
              }
            ]
          },
          "load": {
            "description": "Параметры предложенного груза",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ShortLoadView"
              }
            ]
          },
          "is_tracking": {
            "type": "boolean",
            "description": "Запрос отслеживания через АТИ Водитель"
          },
          "deal_kind": {
            "description": "Тип Заказа",
            "oneOf": [
              {
                "$ref": "#/components/schemas/DealKinds"
              }
            ]
          }
        }
      },
      "ShortLoadView": {
        "type": "object",
        "description": "Краткая информация по грузу",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "ID груза",
            "format": "guid"
          },
          "load_number": {
            "type": "string",
            "description": "Сгенерированный номер груза"
          },
          "distance": {
            "type": "integer",
            "description": "Расстояние для груза\n            \n*При расчете учитываются дополнительные пункты разгрузки*",
            "format": "int32"
          },
          "distance_type": {
            "type": "integer",
            "description": "Маршрут построен с проездом по МКАД или без МКАД\n            \n* `0` — без МКАД\n* `1` — с МКАД",
            "format": "int32"
          },
          "platon_roads_length": {
            "type": "integer",
            "description": "Расстояние по Платону",
            "format": "int32"
          },
          "toll_roads_length": {
            "type": "integer",
            "description": "Расстояние по платным дорогам",
            "format": "int32"
          },
          "travel_time": {
            "type": "string",
            "description": "Время в пути",
            "format": "duration"
          },
          "true_price": {
            "type": "integer",
            "description": "Озвученная ставка",
            "format": "int32"
          },
          "true_currency_id": {
            "type": "integer",
            "description": "ID валюты озвученной ставки",
            "format": "int32"
          },
          "note": {
            "type": "string",
            "description": "Примечание к грузу"
          },
          "first_date": {
            "type": "string",
            "description": "Дата, начиная с которой груз актуален",
            "format": "date-time"
          },
          "last_date": {
            "type": "string",
            "description": "Дата, после которой груз не актуален",
            "format": "date-time"
          },
          "date_type": {
            "$ref": "#/components/schemas/DateType"
          },
          "periodicity_id": {
            "$ref": "#/components/schemas/Periodicity"
          },
          "order_number": {
            "type": "string",
            "description": "Номер груза/заказа"
          },
          "krugoreis": {
            "type": "boolean",
            "description": "Кругорейс"
          },
          "zimnik": {
            "type": "boolean",
            "description": "Зимники"
          },
          "ferries": {
            "type": "boolean",
            "description": "Паромные переправы"
          },
          "loading": {
            "description": "Точка загрузки",
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoadPoint"
              }
            ]
          },
          "extra_points": {
            "type": "array",
            "description": "Дополнительные точки ",
            "items": {
              "$ref": "#/components/schemas/LoadExtraPoint"
            }
          },
          "unloading": {
            "description": "Точка разгрузки",
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoadPoint"
              }
            ]
          },
          "cargo": {
            "description": "Параметры груза",
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoadCargo"
              }
            ]
          },
          "transport": {
            "description": "Параметры перевозки",
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoadTransport"
              }
            ]
          },
          "unload_first_date": {
            "type": "string",
            "description": "Дата, начиная с которой можно разгрузить груз",
            "format": "date-time",
            "nullable": true
          },
          "unload_last_date": {
            "type": "string",
            "description": "Дата, до которой можно разгрузить груз",
            "format": "date-time",
            "nullable": true
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}