> 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/ne-aktualno/business-loans/anketa/post-request-requestid-status.md).

# POST /request/{requestId}/status

Я как Банк хочу отправить актуальный статус заявки

{% hint style="info" %}
Метод для **отправки и актуализации статусов** по созданным заявкам. Банк партнер передает уникальный идентификатор заявки (полученный из метода [**GET /requests**](/sravni-labs.ru-docs/ne-aktualno/business-loans/anketa/get-requests.md)) и информацию о статусе заявки.
{% endhint %}

## **Описание работы**

**Базовый URL dev:** <https://sravni-apigateway-service.dev.sravni-team.ru/business-loans/>

**Базовый URL prod:** [https://api.sravni.ru/business-loans/](https://api-sravni.ru/business-loans/)&#x20;

## POST /v1/requests/{requestId}/status

> Установить статус заявки

```json
{"openapi":"3.0.1","info":{"title":"Sravni.BusinessLoanPartners.Service","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UpdateRequestOuterParameters":{"type":"object","required":["newStatus"],"properties":{"loanAmount":{"type":"number","format":"double"},"loanRate":{"type":"number","format":"double"},"loanTermInDays":{"type":"integer"},"newStatus":{"$ref":"#/components/schemas/BusinessLoanStatusDto"}}},"BusinessLoanStatusDto":{"type":"string","enum":["new","inProgress","documentsRequested","feedbackRequested","clientApproval","waitingForGranting","issued","rejected","preIssued"]},"BusinessLoanRequestDto":{"type":"object","required":["requestInfo","status"],"properties":{"requestId":{"type":"integer"},"status":{"type":"string"},"loanAmount":{"type":"number","format":"double"},"loanTermInDays":{"type":"integer"},"loanRate":{"type":"number","format":"double"},"requestInfo":{"$ref":"#/components/schemas/RequestInfoDto"},"companyInfo":{"$ref":"#/components/schemas/CompanyInfoDto"},"ceoInfo":{"$ref":"#/components/schemas/CeoInfoDto"},"documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentDto"}}}},"RequestInfoDto":{"type":"object","properties":{"inn":{"type":"string"},"fullName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"city":{"type":"string"},"amount":{"type":"number","format":"double"},"loanTermInDays":{"type":"integer"},"loanPurpose":{"type":"string"},"utmSource":{"type":"string"}}},"CompanyInfoDto":{"type":"object","properties":{"registrationAddress":{"type":"string"},"actualAddress":{"type":"string"},"organizationName":{"type":"string"},"mainRoomType":{"type":"string"},"ownershipRoomType":{"type":"string"},"employeesCount":{"type":"integer"},"email":{"type":"string"},"webSiteUrl":{"type":"string"},"isCeoOwner":{"type":"boolean"},"ceoShare":{"type":"number","format":"double"},"ceoPosition":{"type":"string"},"ceoPhone":{"type":"string"},"revenue":{"type":"number","format":"double"},"taxationType":{"type":"string"}}},"CeoInfoDto":{"type":"object","properties":{"education":{"type":"string"},"yearsInBusiness":{"type":"integer"},"yearsAsFounder":{"type":"integer"},"maritalStatus":{"type":"string"},"spouseFullName":{"type":"string"},"spouseBirthdate":{"type":"string","format":"date-time"},"contactPersonFullName":{"type":"string"},"contactPersonPhone":{"type":"string"},"annualIncome":{"type":"number","format":"double"}}},"DocumentDto":{"type":"object","required":["documentName","documentS3Link","fileName"],"properties":{"documentS3Link":{"type":"string"},"documentName":{"type":"string"},"fileName":{"type":"string"}}},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}}}}},"paths":{"/v1/requests/{requestId}/status":{"post":{"tags":["Заявки МСБ"],"summary":"Установить статус заявки","parameters":[{"name":"requestId","in":"path","description":"Id заявки","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"description":"Параметры запроса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestOuterParameters"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessLoanRequestDto"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## **Входные параметры**

<table><thead><tr><th width="53.5999755859375">№</th><th width="156.20001220703125">Параметр</th><th width="115.20001220703125">Тип данных</th><th width="127.4000244140625">Обязательность</th><th>Описание</th><th>Примеры значений</th></tr></thead><tbody><tr><td>1</td><td>requestId</td><td>number</td><td>да</td><td>Идентификатор заявки</td><td>555</td></tr><tr><td>2</td><td>loanAmount</td><td>number</td><td>нет</td><td>Сумма выданного кредита</td><td>500000</td></tr><tr><td>3</td><td>loanRate</td><td>number</td><td>нет</td><td>Ставка выданного кредита</td><td>17</td></tr><tr><td>4</td><td>loanTermInDays</td><td>number</td><td>нет</td><td>Срок выданного кредита</td><td>360</td></tr><tr><td>5</td><td>newStatus</td><td>string</td><td>да</td><td>Статус заявки</td><td>issued</td></tr></tbody></table>

## **Проверки**

| Параметр       | Проверка                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| requestId      | <p>Обязательное поле.</p><p><br></p><p>Если передано неизвестное значение идентификатора заявки:</p><ul><li>Сервис возвращает ошибку с кодом 400 и описанием ошибки</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                 |
| loanAmount     | Ожидаем получить заполненный параметр при отправке статуса issued                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| loanRate       | Ожидаем получить заполненный параметр при отправке статуса issued                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| loanTermInDays | Ожидаем получить заполненный параметр при отправке статуса issued                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| newStatus      | <p>Обязательное поле.</p><p><br></p><p>Если передано значение статуса не из перечисленных ниже:</p><ul><li>Сервис возвращает ошибку с кодом 400 и описанием ошибки</li></ul><p><br></p><p>Обрабатываемые статусы:</p><ul><li>inProgress - заявка создалась внутри систем Партнера и находится в работе</li><li>issued - по заявке произошла выдача, финальный статус</li><li>rejected - заявка отклонена, финальный статус</li></ul><p>Остальные статусы из модели - наши внутренние. Однако есть возможность договориться об их совместном использовании по потребности.</p> |

## **Выходные параметры**

В ответе возвращаются параметры аналогичные ответу метода GET /requests
