> For the complete documentation index, see [llms.txt](https://sravni-labs-ru.gitbook.io/sravni-labs.ru-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sravni-labs-ru.gitbook.io/sravni-labs.ru-docs/rko/rasschyotno-kassovoe-obsluzhivanie.-openapi-dlya-vashego-biznesa/metody-vzaimodeistviya/zagruzka-dokumentov-dlya-zayavki.md).

# Загрузка документов для заявки

Метод используется для загрузки документов перед созданием заявки.

Авторизация осуществляется по токену с актуальным сроком действия. Его требуется передать в заголовке Authorization при выполнении запроса.

Базовый URL dev: [https://sravni-apigateway-service.dev.sravni-team.ru](https://sravni-apigateway-service.dev.sravni-team.ru/)\
Базовый URL prod: [https://api.sravni.ru](https://api.sravni.ru/)

> Документы необходимо загружать для заявок по предложению `proposition.organization.oldId = 999999`. При выполнении запроса необходимо указывать значение параметра `inn` равное ИНН организации, для которой будет создана заявка. Для заявки по `legalEntity = ip` необходимо загрузить один документ - паспорт `(documentTypeCode = passport)`. Для заявки по `legalEntity = ooo` необходимо загрузить два документа - паспорт `(documentTypeCode = passport)` и файл криптоконтейнера `(documentTypeCode = cryptoContainer)`. В ответе метода возвращается объект с полем `publicId`, который необходимо использовать в теле запроса на создание заявки.

## POST /agents/v1/rko/documents/{inn}/{documentTypeCode}

> Загрузка документа

```json
{"openapi":"3.0.1","info":{"title":"Sravni.ApiGateway.Service 1.0","version":"1.0"},"paths":{"/agents/v1/rko/documents/{inn}/{documentTypeCode}":{"post":{"tags":["Агентский кабинет"],"summary":"Загрузка документа","parameters":[{"name":"inn","in":"path","description":"ИНН","required":true,"schema":{"type":"string"}},{"name":"documentTypeCode","in":"path","description":"Тип документа","required":true,"schema":{"$ref":"#/components/schemas/Sravni.ApiGateway.Service.Agents.Models.Rko.Enums.RkoDocumentTypeCode"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/Sravni.ApiGateway.Service.Agents.Models.Rko.DocumentDto"}},"application/json":{"schema":{"$ref":"#/components/schemas/Sravni.ApiGateway.Service.Agents.Models.Rko.DocumentDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/Sravni.ApiGateway.Service.Agents.Models.Rko.DocumentDto"}}}},"400":{"description":"Bad Request","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/Sravni.Micro.Errors.ErrorModel"}},"application/json":{"schema":{"$ref":"#/components/schemas/Sravni.Micro.Errors.ErrorModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/Sravni.Micro.Errors.ErrorModel"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/Sravni.Micro.Errors.ErrorModel"}},"application/json":{"schema":{"$ref":"#/components/schemas/Sravni.Micro.Errors.ErrorModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/Sravni.Micro.Errors.ErrorModel"}}}}}}}},"components":{"schemas":{"Sravni.ApiGateway.Service.Agents.Models.Rko.Enums.RkoDocumentTypeCode":{"enum":["passport","cryptoContainer"],"type":"string"},"Sravni.ApiGateway.Service.Agents.Models.Rko.DocumentDto":{"required":["publicId"],"type":"object","properties":{"publicId":{"minLength":1,"type":"string"}},"additionalProperties":false},"Sravni.Micro.Errors.ErrorModel":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Sravni.Micro.Errors.Error"}},"additionalProperties":false},"Sravni.Micro.Errors.Error":{"type":"object","properties":{"code":{"type":"string","nullable":true},"target":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"attemptedValue":{"type":"string","nullable":true},"details":{"type":"array","items":{"$ref":"#/components/schemas/Sravni.Micro.Errors.Error"},"nullable":true}},"additionalProperties":false}}}}
```
