Mark an activity as default for new invoices
const url = 'https://api.emite.cr/v1/tenants/example/economic-activities/example/default';const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.emite.cr/v1/tenants/example/economic-activities/example/default \ --header 'Authorization: Bearer <token>'Makes this activity the <CodigoActividadEmisor> a document declares when the request names no activity, and clears the flag on the previous default. Returns the activity (its description comes from Hacienda and cannot be edited). 404 for an activity that is not the company's.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”EconomicActivity UUID.
Responses
Section titled “Responses”object
Id of the activity in the company; PATCH …/{activityId}/default takes it.
Hacienda's economic activity code, in the dotted form its registry returns. The default one is what documents declare as <CodigoActividadEmisor>.
The activity's name, as Hacienda's registry returns it (in Spanish). null for an activity seeded from the company's economicActivityCode at its creation, until the first sync with Hacienda fills it.
Whether documents declare this activity when the request names none. At most one activity of the company is the default; with none, creating a document that names no activity answers 412 TENANT_NOT_CONFIGURED.
Example
{ "code": "6201.0", "description": "Programación de computadoras"}Missing or invalid JWT / API key
Tenant boundary violation or insufficient scope.
No such activity in the company.