Skip to content

Update a tenant's mutable fields

PATCH
/v1/tenants/{id}
curl --request PATCH \
--url https://api.emite.cr/v1/tenants/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "id": "01a00c73-5c09-7bb5-8b9e-d91c43bd61dc", "identificationType": "01", "identificationNumber": "3101234567", "name": "Futurabyte CR S.A.", "commercialName": "Futurabyte", "economicActivityCode": "6201.0", "location": { "provincia": "1", "canton": "01", "distrito": "01", "barrio": "Carmen", "otrasSenas": "50 metros norte de la iglesia, edificio azul" }, "phoneCountryCode": "506", "phoneNumber": "22223333", "phone": "50622223333", "email": "ventas@emite.cr", "notificationEmail": "notificaciones@emite.cr", "otrasSenasExtranjero": "1234 Ocean Ave, Miami, FL 33101, USA" }'

Changes only the fields sent among commercialName, location (replaced as a whole), phoneCountryCode, phoneNumber, email (an empty one is ignored) and notificationEmail ("" or null clears it); the other fields of the body are ignored, and a field the body does not define answers 400. identificationType, identificationNumber and name cannot change here (400 IMMUTABLE_FIELD) — POST /:id/hacienda-sync takes name from Hacienda's registry. Returns the company as GET /tenants/me does.

id
required
string
Media typeapplication/json
object
id

Not used: ignored when a company is created, and kept as sent in the inline party of a document.

string
Example
01a00c73-5c09-7bb5-8b9e-d91c43bd61dc
identificationType

Hacienda identification type: 01 cédula física, 02 cédula jurídica, 03 DIMEX, 04 NITE, 05 foreign (extranjero no domiciliado), 06 no contribuyente. Only 01–04 with an all-digit number can issue documents, because the clave embeds it.

string
Allowed values: 01 02 03 04 05 06
Example
02
identificationNumber

Number of that identification, without separators, normalized to uppercase. Its format depends on identificationType: 01 9 digits; 02 10 positions — from 2026-11-01 the last six may be alphanumeric (decree 44648-MJ), e.g. 3101A1B2C3, which can receive documents but not issue them; 03 11–12 digits; 04 10 digits; 05 up to 20 letters, digits or hyphens; 06 9–12 digits.

string
Example
3101234567
name

Legal name (razón social) — <Nombre> in the XML, cut to 100 characters. A company's name cannot change through PATCH /tenants/:id (400 IMMUTABLE_FIELD): POST /tenants/:id/hacienda-sync takes it from Hacienda's registry.

string
Example
Futurabyte CR S.A.
commercialName

Trade name — <NombreComercial> in the XML when present, cut to 80 characters.

string
Example
Futurabyte
economicActivityCode

Only when creating a company: becomes its default economic activity, in Hacienda's dotted form (e.g. 6201.0). Ignored afterwards — activities are managed in /tenants/:tenantId/economic-activities — and in a document's inline party, whose activity is the document's economicActivityCodeReceptor.

string
Example
6201.0
location

Address in Costa Rica — <Ubicacion> in the XML. A company cannot issue without it (422 TENANT_LOCATION_MISSING). In a document it is never written for a 05 party; in a purchase invoice (FEC), a supplier of type 01–04 must carry it (400 SUPPLIER_LOCATION_REQUIRED).

object
provincia
required

Provincia code of Hacienda's location codification, one digit: 1 San José, 2 Alajuela, 3 Cartago, 4 Heredia, 5 Guanacaste, 6 Puntarenas, 7 Limón. GET /v1/catalogs/locations lists every code.

string
Example
1
canton
required

Cantón code within that provincia, two digits (01, 02…).

string
Example
01
distrito
required

Distrito code within that cantón, two digits (01, 02…).

string
Example
01
barrio

Neighborhood (barrio), by name — <Barrio>, which Hacienda requires to be 5–50 characters when present.

string
Example
Carmen
otrasSenas

The rest of the address, free text — <OtrasSenas>, 5–250 characters in Hacienda's schema (cut to 250). Without it the XML says «Sin otras señas», since the element is mandatory.

string
Example
50 metros norte de la iglesia, edificio azul
phoneCountryCode

Dial code without "+" (1-3 digits).

string
nullable
Example
506
phoneNumber

National number, digits only (5-20).

string
nullable
Example
22223333
phone

Deprecated: a legacy single-string phone (+506 22223333). Send phoneCountryCode + phoneNumber instead; this one is only parsed for the XML when those are absent.

string
Example
50622223333
email

Email address — <CorreoElectronico> in the XML. For a company, its main address and where its notices go when notificationEmail is empty; for a document's customer, where the accepted document is emailed.

string
Example
ventas@emite.cr
notificationEmail

Company only: a separate address for the system's notices to it (rejections, errors, summaries…). Set it with PATCH /tenants/:id; "" or null clears it and the notices go back to email. Ignored on creation and in a document's party.

string
nullable
Example
notificaciones@emite.cr
otrasSenasExtranjero

Address abroad, free text — <OtrasSenasExtranjero>, 5–300 characters in Hacienda's schema. Written only for a foreign (05) party, and required when that party is the supplier of a purchase invoice (400 SUPPLIER_FOREIGN_ADDRESS_REQUIRED).

string
Example
1234 Ocean Ave, Miami, FL 33101, USA
Media typeapplication/json
object
id
required

Id of the company — the {id} / {tenantId} of the tenant routes.

string format: uuid
identificationType
required

Hacienda identification type of the company: 01 cédula física, 02 cédula jurídica, 03 DIMEX, 04 NITE (05 and 06 are accepted at creation but cannot issue documents). Fixed once created.

string
Allowed values: 01 02 03 04 05 06
identificationNumber
required

Its identification number, without separators — the <Emisor> identification of its documents, embedded in every clave. Fixed once created.

string
name
required

Legal name (razón social), <Nombre> of the <Emisor>. Changes only through POST /tenants/{id}/hacienda-sync, which takes it from Hacienda's registry.

string
commercialName
required

Trade name, <NombreComercial> of its documents; null when it has none.

string
nullable
economicActivityCode
required

Deprecated: the same value as defaultEconomicActivityCode, kept for old clients.

string
nullable
defaultEconomicActivityCode
required

Code of its default economic activity — the <CodigoActividadEmisor> a document declares when it names none. null when no activity is the default (a document that names none is then refused with 412 TENANT_NOT_CONFIGURED).

string
nullable
location
required

Address of the company, <Ubicacion> of the <Emisor>. provincia, canton and distrito are empty strings until the company sets it, and it cannot issue until then (422 TENANT_LOCATION_MISSING).

object
provincia
required

Provincia code of Hacienda's location codification, one digit: 1 San José, 2 Alajuela, 3 Cartago, 4 Heredia, 5 Guanacaste, 6 Puntarenas, 7 Limón. GET /v1/catalogs/locations lists every code.

string
canton
required

Cantón code within that provincia, two digits (01, 02…).

string
distrito
required

Distrito code within that cantón, two digits (01, 02…).

string
barrio

Neighborhood (barrio), by name — <Barrio>, which Hacienda requires to be 5–50 characters when present.

string
otrasSenas

The rest of the address, free text — <OtrasSenas>, 5–250 characters in Hacienda's schema (cut to 250). Without it the XML says «Sin otras señas», since the element is mandatory.

string
phoneCountryCode
required

Dial code of its phone, without + (e.g. 506); null without a phone.

string
nullable
phoneNumber
required

Its phone number, digits only — <Telefono> of its documents; null without one.

string
nullable
email
required

Main email address of the company — <CorreoElectronico> of the <Emisor>, and where its notices go when notificationEmail is null. An empty string for a company created without one.

string
notificationEmail
required

A separate address for the system's notices to the company (rejections, errors, summaries…); null when its notices go to email.

string
nullable
logoStorageKey
required

Storage key of the company's logo (a PNG); null without a logo. The image itself is served by GET /tenants/{id}/logo/raw.

string
nullable
branches
required

Its branches (deleted ones left out). A company starts with branch 001 «Casa Matriz».

Array<object>
object
id
required

Id of the branch — the {branchId} of the branch and terminal routes.

string format: uuid
code
required

Branch number, 3 digits: the first three digits of every consecutivo issued from it, and the branchCode a document names to be issued from it. Fixed once created.

string
name
required

Name of the branch, for the app and the API; documents do not show it.

string
isDefault
required

Whether it is the company's default branch — the one a document uses when it names no branchCode. At most one branch is the default; with none, creating a document that names no branch answers 412 TENANT_NOT_CONFIGURED.

boolean
terminals
required

Its terminals, of every branch (branchId says which; deleted ones left out). A company starts with terminal 00001 «Terminal Principal» in branch 001.

Array<object>
object
id
required

Id of the terminal — the {terminalId} of the terminal routes.

string format: uuid
branchId
required

Id of the branch the terminal belongs to.

string format: uuid
code
required

Terminal number, 5 digits: the five digits after the branch code in every consecutivo issued from it, and the terminalCode a document names to be issued from it. Unique within its branch; fixed once created.

string
name
required

Name of the terminal, for the app and the API; documents do not show it.

string
isDefault
required

Whether it is its branch's default terminal — the one a document of that branch uses when it names no terminalCode. At most one per branch; with none, creating a document of that branch that names no terminal answers 412 TENANT_NOT_CONFIGURED.

boolean
economicActivities
required

Its economic activities registered with Hacienda; at most one is the default.

Array<object>
object
id
required

Id of the activity in the company; PATCH …/{activityId}/default takes it.

string format: uuid
code
required

Hacienda's economic activity code, in the dotted form its registry returns. The default one is what documents declare as <CodigoActividadEmisor>.

string
description
required

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.

string
nullable
isDefault
required

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.

boolean
Example
{
"identificationType": "01",
"identificationNumber": "3101234567",
"name": "Futurabyte CR S.A.",
"commercialName": "Futurabyte",
"economicActivityCode": "6201.0",
"defaultEconomicActivityCode": "6201.0",
"location": {
"provincia": "1",
"canton": "01",
"distrito": "01",
"barrio": "Carmen",
"otrasSenas": "50 metros norte de la iglesia, edificio azul"
},
"phoneCountryCode": "506",
"phoneNumber": "22223333",
"email": "ventas@emite.cr",
"notificationEmail": "notificaciones@emite.cr",
"branches": [
{
"code": "001",
"name": "Casa Matriz"
}
],
"terminals": [
{
"code": "00001",
"name": "Terminal Principal"
}
],
"economicActivities": [
{
"code": "6201.0",
"description": "Programación de computadoras"
}
]
}

IMMUTABLE_FIELD when trying to change the identification or the name.