Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "swagger": "2.0",
- "info": {
- "description": "API взаимодействия между ЛК «Заемщика» и Партнером",
- "version": "1.0.0",
- "title": "API взаимодействия между ЛК «Заемщика» и Партнером"
- },
- "host": "partner-url.com",
- "basePath": "/v1",
- "tags": [
- {
- "name": "register_new_loan",
- "description": "Регистрация займа"
- },
- {
- "name": "cancel_request",
- "description": "Отменить заявку"
- },
- {
- "name": "get_loan_deals_status",
- "description": "Получение статусов по заявкам"
- },
- {
- "name": "settings_detail",
- "description": "Получение настроек по займам"
- }
- ],
- "schemes": [
- "https"
- ],
- "paths": {
- "/register_new_loan": {
- "post": {
- "tags": [
- "register_new_loan"
- ],
- "summary": "Регистрация заявки на займ",
- "description": "Регистрация заявки на займ в системе партнера",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "body",
- "name": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/LoanRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Заявка на займ успешно зарегистрирована",
- "schema": {
- "$ref": "#/definitions/LoanCreateResponse200"
- }
- },
- "400": {
- "description": "Ошибка на стороне клиента. Например, отсутствует один или более обязательных параметров запроса, формат или комбинация параметров некорректны",
- "schema": {
- "$ref": "#/definitions/ErroResponse"
- }
- },
- "500": {
- "description": "Ошибка на стороне партнера",
- "schema": {
- "$ref": "#/definitions/ErroResponse"
- }
- }
- }
- }
- },
- "/cancel_request": {
- "post": {
- "tags": [
- "cancel_request"
- ],
- "summary": "Отмена заявки",
- "description": "Отмена заявки по инициативе заемщика.\n\nУ клиента в ЛК «Заемщика» есть возможность отменять заявку до выдачи займа (статус `completed`).\n",
- "parameters": [
- {
- "in": "body",
- "name": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "loan_id"
- ],
- "properties": {
- "loan_id": {
- "type": "string",
- "example": "11-23123",
- "description": "Идентификатор заявки в системе партнера"
- }
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Заявка на займ успешно удалена",
- "schema": {
- "type": "object",
- "required": [
- "success"
- ],
- "properties": {
- "success": {
- "type": "boolean",
- "example": "true"
- }
- }
- }
- },
- "400": {
- "description": "Ошибка на стороне клиента. Например, отсутствует один или более обязательных параметров запроса, формат или комбинация параметров некорректны",
- "schema": {
- "$ref": "#/definitions/ErroResponse"
- }
- },
- "500": {
- "description": "Ошибка на стороне партнера",
- "schema": {
- "$ref": "#/definitions/ErroResponse"
- }
- }
- }
- }
- },
- "/get_loan_deals_status": {
- "post": {
- "tags": [
- "get_loan_deals_status"
- ],
- "summary": "Получение статусов по заявкам",
- "description": "Система в виде ЛК «Заемщика» с определенной периодичностью запрашивает у системы «Партнера» статусы заявок за определенный период для синхронизации статусов заявок в ЛК «Заемщика»",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "body",
- "name": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/Period"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Список заявок у которых изменился статус за указанный период",
- "schema": {
- "$ref": "#/definitions/LoanDetails"
- }
- },
- "400": {
- "description": "Ошибка на стороне клиента. Например, отсутствует один или более обязательных параметров запроса, формат или комбинация параметров некорректны",
- "schema": {
- "$ref": "#/definitions/ErroResponse"
- }
- },
- "500": {
- "description": "Ошибка на стороне партнера",
- "schema": {
- "$ref": "#/definitions/ErroResponse"
- }
- }
- }
- }
- },
- "/settings_detail": {
- "get": {
- "tags": [
- "settings_detail"
- ],
- "summary": "Получение настроек по займам",
- "description": "Система в виде ЛК «Заемщика» с определенной периодичностью запрашивает у системы «Партнера» настройки по займам для их синхронизации в ЛК «Заемщика»",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "responses": {
- "200": {
- "description": "Настройки по займам",
- "schema": {
- "$ref": "#/definitions/SettingsDetail"
- }
- },
- "400": {
- "description": "Ошибка на стороне клиента. Например, отсутствует один или более обязательных параметров запроса, формат или комбинация параметров некорректны",
- "schema": {
- "$ref": "#/definitions/ErroResponse"
- }
- },
- "500": {
- "description": "Ошибка на стороне партнера",
- "schema": {
- "$ref": "#/definitions/ErroResponse"
- }
- }
- }
- }
- }
- },
- "definitions": {
- "LoanRequest": {
- "type": "object",
- "required": [
- "credentials"
- ],
- "properties": {
- "credentials": {
- "$ref": "#/definitions/Credentials"
- },
- "email": {
- "type": "string",
- "format": "email",
- "description": "Email заемщика"
- },
- "inn": {
- "type": "string",
- "pattern": "^[\\d+]{10,12}$",
- "example": "2833909919",
- "description": "ИНН заемщика"
- },
- "phone": {
- "type": "string",
- "example": "+79222222222",
- "description": "Контактный телефон"
- },
- "passport": {
- "$ref": "#/definitions/Passport"
- },
- "requisites": {
- "$ref": "#/definitions/Requisites"
- },
- "inner_id": {
- "type": "string",
- "example": "123456",
- "description": "Внутренний id заёщика в системе Банка"
- },
- "loan": {
- "$ref": "#/definitions/Loan"
- },
- "docs": {
- "$ref": "#/definitions/Docs"
- }
- }
- },
- "Credentials": {
- "type": "object",
- "description": "ФИО заемщика",
- "required": [
- "first_name",
- "second_name"
- ],
- "properties": {
- "first_name": {
- "type": "string",
- "example": "Иванов",
- "description": "Имя клиента"
- },
- "second_name": {
- "type": "string",
- "example": "Иван",
- "description": "Фамилия клиента"
- },
- "last_name": {
- "type": "string",
- "example": "Иванович",
- "description": "Отчество клиента"
- }
- }
- },
- "Passport": {
- "type": "object",
- "description": "Паспортные данные заемщика",
- "required": [
- "serial",
- "number",
- "issue_place",
- "birthday_date",
- "birthday_place"
- ],
- "properties": {
- "serial": {
- "type": "string",
- "example": "1111",
- "description": "Серия паспорта"
- },
- "number": {
- "type": "string",
- "example": "123456",
- "description": "Номер паспорта"
- },
- "issue_place": {
- "type": "string",
- "example": "ОТДЕЛОМ УФМС РОССИИ Бла-Бла",
- "description": "Место выдачи документа"
- },
- "issue_date": {
- "type": "string",
- "format": "date",
- "example": "2012-10-09",
- "description": "Дата выдачи документа"
- },
- "issue_place_code": {
- "type": "string",
- "example": "111",
- "description": "Код подразделения"
- },
- "birthday_date": {
- "type": "string",
- "format": "date",
- "example": "2012-10-09",
- "description": "Дата рождения"
- },
- "birthday_place": {
- "type": "string",
- "example": "РОССИЯ, ГОР. Бла-Бла",
- "description": "Место рождения"
- },
- "registration_address": {
- "type": "string",
- "example": "603105, РОССИЯ, Бла-Бла",
- "description": "Адрес регистрации"
- }
- }
- },
- "Requisites": {
- "type": "object",
- "description": "Банковские реквизиты заемщика",
- "required": [
- "bik",
- "account"
- ],
- "properties": {
- "bik": {
- "type": "string",
- "example": "044525999",
- "description": "БИК счета"
- },
- "account": {
- "type": "string",
- "example": "99999999999999999999",
- "description": "Номер счета"
- }
- }
- },
- "Loan": {
- "type": "object",
- "description": "Займ",
- "required": [
- "type",
- "sum"
- ],
- "properties": {
- "type": {
- "$ref": "#/definitions/LoanType"
- },
- "link": {
- "type": "string",
- "example": "http://zakupki.gov.ru/epz/contract/contractCard/common-info.html?reestrNumber=1246200396217000006",
- "description": "Ссылка на госконтракт или закупку(если тип КИК, то ссылка на гк или закупку, где клиент стал победителем)"
- },
- "sum": {
- "$ref": "#/definitions/Amount"
- },
- "period": {
- "$ref": "#/definitions/Period"
- }
- }
- },
- "Period": {
- "type": "object",
- "description": "Период",
- "required": [
- "dateFrom",
- "dateTill"
- ],
- "properties": {
- "dateFrom": {
- "type": "string",
- "format": "date-time",
- "example": "2012-10-09T00:00:00",
- "description": "Дата с"
- },
- "dateTill": {
- "type": "string",
- "format": "date-time",
- "example": "2012-11-09T00:00:00",
- "description": "Дата по"
- }
- }
- },
- "Docs": {
- "type": "object",
- "description": "Документы",
- "properties": {
- "account_statement": {
- "$ref": "#/definitions/AccountStatement"
- },
- "passport": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/FileObject"
- }
- }
- }
- },
- "AccountStatement": {
- "type": "object",
- "description": "Выписка по всем счетам за последние 12 месяцев",
- "properties": {
- "operation": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Operation"
- }
- }
- }
- },
- "Operation": {
- "type": "object",
- "description": "Операции по выписке",
- "properties": {
- "date": {
- "type": "string",
- "format": "date",
- "example": "2012-11-09",
- "description": "Дата"
- },
- "account": {
- "type": "string",
- "example": "99999999999999999999",
- "description": "Счёт"
- },
- "contractor_name": {
- "type": "string",
- "example": "ОАО «Рога и Копыта»",
- "description": "Название контрагента"
- },
- "contractor_inn": {
- "type": "string",
- "example": "2833909919",
- "description": "ИНН контрагента"
- },
- "write_off": {
- "type": "string",
- "example": "100.99",
- "description": "Списание"
- },
- "admission": {
- "type": "string",
- "example": "100.99",
- "description": "Зачисление"
- },
- "payment_puprose": {
- "type": "string",
- "example": "За оказание услуг № XXX",
- "description": "Назначение платежа"
- }
- }
- },
- "FileObject": {
- "type": "object",
- "description": "Файл",
- "properties": {
- "name": {
- "type": "string",
- "example": "Скан_1",
- "description": "Название файла"
- },
- "format": {
- "type": "string",
- "example": "jpg",
- "description": "Формат файла"
- },
- "source": {
- "type": "string",
- "format": "byte",
- "example": "U3dhZ2dlciByb2Nrcw==",
- "description": "Содержимое файла"
- }
- }
- },
- "LoanCreateResponse200": {
- "type": "object",
- "description": "Заявка на займ успешно зарегистрирована",
- "required": [
- "loan_id",
- "status"
- ],
- "properties": {
- "loan_id": {
- "$ref": "#/definitions/LoanId"
- },
- "status": {
- "$ref": "#/definitions/Status"
- }
- }
- },
- "ErroResponse": {
- "type": "object",
- "description": "Отрицательный ответ",
- "required": [
- "code",
- "message"
- ],
- "properties": {
- "code": {
- "type": "string",
- "example": "Q-123",
- "description": "Код ошибки"
- },
- "message": {
- "type": "string",
- "example": "Не корректное значение в поле xxx",
- "description": "Описание ошибки"
- }
- }
- },
- "Status": {
- "type": "string",
- "description": "Статус заявки\n\n* in_analysis - На рассмотрении\n* rejected - Отказано\n* client_cancel - Отменена клиентом\n* accepted - Одобрена\n* in_progress - Подготовка займа\n* completed - Займ выдан\n",
- "enum": [
- "in_analysis",
- "rejected",
- "client_cancel",
- "accepted",
- "in_progress",
- "completed"
- ]
- },
- "LoanId": {
- "type": "string",
- "example": "11-23123",
- "description": "Идентификатор заявки в системе партнера"
- },
- "LoanDetails": {
- "type": "array",
- "description": "Детали по заявкам",
- "items": {
- "type": "object",
- "required": [
- "code",
- "message"
- ],
- "properties": {
- "status": {
- "$ref": "#/definitions/Status"
- },
- "loan_id": {
- "$ref": "#/definitions/LoanId"
- },
- "created_at": {
- "type": "string",
- "format": "date-time",
- "example": "2012-10-09T00:00:00",
- "description": "Дата создания/регистрации заявки в системе партнера"
- },
- "change_at": {
- "type": "string",
- "format": "date-time",
- "example": "2012-10-09T00:00:00",
- "description": "Дата последнего изменения заявки в системе партнера"
- }
- }
- }
- },
- "LoanType": {
- "type": "string",
- "description": "Тип займа.\n \nВнимание: сейчас в системе реализованы займы только под участие, остальные типы сделаны с запасом на будущее\n\n* participate - Займ на участие\n* kik - Кредит на исполнение\n* express - Экспресс займы\n",
- "enum": [
- "participate",
- "kik",
- "express"
- ]
- },
- "SettingsDetail": {
- "type": "object",
- "description": "Настройки займов",
- "properties": {
- "participate": {
- "$ref": "#/definitions/Setting"
- },
- "kik": {
- "$ref": "#/definitions/Setting"
- },
- "express": {
- "$ref": "#/definitions/Setting"
- }
- }
- },
- "Setting": {
- "type": "object",
- "description": "Настройки\n\n* sum_min - Минимальная сумма\n* sum_max - Максимальная сумма\n",
- "properties": {
- "sum_min": {
- "$ref": "#/definitions/Amount"
- },
- "sum_max": {
- "$ref": "#/definitions/Amount"
- },
- "min_months": {
- "type": "integer",
- "example": 2,
- "description": "Минимальное количество месяцев"
- },
- "max_months": {
- "type": "integer",
- "example": 100,
- "description": "Максимальное количество месяцев"
- },
- "comission": {
- "type": "string",
- "example": "3.2",
- "description": "Комиссия"
- },
- "min_commission": {
- "type": "string",
- "example": "1.2",
- "description": "Минимальная комиссия"
- }
- }
- },
- "Amount": {
- "type": "integer",
- "example": 10010,
- "description": "Сумма с копейками (для передачи целочисленного значения сумма умножается на 100). Например сумма 100.10. То значение будет 10010, 100.10 * 100 = 10010"
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement