{
  "openapi": "3.1.1",
  "info": {
    "title": "api/goslog",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/gw/goslog/v1/expeditors/lookup": {
      "get": {
        "tags": [
          "GoslogIntegration"
        ],
        "summary": "Возвращает записи экспедиторов из реестра ГосЛог для указанного ИНН.",
        "operationId": "get_v1_expeditors_lookup",
        "parameters": [
          {
            "name": "inn",
            "in": "query",
            "description": "ИНН юрлица (10 цифр) или ИП (12 цифр). Пример: 5256167583",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "5256167583"
          }
        ],
        "responses": {
          "200": {
            "description": "Записи реестра экспедиторов",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoslogExpeditorLookupBatchResponse"
                },
                "example": {
                  "expeditors": [
                    {
                      "registry_number": "string",
                      "included_at": "string",
                      "ogrn": "string",
                      "inn": "string"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ИНН должен содержать 10 или 12 цифр",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "ИНН должен содержать 10 или 12 цифр"
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": [
              "null",
              "string"
            ],
            "description": "Код ошибки",
            "example": "string"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Текст ошибки для пользователя",
            "example": "string"
          }
        },
        "additionalProperties": false,
        "description": "Стандартный ответ API при ошибке",
        "example": {
          "error": "string",
          "reason": "string"
        }
      },
      "GoslogExpeditorLookupBatchResponse": {
        "required": [
          "expeditors"
        ],
        "type": "object",
        "properties": {
          "expeditors": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/GoslogExpeditorLookupItem"
            },
            "description": "Экспедиторы, найденные в реестре (порядок не гарантируется)",
            "example": [
              {
                "registry_number": "string",
                "included_at": "string",
                "ogrn": "string",
                "inn": "string"
              }
            ]
          }
        },
        "additionalProperties": false,
        "description": "Ответ на запрос поиска экспедиторов по ИНН",
        "example": {
          "expeditors": [
            {
              "registry_number": "string",
              "included_at": "string",
              "ogrn": "string",
              "inn": "string"
            }
          ]
        }
      },
      "GoslogExpeditorLookupItem": {
        "required": [
          "included_at",
          "inn",
          "registry_number"
        ],
        "type": "object",
        "properties": {
          "registry_number": {
            "type": [
              "null",
              "string"
            ],
            "description": "Реестровый номер записи",
            "example": "string"
          },
          "included_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "Дата включения в реестр (ISO формат)",
            "example": "string"
          },
          "ogrn": {
            "type": [
              "null",
              "string"
            ],
            "description": "ОГРН",
            "example": "string"
          },
          "inn": {
            "type": [
              "null",
              "string"
            ],
            "description": "ИНН",
            "example": "string"
          }
        },
        "additionalProperties": false,
        "description": "Запись экспедитора в ответе lookup",
        "example": {
          "registry_number": "string",
          "included_at": "string",
          "ogrn": "string",
          "inn": "string"
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}