> 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/kredity-dlya-biznesa-s-podpisaniem-dokumentov-na-storone-partnyora/tekhnicheskaya-dokumentaciya/orders/sozdat-kreditnuyu-zayavku.md).

# Создать кредитную заявку

Принимает `application/json` с данными заявки. Документы в этом запросе не передаются — они загружаются отдельным шагом после того, как одно или несколько предложений банков (`offers[]` в ответе `GET /v1/orders/{orderId}`) перейдут в статус `WAITING_FOR_DOCUMENTS` (см. `POST /v1/orders/{orderId}/documents`).

`sourceOrderId` является ключом идемпотентности в пределах партнёра. Повтор с тем же ID и идентичным содержимым возвращает ранее созданную заявку; повтор с отличающимся содержимым возвращает `409`.

```json
{"openapi":"3.1.0","info":{"title":"API интеграции с партнёрами","version":"2.0.0"},"tags":[{"name":"Orders","description":"Методы создания, отслеживания и подтверждения одобренных кредитных предложений"}],"servers":[{"url":"https://sandbox-api.example.ru","description":"Тестовая среда"},{"url":"https://api.example.ru","description":"Промышленная среда"}],"security":[{"OAuth2":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","description":"OAuth 2.0 client credentials для партнёрского API. Полученный access-токен передаётся во всех методах, кроме `/oauth2/token`, в заголовке `Authorization: Bearer <access_token>`. ","flows":{"clientCredentials":{"tokenUrl":"https://auth.example.ru/oauth2/token","scopes":{}}}}},"schemas":{"OrderCreateRequest":{"type":"object","additionalProperties":false,"required":["sourceOrderId","borrowerType","product","company","persons"],"properties":{"sourceOrderId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9._:-]+$","description":"Уникальный идентификатор заявки в системе партнёра"},"borrowerType":{"$ref":"#/components/schemas/BorrowerType"},"product":{"$ref":"#/components/schemas/ProductRequest"},"company":{"$ref":"#/components/schemas/CompanyCreate"},"persons":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/PersonCreate"}},"legalOwners":{"type":"array","items":{"$ref":"#/components/schemas/LegalOwnerCreate"},"description":"Владельцы заёмщика — юридические лица"}},"allOf":[{"if":{"properties":{"borrowerType":{"const":"LEGAL_ENTITY"}},"required":["borrowerType"]},"then":{"properties":{"company":{"required":["kpp","legalFormCode"]},"persons":{"contains":{"type":"object","properties":{"roles":{"contains":{"const":"CEO"}}},"required":["roles"]},"minContains":1,"maxContains":1}}}},{"if":{"properties":{"borrowerType":{"const":"INDIVIDUAL_ENTREPRENEUR"}},"required":["borrowerType"]},"then":{"properties":{"company":{"allOf":[{"not":{"required":["kpp"]}},{"not":{"required":["legalFormCode"]}}]},"persons":{"contains":{"type":"object","properties":{"roles":{"contains":{"const":"ENTREPRENEUR"}}},"required":["roles"]},"minContains":1,"maxContains":1}}}}]},"BorrowerType":{"type":"string","enum":["INDIVIDUAL_ENTREPRENEUR","LEGAL_ENTITY"]},"ProductRequest":{"type":"object","additionalProperties":false,"required":["amount","termMonths"],"properties":{"amount":{"type":"integer","minimum":1,"description":"Запрашиваемая сумма в рублях без разделителей разрядов"},"termMonths":{"type":"integer","minimum":1,"maximum":120}}},"CompanyCreate":{"type":"object","additionalProperties":false,"required":["entityId","inn","ogrn","fullName","businessTypeCode","businessTypeName","registrationDate","registrationAddress","businessAddresses","phone","email"],"properties":{"entityId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9._:-]+$","description":"Идентификатор компании на стороне партнёра. Используется для идентификации сущности и привязки загружаемых документов"},"inn":{"type":"string","pattern":"^\\d{10}(\\d{2})?$","description":"ИНН — 10 цифр для юридического лица, 12 для ИП"},"ogrn":{"type":"string","pattern":"^\\d{13}(\\d{2})?$","description":"ОГРН — 13 цифр, ОГРНИП — 15 цифр"},"kpp":{"type":"string","pattern":"^\\d{9}$","description":"Обязателен для юридического лица и не передаётся для ИП"},"fullName":{"type":"string","minLength":1,"maxLength":512},"legalFormCode":{"type":"string","minLength":1,"maxLength":16,"description":"Код организационно-правовой формы; обязателен для юридического лица"},"businessTypeCode":{"type":"string","minLength":1,"maxLength":32,"description":"Код основного вида деятельности"},"businessTypeName":{"type":"string","minLength":1,"maxLength":512,"description":"Наименование основного вида деятельности"},"registrationDate":{"type":"string","format":"date"},"registrationAddress":{"$ref":"#/components/schemas/Address"},"businessAddresses":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/Address"}},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"email":{"type":"string","format":"email"}}},"Address":{"type":"object","additionalProperties":false,"required":["fullAddress","countryCode"],"properties":{"fullAddress":{"type":"string","minLength":1,"maxLength":1000,"description":"Адрес одной строкой"},"parsedAddress":{"type":"string","minLength":1,"maxLength":1000,"description":"Нормализованное представление адреса, если есть у партнёра"},"countryCode":{"type":"string","const":"RU","description":"Код страны ISO 3166-1 alpha-2; в `v2` поддерживается `RU`"}}},"PersonCreate":{"type":"object","additionalProperties":false,"required":["entityId","roles","lastName","firstName","birthDate","regAddressDate","birthPlace","gender","citizenship","phone","passport","registrationAddress","actualSameAsRegistration"],"properties":{"entityId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9._:-]+$","description":"Идентификатор физического лица на стороне партнёра. Используется для идентификации сущности и привязки загружаемых документов"},"roles":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["ENTREPRENEUR","CEO","OWNER","GUARANTOR"]}},"sharePercent":{"type":"number","minimum":0,"maximum":100,"multipleOf":0.01,"description":"Обязательно для роли `OWNER`"},"lastName":{"type":"string","minLength":1,"maxLength":100},"firstName":{"type":"string","minLength":1,"maxLength":100},"middleName":{"type":"string","minLength":1,"maxLength":100},"birthDate":{"type":"string","format":"date"},"regAddressDate":{"type":"string","format":"date","description":"Дата регистрации по адресу в формате YYYY-MM-DD"},"birthPlace":{"type":"string","minLength":1,"maxLength":255},"gender":{"type":"string","enum":["MALE","FEMALE"]},"citizenship":{"type":"string","enum":["RU"],"description":"Гражданство. В текущей версии поддерживается только `RU`"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"email":{"type":"string","format":"email"},"passport":{"$ref":"#/components/schemas/Passport"},"registrationAddress":{"$ref":"#/components/schemas/Address"},"actualSameAsRegistration":{"type":"boolean"},"actualAddress":{"$ref":"#/components/schemas/Address"}},"allOf":[{"if":{"properties":{"actualSameAsRegistration":{"const":false}},"required":["actualSameAsRegistration"]},"then":{"required":["actualAddress"]}},{"if":{"properties":{"roles":{"contains":{"const":"OWNER"}}},"required":["roles"]},"then":{"required":["sharePercent"]}}]},"Passport":{"type":"object","additionalProperties":false,"required":["series","number","issueDate","issuedBy","departmentCode"],"properties":{"series":{"type":"string","pattern":"^\\d{4}$"},"number":{"type":"string","pattern":"^\\d{6}$"},"issueDate":{"type":"string","format":"date"},"issuedBy":{"type":"string","minLength":1,"maxLength":512},"departmentCode":{"type":"string","pattern":"^\\d{3}-\\d{3}$"}}},"LegalOwnerCreate":{"type":"object","additionalProperties":false,"required":["entityId","fullName","inn","ogrn","registrationAddress","sharePercent"],"properties":{"entityId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9._:-]+$","description":"Идентификатор владельца на стороне партнёра. Используется для идентификации сущности и привязки загружаемых документов"},"fullName":{"type":"string","minLength":1,"maxLength":512},"inn":{"type":"string","pattern":"^\\d{10}$"},"ogrn":{"type":"string","pattern":"^\\d{13}$"},"registrationAddress":{"$ref":"#/components/schemas/Address"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"sharePercent":{"type":"number","minimum":0,"maximum":100,"multipleOf":0.01}}},"OrderCreateResponse":{"type":"object","required":["orderId","sourceOrderId","status"],"properties":{"orderId":{"type":"string","format":"uuid"},"sourceOrderId":{"type":"string"},"status":{"$ref":"#/components/schemas/OrderStatus","description":"Как правило со значением `code=IN_WORK` сразу после создания заявки."}}},"OrderStatus":{"type":"object","description":"Статус обработки предложения банка (`BankOffer.status`). Этот же формат `{code, description}` используется и в `OrderCreateResponse.status` сразу после создания заявки — как общий начальный индикатор (`code: IN_WORK`), ещё до того как в `offers[]` появятся записи по конкретным банкам. Типичный переход для одного предложения:\n\nIN_WORK → VALIDATION_FAILED | WAITING_FOR_DOCUMENTS → IN_WORK (после accept) → VALIDATION_FAILED | WAITING_FOR_SIGNATURE → IN_WORK (после загрузки подписей) → OFFERS_AVAILABLE → REJECTED | OFFERS_CONFIRMED → CLOSED.\n\nКаждое предложение банка проходит этот путь независимо от остальных: одни банки могут ещё запрашивать документы или проверять их, пока другие уже отклонили заявку, ждут подписания или предложили условия. `OFFERS_AVAILABLE` означает, что банк сформировал кредитное предложение и оно доступно для выбора. После успешного `POST /v1/orders/{orderId}/confirm` предложение переходит в `OFFERS_CONFIRMED`. Дополнительные вызовы `confirm` для оставшихся вариантов условий со статусом `AVAILABLE` допускаются, пока предложение не перешло в `CLOSED`. `REJECTED` означает, что банк отклонил заявку по этому предложению (на любом этапе обработки, до или после появления кредитных условий). `CLOSED` означает, что банк выдал кредит клиенту по этому предложению.","required":["code","description"],"properties":{"code":{"type":"string","enum":["IN_WORK","WAITING_FOR_DOCUMENTS","VALIDATION_FAILED","WAITING_FOR_SIGNATURE","OFFERS_AVAILABLE","REJECTED","OFFERS_CONFIRMED","CLOSED"]},"description":{"type":"string","minLength":1,"description":"Человекочитаемое описание статуса для отображения партнёру"}}},"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","details"],"properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Z][A-Z0-9_]*$"},"message":{"type":"string","minLength":1},"details":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}}}}}},"ErrorDetail":{"type":"object","required":["code","message"],"properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}}}},"responses":{"BadRequest":{"description":"Некорректный JSON, multipart или параметры запроса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Unauthorized":{"description":"Bearer-токен отсутствует, недействителен или истёк","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Forbidden":{"description":"Недостаточно прав для выполнения операции","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"ValidationError":{"description":"Запрос синтаксически корректен, но не прошёл проверку","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"TooManyRequests":{"description":"Превышен лимит запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"InternalError":{"description":"Внутренняя ошибка сервиса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"ServiceUnavailable":{"description":"Сервис временно недоступен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"paths":{"/v1/orders":{"post":{"tags":["Orders"],"operationId":"createOrder","summary":"Создать кредитную заявку","description":"Принимает `application/json` с данными заявки. Документы в этом запросе не передаются — они загружаются отдельным шагом после того, как одно или несколько предложений банков (`offers[]` в ответе `GET /v1/orders/{orderId}`) перейдут в статус `WAITING_FOR_DOCUMENTS` (см. `POST /v1/orders/{orderId}/documents`).\n\n`sourceOrderId` является ключом идемпотентности в пределах партнёра. Повтор с тем же ID и идентичным содержимым возвращает ранее созданную заявку; повтор с отличающимся содержимым возвращает `409`. ","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreateRequest"}}}},"responses":{"200":{"description":"Идемпотентный повтор — возвращена ранее созданная заявка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreateResponse"}}}},"201":{"description":"Заявка создана и принята в обработку","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Конфликт `sourceOrderId` — уже использован для другого содержимого","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}}}
```
