{"openapi":"3.0.1","info":{"title":"2.61 Самозанятые. Доходы","description":"2.61 Самозанятые. Регистрация, привязка, доходы, уведомления","contact":{"name":"Владимир Манзюк","url":"https://wiki.corp.dev.vtb/pages/viewpage.action?pageId=226628804","email":"Manzuk@vtb.ru"},"version":"1.0.0"},"servers":[{"url":"http://subo-smz-backend.apps.d0-oscp.corp.dev.vtb/api/income/v1","description":"Generated server url"}],"security":[{"EpaAuth":[],"basicAuth":[],"clientId":[]}],"tags":[{"name":"income-register","description":"Регистрация дохода пользователем"},{"name":"income-list","description":"Список доходов пользователя"},{"name":"income-image","description":"Получение файла чека"},{"name":"income-status","description":"Получение информации о лицевом счете НП НПД"},{"name":"income-cancel","description":"Отмена дохода пользователем"}],"paths":{"/income":{"get":{"tags":["income-list"],"operationId":"list","parameters":[{"name":"from","in":"query","description":"Дата и время начала периода","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"Дата и время окончания периода","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","description":"Количество чеков в запросе","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"name":"nextPageToken","in":"query","description":"Токен для получения следующей страницы из выдачи. При наличии остальные параметры игнорируются","required":false,"schema":{"maxLength":36,"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IncomeListResponse"}}}}}},"post":{"tags":["income-register"],"operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncomeRegistrationRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/NotRegisteredIncomeRegistrationResponse"},{"$ref":"#/components/schemas/RegisteredIncomeRegistrationResponse"}]}}}}}}},"/income/{receiptId}/cancel":{"post":{"tags":["income-cancel"],"operationId":"cancel","parameters":[{"name":"receiptId","in":"path","description":"Идентификатор чека","required":true,"schema":{"maxLength":36,"minLength":1,"type":"string"},"example":"d2f3x4s"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncomeCancelRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IncomeCancelResponse"}}}}}}},"/income/{receiptId}":{"get":{"tags":["income-list"],"operationId":"receipt","parameters":[{"name":"receiptId","in":"path","description":"ID чека","required":true,"schema":{"maxLength":36,"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IncomeListResponseItem"}}}}}}},"/income/{receiptId}/image":{"get":{"tags":["income-image"],"operationId":"image","parameters":[{"name":"receiptId","in":"path","description":"Идентификатор чека","required":true,"schema":{"maxLength":36,"minLength":1,"type":"string"},"example":"dsf344s"}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IncomeImageResponse"}}}}}}},"/income/status":{"get":{"tags":["income-status"],"operationId":"status","parameters":[{"name":"period","in":"query","description":"Период","required":false,"schema":{"maxLength":7,"pattern":"^[0-9]{4}-[0-9]{2}$","type":"string"},"example":"2020-01"}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IncomeStatusResponse"}}}}}}}},"components":{"schemas":{"IncomeRegistrationRequest":{"required":["incomeType","regTime","services"],"type":"object","properties":{"regTime":{"maxLength":2147483647,"type":"string","description":"Дата формирования чека","format":"date-time"},"incomeType":{"maxLength":2147483647,"type":"string","description":"Тип источника дохода","enum":["FROM_INDIVIDUAL","FROM_LEGAL_ENTITY","FROM_FOREIGN_AGENCY"]},"customerInn":{"maxLength":255,"type":"string","description":"ИНН покупателя для юридического лица","example":"1234567890"},"customerOrganization":{"maxLength":255,"type":"string","description":"Наименование покупателя для юридического лица или иностранной организации","example":"ООО РОМАШКА"},"services":{"maxItems":100,"type":"array","description":"Список услуг","items":{"$ref":"#/components/schemas/Service"}},"idempotenceKey":{"maxLength":36,"type":"string","description":"Ключ идемпотентности","example":"123e4567-e89b-12d3-a456-426655440000"}},"additionalProperties":false,"description":"Запрос на регистрацию дохода"},"Service":{"required":["amount","name"],"type":"object","properties":{"amount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Цена","example":66965},"name":{"maxLength":255,"type":"string","description":"Наименование","example":"Мойка стёкол"}},"additionalProperties":false,"description":"Услуга"},"NotRegisteredIncomeRegistrationResponse":{"required":["bankInn","bankName","fio","inn","link","receiptId","regTime","services","status","taxType","totalAmount"],"type":"object","properties":{"receiptId":{"maxLength":255,"type":"string","description":"Идентификатор чека","example":"sdhsdsadfg"},"link":{"maxLength":255,"type":"string","description":"Ссылка на чек","example":"https://ssylka.na.check.ru"},"regTime":{"maxLength":2147483647,"type":"string","description":"Дата формирования чека","format":"date-time"},"fio":{"maxLength":255,"type":"string","description":"Фамилия Имя Отчество самозанятого","example":"Марувов Олег Яковлевич"},"services":{"maxItems":100,"type":"array","description":"Список услуг","items":{"$ref":"#/components/schemas/Service"}},"totalAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Итоговая сумма","example":66565885},"taxType":{"maxLength":255,"type":"string","description":"Налоговый режим","example":"НПД"},"inn":{"maxLength":12,"type":"string","description":"ИНН самозанятого","example":"123012312345677"},"bankInn":{"maxLength":255,"type":"string","description":"ИНН банка, задается параметром","example":"9876543210"},"bankName":{"maxLength":255,"type":"string","description":"Название банка, задается параметром","example":"ВБТ"},"customerInn":{"maxLength":255,"type":"string","description":"ИНН покупателя для юридического лица","example":"36652145875114"},"customerOrganization":{"maxLength":255,"type":"string","description":"Наименование покупателя для юридического лица или иностранной организации","example":"Майкрософт"},"status":{"maxLength":2147483647,"type":"string","description":"Статус дохода","enum":["NOT_REGISTERED","REGISTERED","FAILED","DELETED"]}},"additionalProperties":false,"description":"Не зарегистрированный доход"},"RegisteredIncomeRegistrationResponse":{"required":["link","receiptId","status"],"type":"object","properties":{"receiptId":{"maxLength":255,"type":"string","description":"Идентификатор чека","example":"sdhsdsadfg"},"link":{"maxLength":255,"type":"string","description":"Ссылка на чек","example":"https://ssylka.na.check.ru"},"status":{"maxLength":2147483647,"type":"string","description":"Статус","example":"REGISTERED","enum":["NOT_REGISTERED","REGISTERED","FAILED","DELETED"]}},"additionalProperties":false,"description":"Регистрация дохода"},"IncomeCancelRequest":{"required":["reason"],"type":"object","properties":{"reason":{"maxLength":255,"type":"string","description":"Причина аннулирования чека","example":"REGISTRATION_MISTAKE"}},"additionalProperties":false,"description":"Запрос Причина аннулирования"},"IncomeCancelResponse":{"required":["result"],"type":"object","properties":{"result":{"maxLength":255,"type":"string","description":"Результат операции","example":"DELETED"}},"additionalProperties":false,"description":"Причина аннулирования"},"IncomeListResponse":{"required":["items"],"type":"object","properties":{"nextPageToken":{"maxLength":36,"type":"string","description":"Токен который нужно отправить в запросе для получения следующей страницы. В случае значения null - достигнут конец страницы","example":"14344343-e89b-12d3-a456-426614174000"},"items":{"type":"array","description":"Список чеков","items":{"$ref":"#/components/schemas/IncomeListResponseItem"}}},"additionalProperties":false,"description":"Список доходов"},"IncomeListResponseItem":{"required":["incomeType","link","receiptId","regTime","services","status","totalAmount"],"type":"object","properties":{"receiptId":{"maxLength":255,"type":"string","description":"Идентификатор чека","example":"sdhsdsadfg"},"link":{"maxLength":255,"type":"string","description":"Ссылка на чек","example":"https://ssylka.na.check.ru"},"incomeType":{"maxLength":2147483647,"type":"string","description":"Тип источника дохода","enum":["FROM_INDIVIDUAL","FROM_LEGAL_ENTITY","FROM_FOREIGN_AGENCY"]},"status":{"maxLength":2147483647,"type":"string","description":"Статус чека","example":"REGISTERED","enum":["NOT_REGISTERED","REGISTERED","FAILED","DELETED"]},"services":{"type":"array","description":"Список товаров и услуг","items":{"$ref":"#/components/schemas/IncomeListResponseItemService"}},"totalAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Итоговая сумма","example":66565885},"regTime":{"maxLength":2147483647,"type":"string","description":"Дата и время формирования чека","format":"date-time"},"cancellationTime":{"maxLength":2147483647,"type":"string","description":"Дата и время аннулирования чека","format":"date-time"}},"additionalProperties":false,"description":"Чек","anyOf":[{"$ref":"#/components/schemas/RegisteredItem"},{"$ref":"#/components/schemas/NotRegisteredItem"}]},"IncomeListResponseItemService":{"required":["amount","name"],"type":"object","properties":{"amount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Цена","example":66965},"name":{"maxLength":255,"type":"string","description":"Наименование","example":"Мойка стёкол"}},"additionalProperties":false,"description":"Товар и услуга"},"NotRegisteredItem":{"required":["bankInn","bankName","fio","incomeType","inn","link","receiptId","regTime","services","status","taxType","totalAmount"],"type":"object","properties":{"receiptId":{"maxLength":255,"type":"string","description":"Идентификатор чека","example":"sdhsdsadfg"},"link":{"maxLength":255,"type":"string","description":"Ссылка на чек","example":"https://ssylka.na.check.ru"},"incomeType":{"maxLength":2147483647,"type":"string","description":"Тип источника дохода","enum":["FROM_INDIVIDUAL","FROM_LEGAL_ENTITY","FROM_FOREIGN_AGENCY"]},"status":{"maxLength":2147483647,"type":"string","description":"Статус чека","example":"NOT_REGISTERED","enum":["NOT_REGISTERED","REGISTERED","FAILED","DELETED"]},"services":{"type":"array","description":"Список товаров и услуг","items":{"$ref":"#/components/schemas/IncomeListResponseItemService"}},"totalAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Итоговая сумма","example":66565885},"regTime":{"maxLength":2147483647,"type":"string","description":"Дата и время формирования чека","format":"date-time"},"cancellationTime":{"maxLength":2147483647,"type":"string","description":"Дата и время аннулирования чека","format":"date-time"},"fio":{"maxLength":255,"type":"string","description":"Фамилия Имя Отчество самозанятого","example":"Марувов Олег Яковлевич"},"taxType":{"maxLength":255,"type":"string","description":"Налоговый режим","example":"НПД"},"inn":{"maxLength":12,"type":"string","description":"ИНН самозанятого","example":"123012312345677"},"bankInn":{"maxLength":255,"type":"string","description":"ИНН банка, задается параметром","example":"9876543210"},"bankName":{"maxLength":255,"type":"string","description":"Название банка, задается параметром","example":"ВБТ"},"customerInn":{"maxLength":255,"type":"string","description":"ИНН покупателя для юридического лица","example":"36652145875114"},"customerOrganization":{"maxLength":255,"type":"string","description":"Наименование покупателя для юридического лица или иностранной организации","example":"Майкрософт"}},"additionalProperties":false,"description":"Незарегистрированный доход"},"RegisteredItem":{"required":["incomeType","link","receiptId","regTime","services","status","totalAmount"],"type":"object","properties":{"receiptId":{"maxLength":255,"type":"string","description":"Идентификатор чека","example":"sdhsdsadfg"},"link":{"maxLength":255,"type":"string","description":"Ссылка на чек","example":"https://ssylka.na.check.ru"},"incomeType":{"maxLength":2147483647,"type":"string","description":"Тип источника дохода","enum":["FROM_INDIVIDUAL","FROM_LEGAL_ENTITY","FROM_FOREIGN_AGENCY"]},"status":{"maxLength":2147483647,"type":"string","description":"Статус чека","example":"REGISTERED","enum":["NOT_REGISTERED","REGISTERED","FAILED","DELETED"]},"services":{"type":"array","description":"Список товаров и услуг","items":{"$ref":"#/components/schemas/IncomeListResponseItemService"}},"totalAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Итоговая сумма","example":66565885},"regTime":{"maxLength":2147483647,"type":"string","description":"Дата и время формирования чека","format":"date-time"},"cancellationTime":{"maxLength":2147483647,"type":"string","description":"Дата и время аннулирования чека","format":"date-time"}},"additionalProperties":false,"description":"Зарегистрированный доход"},"IncomeImageResponse":{"required":["file"],"type":"object","properties":{"file":{"maxLength":255,"type":"string","description":"base64 закодированная png картинка","example":"sdgaekhy23lkh45ewdssgb23kl41"}},"additionalProperties":false,"description":"PDF квитанция"},"IncomeStatusResponse":{"required":["bonusAmount","canceledAmount","debtAmount","taxAmount","totalAmount","unpaidAmount"],"type":"object","properties":{"totalAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Доход за период, в копейках","example":15893},"canceledAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Сторнированный доход за период, в копейках","example":15893},"taxAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Налог за период, в копейках","example":15893},"bonusAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Сумма бонусного счета, в копейках","example":15893},"unpaidAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Неоплаченные платежи, в копейках","example":15893},"debtAmount":{"maximum":9223372036854776000,"minimum":0,"type":"integer","description":"Сумма задолженности, в копейках","example":15893}},"additionalProperties":false,"description":"Запрос на статус регистрации дохода"}},"parameters":{"uuid":{"name":"UUID","in":"path","description":"UUID","required":true,"schema":{"maxLength":36,"type":"string"}}},"securitySchemes":{"EpaAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"basicAuth":{"type":"http","scheme":"basic"},"clientId":{"type":"apiKey","name":"X-MDM-ID","in":"header"}}}}