{"openapi":"3.1.0","info":{"title":"Патентометр. API расчёта стоимости патента","version":"1.0.0","description":"Стоимость до вычета взносов по обычной ставке ПСН. Доход, каникулы и право на патент проверяются отдельно."},"servers":[{"url":"https://patentometr.ru"}],"paths":{"/api/v1/patent/calculate":{"post":{"operationId":"calculatePatent","summary":"Рассчитать стоимость патента для ИП в России","description":"Допустимые годы: 2026, 2027. Даты включаются в срок. ID регионов доступны по адресу https://patentometr.ru/api-rascheta/regions.json. Для подбора ID передайте известные поля: 422 содержит issues с вариантами и вопросами. Передайте JSON до 8192 байт.","externalDocs":{"url":"https://patentometr.ru/api-rascheta/"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"region":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$","description":"Двузначный код региона или его адресный идентификатор."},"activity":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$","description":"Адресный идентификатор вида деятельности в регионе."},"row":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$","description":"Строка тарифа, если у вида несколько применимых строк."},"territory":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$","description":"Тарифная территория для выбранного вида."},"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"value":{"type":"number","minimum":0,"description":"Площадь, число объектов, транспортных средств или другой показатель тарифа."},"employees":{"type":"integer","minimum":0,"description":"Наёмные работники. Для тарифов, которые зависят от найма, явно передайте 0 при их отсутствии."},"vehicles":{"type":"integer","minimum":1,"description":"Количество машин или судов при тарифе по характеристике одного транспортного средства."}},"required":["start","end"]},"example":{"region":"77","activity":"razrabotka-po","start":"2027-01-01","end":"2027-12-31"}}}},"responses":{"200":{"description":"Стоимость за указанный срок","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"api":{"type":"integer","const":1},"dataVersion":{"type":"string","pattern":"^[a-f0-9]{12}$"},"ok":{"type":"boolean","const":true},"amountRub":{"type":"integer"},"currency":{"type":"string","const":"RUB"},"ratePercent":{"type":"number"},"status":{"type":"string","enum":["verified","law","mismatch","estimated"]},"statusLabel":{"type":"string"},"lawAmountRub":{"type":"integer"},"lawAnnualAmountRub":{"type":"integer"},"term":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"days":{"type":"integer"}},"required":["start","end","days"]},"choice":{"type":"object","additionalProperties":false,"properties":{"region":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]},"activity":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]},"row":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]},{"type":"null"}]},"territory":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]},{"type":"null"}]},"indicator":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"label":{"type":"string"},"unit":{"type":"string"},"value":{"type":"number"}},"required":["label","unit","value"]},{"type":"null"}]},"vehicles":{"anyOf":[{"type":"integer"},{"type":"null"}]},"employees":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["region","activity","row","territory","indicator","vehicles","employees"]},"source":{"type":"object","additionalProperties":false,"properties":{"dataYear":{"type":"integer"},"dataCheckedAt":{"type":"string","format":"date"},"basis":{"type":"string","enum":["fns","estimate","regional_law"]},"regionalLaw":{"type":"object","additionalProperties":false,"properties":{"citation":{"type":"string"},"number":{"type":"string"},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"amendmentUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]}},"required":["citation","number","url","amendmentUrl"]},"fnsSnapshot":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"year":{"type":"integer"},"checkedAt":{"type":"string","format":"date"},"url":{"type":"string","format":"uri"},"usedForResult":{"type":"boolean"}},"required":["year","checkedAt","url","usedForResult"]},{"type":"null"}]},"regionalPage":{"type":"string","format":"uri"},"methodologyUrl":{"type":"string","format":"uri"}},"required":["dataYear","dataCheckedAt","basis","regionalLaw","fnsSnapshot","regionalPage","methodologyUrl"]},"conditions":{"type":"object","additionalProperties":false,"properties":{"eligibilityChecked":{"type":"boolean","const":false},"maxAverageEmployees":{"type":"integer"},"annualIncomeLimitRub":{"type":"integer"},"notes":{"type":"array","items":{"type":"string"}},"filing":{"type":"object","additionalProperties":false,"properties":{"asOf":{"type":"string","format":"date"},"status":{"type":"string","enum":["started","late","tight","in_time"]},"recommendedDay":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"fnsDay":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}},"required":["asOf","status","recommendedDay","fnsDay"]}},"required":["eligibilityChecked","maxAverageEmployees","annualIncomeLimitRub","notes","filing"]},"calculationUrl":{"type":"string","format":"uri"}},"required":["api","dataVersion","ok","amountRub","currency","ratePercent","status","statusLabel","term","choice","source","conditions","calculationUrl"]}}}},"400":{"description":"Некорректный JSON","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ok":{"type":"boolean","const":false},"api":{"type":"integer","const":1},"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["invalid_json"]},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"field":{"type":"string","enum":["region","activity","row","territory","start","end","value","employees","vehicles","calculator"]},"message":{"type":"string"},"options":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","label"]}},"optionsUrl":{"type":"string","format":"uri"},"indicator":{"type":"object","additionalProperties":false,"properties":{"kind":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"minExclusive":{"type":"boolean"},"integer":{"type":"boolean"}},"required":["kind","label","unit","min","max","minExclusive","integer"]}},"required":["field","message"]}},"calculationUrl":{"type":"string","format":"uri"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["code","message","issues"]}},"required":["ok","api","error"]}}}},"413":{"description":"Слишком большой запрос","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ok":{"type":"boolean","const":false},"api":{"type":"integer","const":1},"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"field":{"type":"string","enum":["region","activity","row","territory","start","end","value","employees","vehicles","calculator"]},"message":{"type":"string"},"options":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","label"]}},"optionsUrl":{"type":"string","format":"uri"},"indicator":{"type":"object","additionalProperties":false,"properties":{"kind":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"minExclusive":{"type":"boolean"},"integer":{"type":"boolean"}},"required":["kind","label","unit","min","max","minExclusive","integer"]}},"required":["field","message"]}},"calculationUrl":{"type":"string","format":"uri"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["code","message","issues"]}},"required":["ok","api","error"]}}}},"415":{"description":"Ожидается application/json","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ok":{"type":"boolean","const":false},"api":{"type":"integer","const":1},"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"field":{"type":"string","enum":["region","activity","row","territory","start","end","value","employees","vehicles","calculator"]},"message":{"type":"string"},"options":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","label"]}},"optionsUrl":{"type":"string","format":"uri"},"indicator":{"type":"object","additionalProperties":false,"properties":{"kind":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"minExclusive":{"type":"boolean"},"integer":{"type":"boolean"}},"required":["kind","label","unit","min","max","minExclusive","integer"]}},"required":["field","message"]}},"calculationUrl":{"type":"string","format":"uri"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["code","message","issues"]}},"required":["ok","api","error"]}}}},"422":{"description":"Запрос требует исправления, уточнения или расчёт недоступен","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ok":{"type":"boolean","const":false},"api":{"type":"integer","const":1},"dataVersion":{"type":"string","pattern":"^[a-f0-9]{12}$"},"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["invalid_input","clarification_required","unavailable"]},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"field":{"type":"string","enum":["region","activity","row","territory","start","end","value","employees","vehicles","calculator"]},"message":{"type":"string"},"options":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","label"]}},"optionsUrl":{"type":"string","format":"uri"},"indicator":{"type":"object","additionalProperties":false,"properties":{"kind":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"minExclusive":{"type":"boolean"},"integer":{"type":"boolean"}},"required":["kind","label","unit","min","max","minExclusive","integer"]}},"required":["field","message"]}},"calculationUrl":{"type":"string","format":"uri"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["code","message","issues"]}},"required":["ok","api","dataVersion","error"]}}}},"429":{"description":"Превышена частота запросов","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ok":{"type":"boolean","const":false},"api":{"type":"integer","const":1},"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"field":{"type":"string","enum":["region","activity","row","territory","start","end","value","employees","vehicles","calculator"]},"message":{"type":"string"},"options":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","label"]}},"optionsUrl":{"type":"string","format":"uri"},"indicator":{"type":"object","additionalProperties":false,"properties":{"kind":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"minExclusive":{"type":"boolean"},"integer":{"type":"boolean"}},"required":["kind","label","unit","min","max","minExclusive","integer"]}},"required":["field","message"]}},"calculationUrl":{"type":"string","format":"uri"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["code","message","issues"]}},"required":["ok","api","error"]}}}},"503":{"description":"Сервис расчёта временно недоступен","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ok":{"type":"boolean","const":false},"api":{"type":"integer","const":1},"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unavailable"]},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"field":{"type":"string","enum":["region","activity","row","territory","start","end","value","employees","vehicles","calculator"]},"message":{"type":"string"},"options":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","label"]}},"optionsUrl":{"type":"string","format":"uri"},"indicator":{"type":"object","additionalProperties":false,"properties":{"kind":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"minExclusive":{"type":"boolean"},"integer":{"type":"boolean"}},"required":["kind","label","unit","min","max","minExclusive","integer"]}},"required":["field","message"]}},"calculationUrl":{"type":"string","format":"uri"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["code","message","issues"]}},"required":["ok","api","error"]}}}}}}},"/api-rascheta/regions.json":{"get":{"operationId":"listPatentRegions","summary":"Справочник кодов регионов и лет","responses":{"200":{"description":"Справочник регионов","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"api":{"type":"integer","const":1},"dataVersion":{"type":"string","pattern":"^[a-f0-9]{12}$"},"supportedYears":{"type":"array","items":{"type":"integer"}},"regions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"},"slug":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"},"label":{"type":"string"},"dataYears":{"type":"array","items":{"type":"integer"}},"catalogUrl":{"type":"string","format":"uri"}},"required":["id","slug","label","dataYears","catalogUrl"]}}},"required":["api","dataVersion","supportedYears","regions"]}}}}}}}}}