{
  "openapi": "3.0.0",
  "info": {
    "title": "api/catalogs/firm-search",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1.0/firms/search/summaries-emails": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SummaryWithContactsPublicFirmSummarySearchResultElement"
                  },
                  "type": "array"
                }
              }
            },
            "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": [
          "FirmSummarySearch"
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "description": "Адреса электронной почты",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "application/json": {
              "schema": {
                "description": "Адреса электронной почты",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "application/json-patch+json": {
              "schema": {
                "description": "Адреса электронной почты",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "text/json": {
              "schema": {
                "description": "Адреса электронной почты",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            }
          },
          "description": "Адреса электронной почты",
          "required": true
        },
        "summary": "Групповое получение краткой информации о фирмаx по email"
      }
    },
    "/v1.0/firms/search/summaries": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AffiliatedFirmPublicAccountSummaryPublicFirmSummarySearchResultElement"
                  },
                  "type": "array"
                }
              }
            },
            "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": [
          "FirmSummarySearch"
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "description": "Список ИНН",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "application/json": {
              "schema": {
                "description": "Список ИНН",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "application/json-patch+json": {
              "schema": {
                "description": "Список ИНН",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "text/json": {
              "schema": {
                "description": "Список ИНН",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            }
          },
          "description": "Список ИНН",
          "required": true
        },
        "summary": "Групповое получение краткой информации о фирмаx по ИНН"
      }
    },
    "/v1.0/firms/search/summary": {
      "get": {
        "parameters": [
          {
            "description": "Номер телефона",
            "in": "query",
            "name": "phone",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ИНН",
            "in": "query",
            "name": "inn",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SummaryWithContactsPublic"
                  },
                  "type": "array"
                }
              }
            },
            "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": [
          "FirmSummarySearch"
        ],
        "summary": "Получение краткой информации о фирме по номеру телефона или ИНН"
      }
    }
  },
  "components": {
    "schemas": {
      "AffiliatedFirmPublic": {
        "description": "Связанная фирма",
        "properties": {
          "firm_name": {
            "description": "Название фирмы",
            "type": "string"
          },
          "inn": {
            "description": "ИНН",
            "type": "string"
          },
          "tf_firm_color": {
            "description": "Цвет фирмы в светофоре",
            "type": "string"
          },
          "tf_has_signals": {
            "description": "Флаг о существовании любой информации о фирме в светофоре",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "AffiliatedFirmPublicAccountSummaryPublic": {
        "properties": {
          "address": {
            "description": "Адрес фирмы",
            "type": "string"
          },
          "affiliated_firms": {
            "description": "Список связанных фирм *Доступно только платным пользователям",
            "items": {
              "$ref": "#/components/schemas/AffiliatedFirmPublic"
            },
            "type": "array"
          },
          "ati_id": {
            "description": "Код в ATI.SU.",
            "type": "string"
          },
          "bad_partner_mentions_count": {
            "description": "Количество упоминаний на форуме недобросовестных партнеров",
            "format": "int32",
            "type": "integer"
          },
          "city": {
            "description": "Город, в котором расположена фирма",
            "type": "string"
          },
          "claims_count": {
            "description": "Количество претензий от фирм",
            "format": "int32",
            "type": "integer"
          },
          "contact_info_changed": {
            "description": "Дата последних изменений в истории фирмы. *Доступно только платным пользователям",
            "format": "date-time",
            "type": "string"
          },
          "firm_documents": {
            "description": "Документы фирмы",
            "items": {
              "$ref": "#/components/schemas/FirmDocument"
            },
            "type": "array"
          },
          "firm_type": {
            "description": "Профиль деятельности фирмы",
            "type": "string"
          },
          "firm_type_id": {
            "description": "Идентификатор профиля деятельности фирмы",
            "type": "string"
          },
          "full_name": {
            "description": "Полное имя фирмы: Брэнд (Название фирмы, ОПФ)",
            "type": "string"
          },
          "info_reference": {
            "description": "Ссылка на карточку фирмы",
            "type": "string"
          },
          "inn": {
            "description": "Инн",
            "type": "string"
          },
          "kpp": {
            "description": "Код причины постановки на учёт фирмы",
            "type": "string"
          },
          "last_month_active_days": {
            "description": "Число дней со входами на сайт за последние 30 дней. *Доступно только платным пользователям",
            "format": "int32",
            "type": "integer"
          },
          "location": {
            "$ref": "#/components/schemas/City"
          },
          "negative_points_sum": {
            "description": "Сумма отрицательных баллов",
            "format": "double",
            "type": "number"
          },
          "ogrn": {
            "description": "ОГРН",
            "type": "string"
          },
          "okpo": {
            "description": "Общероссийский классификатор предприятий и организаций",
            "type": "string"
          },
          "passport_reference": {
            "description": "Ссылка на паспорт фирмы",
            "type": "string"
          },
          "position_in_city": {
            "description": "Место в рейтинге по городу",
            "format": "int32",
            "type": "integer"
          },
          "position_in_country": {
            "description": "Место в рейтинге по стране",
            "format": "int32",
            "type": "integer"
          },
          "recommendations_count": {
            "description": "Количество рекомендаций от фирм",
            "format": "int32",
            "type": "integer"
          },
          "registration_date": {
            "description": "Дата регистрации на сайте, которая AddDate из firms.",
            "format": "date-time",
            "type": "string"
          },
          "score": {
            "description": "Количество звёзд фирмы. Если число отрицательно, то это красные звёзды",
            "format": "double",
            "type": "number"
          },
          "tf_account_color": {
            "description": "Цвет аккаунта в светофоре *Доступно только платным пользователям",
            "type": "string"
          },
          "tf_firm_color": {
            "description": "Цвет фирмы в светофоре *Доступно только платным пользователям",
            "type": "string"
          },
          "tf_has_signals": {
            "description": "Флаг о существовании любой информации о фирме в светофоре",
            "type": "boolean"
          },
          "verified_trucks": {
            "description": "Количество зарегистрированных ТС",
            "format": "int32",
            "type": "integer"
          },
          "web_site": {
            "description": "Сайт фирмы",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AffiliatedFirmPublicAccountSummaryPublicFirmSummarySearchResultElement": {
        "properties": {
          "key": {
            "description": "Ключ",
            "type": "string"
          },
          "value": {
            "description": "Значение",
            "items": {
              "$ref": "#/components/schemas/AffiliatedFirmPublicAccountSummaryPublic"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "City": {
        "description": "Структура \"Город\"",
        "properties": {
          "attributes": {
            "$ref": "#/components/schemas/CityAttributes"
          },
          "city_id": {
            "description": "Идентификатор города",
            "format": "int32",
            "type": "integer"
          },
          "city_name": {
            "description": "Название города",
            "type": "string"
          },
          "city_size": {
            "description": "Размер города по числу жителей.",
            "format": "int32",
            "type": "integer"
          },
          "country_code_name": {
            "description": "Буквенный код страны (например, RUS)",
            "type": "string"
          },
          "country_id": {
            "description": "Идентификатор страны",
            "format": "int32",
            "type": "integer"
          },
          "country_name": {
            "description": "Название страны",
            "type": "string"
          },
          "fias_id": {
            "description": "Идентификатор населенного пункта",
            "format": "uuid",
            "type": "string"
          },
          "full_name": {
            "description": "Составное название состоящее из названий города, региона и страны разделенные через запятую.",
            "type": "string"
          },
          "is_regional_center": {
            "description": "Флаг - является ли город региональным центром",
            "type": "boolean"
          },
          "region_id": {
            "description": "Идентификатор региона",
            "format": "int32",
            "type": "integer"
          },
          "region_name": {
            "description": "Название региона",
            "type": "string"
          },
          "short_name": {
            "description": "Составное название состоящее из названия города,\r\nназвания региона (если город не является областным центром)\r\nи буквенного кода страны (если страна отличается от России).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CityAttributes": {
        "enum": [
          0,
          4
        ],
        "format": "int32",
        "type": "integer"
      },
      "ErrorResponse": {
        "properties": {
          "error": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "FirmDocument": {
        "properties": {
          "creation_date": {
            "description": "Дата создания документа.",
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "description": "Автогенерируемое описание документа.",
            "type": "string"
          },
          "link": {
            "description": "Ссылка на документ.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SummaryWithContactsPublic": {
        "properties": {
          "address": {
            "description": "Адрес фирмы",
            "type": "string"
          },
          "affiliated_firms": {
            "description": "Список связанных фирм *Доступно только платным пользователям",
            "items": {
              "$ref": "#/components/schemas/AffiliatedFirmPublic"
            },
            "type": "array"
          },
          "ati_id": {
            "description": "Код в ATI.SU.",
            "type": "string"
          },
          "bad_partner_mentions_count": {
            "description": "Количество упоминаний на форуме недобросовестных партнеров",
            "format": "int32",
            "type": "integer"
          },
          "city": {
            "description": "Город, в котором расположена фирма",
            "type": "string"
          },
          "claims_count": {
            "description": "Количество претензий от фирм",
            "format": "int32",
            "type": "integer"
          },
          "contact_info_changed": {
            "description": "Дата последних изменений в истории фирмы. *Доступно только платным пользователям",
            "format": "date-time",
            "type": "string"
          },
          "contact_names": {
            "description": "Имена контактов",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "firm_documents": {
            "description": "Документы фирмы",
            "items": {
              "$ref": "#/components/schemas/FirmDocument"
            },
            "type": "array"
          },
          "firm_type": {
            "description": "Профиль деятельности фирмы",
            "type": "string"
          },
          "firm_type_id": {
            "description": "Идентификатор профиля деятельности фирмы",
            "type": "string"
          },
          "full_name": {
            "description": "Полное имя фирмы: Брэнд (Название фирмы, ОПФ)",
            "type": "string"
          },
          "info_reference": {
            "description": "Ссылка на карточку фирмы",
            "type": "string"
          },
          "inn": {
            "description": "Инн",
            "type": "string"
          },
          "kpp": {
            "description": "Код причины постановки на учёт фирмы",
            "type": "string"
          },
          "last_month_active_days": {
            "description": "Число дней со входами на сайт за последние 30 дней. *Доступно только платным пользователям",
            "format": "int32",
            "type": "integer"
          },
          "location": {
            "$ref": "#/components/schemas/City"
          },
          "negative_points_sum": {
            "description": "Сумма отрицательных баллов",
            "format": "double",
            "type": "number"
          },
          "ogrn": {
            "description": "ОГРН",
            "type": "string"
          },
          "okpo": {
            "description": "Общероссийский классификатор предприятий и организаций",
            "type": "string"
          },
          "passport_reference": {
            "description": "Ссылка на паспорт фирмы",
            "type": "string"
          },
          "position_in_city": {
            "description": "Место в рейтинге по городу",
            "format": "int32",
            "type": "integer"
          },
          "position_in_country": {
            "description": "Место в рейтинге по стране",
            "format": "int32",
            "type": "integer"
          },
          "query_first_change_date": {
            "description": "Даты первого добавления искомого параметра поиска (email, phone, inn)",
            "format": "date-time",
            "type": "string"
          },
          "recommendations_count": {
            "description": "Количество рекомендаций от фирм",
            "format": "int32",
            "type": "integer"
          },
          "registration_date": {
            "description": "Дата регистрации на сайте, которая AddDate из firms.",
            "format": "date-time",
            "type": "string"
          },
          "score": {
            "description": "Количество звёзд фирмы. Если число отрицательно, то это красные звёзды",
            "format": "double",
            "type": "number"
          },
          "tf_account_color": {
            "description": "Цвет аккаунта в светофоре *Доступно только платным пользователям",
            "type": "string"
          },
          "tf_firm_color": {
            "description": "Цвет фирмы в светофоре *Доступно только платным пользователям",
            "type": "string"
          },
          "tf_has_signals": {
            "description": "Флаг о существовании любой информации о фирме в светофоре",
            "type": "boolean"
          },
          "verified_trucks": {
            "description": "Количество зарегистрированных ТС",
            "format": "int32",
            "type": "integer"
          },
          "web_site": {
            "description": "Сайт фирмы",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SummaryWithContactsPublicFirmSummarySearchResultElement": {
        "properties": {
          "key": {
            "description": "Ключ",
            "type": "string"
          },
          "value": {
            "description": "Значение",
            "items": {
              "$ref": "#/components/schemas/SummaryWithContactsPublic"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}