Set the fiscal profile
const url = 'https://api.emite.cr/v1/fiscal/profile';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"regime":"tradicional","hasEmployees":true,"withholdsIncomeTax":true,"obligationCodes":["102","150","270"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.emite.cr/v1/fiscal/profile \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "regime": "tradicional", "hasEmployees": true, "withholdsIncomeTax": true, "obligationCodes": [ "102", "150", "270" ] }'Omitting obligationCodes seeds the selection from the answers; sending it empty means explicitly none, which is a different answer and is honored. Codes outside the catalog are dropped silently so a retired obligation never blocks saving.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The company's income tax and IVA regime, which decides the family of returns suggested (codes for a persona física / a cédula jurídica 02):
tradicional— the general regime: income tax101/102and the monthly IVA150.simplificado— the simplified regime, with returns of its own:104/105and153, never150.agropecuario— the agricultural regime: income tax101/102and the IVA returns151(every four months) and152(annual).
Example
tradicionalWhether the company has employees: adds the return for income tax withheld at source on salaries to the suggestions (137, or 138 for a cédula jurídica).
Whether the company withholds at source 3 % of income tax from its suppliers: adds that withholding return to the suggestions (144, or 145 for a cédula jurídica).
The TRIBU-CR codes of the obligations the company confirms apply to it, at most 200. This list, not the three answers, is what the calendar follows. Omitted, it is replaced by the suggestion derived from the answers — on every save, so send it to keep a selection; an empty list explicitly means none. Codes outside the catalog are dropped silently, and the list is stored deduplicated and sorted.
Example
[ "102", "150", "270"]Responses
Section titled “Responses”object
false while the company has never saved its profile: the answers are then the defaults (tradicional, no employees, no withholding), obligationCodes is the suggestion the calendar runs on, and a client should ask to configure it.
The saved tax regime (see PUT /v1/fiscal/profile); tradicional until saved.
The saved answer; false until the profile is saved.
The saved answer; false until the profile is saved.
TRIBU-CR codes the calendar follows: the saved selection, sorted by code, or the suggestion while the profile is not configured.
The obligations the answers and the company's identification type suggest, each with its reason. A starting point, deliberately inclusive, and not tax advice.
object
TRIBU-CR code of the suggested obligation.
Why it was suggested (a stable key):
entity_type— by the identification type: the income tax return (101/102) outside the simplified regime and, for a cédula jurídica, the tax on legal entities (169) and the Timbre de Educación y Cultura (175).regime— by the tax regime: the IVA returns, and every return of the simplified regime.employees— the company has employees (hasEmployees).withholding— the company withholds 3 % of income tax (withholdsIncomeTax).universal— suggested to every company (today270, the informative summary of customers, suppliers and specific expenses).
The suggested obligations that are not in obligationCodes: how a newly imported obligation, or a change in the answers, reaches a company that already configured its profile. Nothing is ever removed from the selection on its own.
object
TRIBU-CR code of the suggested obligation.
Why it was suggested (a stable key):
entity_type— by the identification type: the income tax return (101/102) outside the simplified regime and, for a cédula jurídica, the tax on legal entities (169) and the Timbre de Educación y Cultura (175).regime— by the tax regime: the IVA returns, and every return of the simplified regime.employees— the company has employees (hasEmployees).withholding— the company withholds 3 % of income tax (withholdsIncomeTax).universal— suggested to every company (today270, the informative summary of customers, suppliers and specific expenses).
When the profile was last saved; null while it is not configured.
Example
{ "regime": "tradicional", "suggested": [ { "code": "150", "reason": "entity_type" } ], "missing": [ { "code": "150", "reason": "entity_type" } ]}