Update a party (mutable fields only)
const url = 'https://api.emite.cr/v1/tenants/example/parties/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Distribuidora La Nacional S.A.","commercialName":"La Nacional","email":"compras@lanacional.cr","additionalEmails":["contabilidad@lanacional.cr"],"phoneCountryCode":"506","phoneNumber":"22223333","location":{"provincia":"1","canton":"01","distrito":"01","barrio":"Carmen","otrasSenas":"50 metros norte de la iglesia, edificio azul"},"otrasSenasExtranjero":"1234 Ocean Ave, Miami, FL 33101, USA","isCustomer":true,"isSupplier":false,"notes":"Cliente preferencial — descuento 5%"}'};
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/parties/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Distribuidora La Nacional S.A.", "commercialName": "La Nacional", "email": "compras@lanacional.cr", "additionalEmails": [ "contabilidad@lanacional.cr" ], "phoneCountryCode": "506", "phoneNumber": "22223333", "location": { "provincia": "1", "canton": "01", "distrito": "01", "barrio": "Carmen", "otrasSenas": "50 metros norte de la iglesia, edificio azul" }, "otrasSenasExtranjero": "1234 Ocean Ave, Miami, FL 33101, USA", "isCustomer": true, "isSupplier": false, "notes": "Cliente preferencial — descuento 5%" }'Changes only the fields sent; null clears an optional one. identificationType and identificationNumber are not part of this body — sending them is rejected with 400 as unknown properties. To correct an identification, delete the contact and create it again. Capability flags can be flipped, as long as one of them stays on. Documents already created keep the data they copied.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Tenant UUID.
Party UUID.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Legal name (<Nombre>). Documents already created keep the name they copied; the new one applies to documents created afterwards.
Example
Distribuidora La Nacional S.A.Trade name (<NombreComercial>). null removes it.
Example
La NacionalEmail address for <CorreoElectronico> and for emailing accepted documents. null removes it.
Example
compras@lanacional.crUp to 3 more email addresses, kept for reference only. Replaces the whole list; null removes it.
Example
[ "contabilidad@lanacional.cr"]Country calling code, 1–3 digits with no +. null removes it.
Example
506Phone number, 5–20 digits with no spaces or symbols. null removes it.
Example
22223333Address in Costa Rica, replaced as a whole: provincia, cantón and distrito codes from GET /v1/catalogs/locations plus optional barrio and otrasSenas (a barrio or otrasSenas left out is cleared). null removes the address.
object
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.
Example
1Cantón code within that provincia, two digits (01, 02…).
Example
01Distrito code within that cantón, two digits (01, 02…).
Example
01Neighborhood (barrio), by name — <Barrio>, which Hacienda requires to be 5–50 characters when present.
Example
CarmenThe 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.
Example
50 metros norte de la iglesia, edificio azulAddress abroad for a foreign (05) contact (<OtrasSenasExtranjero>). null removes it.
Example
1234 Ocean Ave, Miami, FL 33101, USAWhether the contact can be the customer of the documents the company issues. Turning off the only role the contact has is rejected (422).
Example
trueWhether the contact is a supplier (the counterpart of a purchase invoice, FEC). Turning off the only role the contact has is rejected (422).
Example
falseInternal notes, never sent to Hacienda nor printed. null removes them.
Example
Cliente preferencial — descuento 5%Responses
Section titled “Responses”The contact after the update.
object
Id of the contact — the receiverId a document names it by.
Hacienda identification type: 01 cédula física, 02 cédula jurídica, 03 DIMEX, 04 NITE, 05 foreigner not domiciled, 06 non-contributor. Fixed once created.
Identification number, upper case and without spaces. Unique per type within the company, and fixed once created.
Legal name of the person or company (<Nombre>).
Trade name (<NombreComercial>); null when it has none.
Email address documents carry (<CorreoElectronico>) and accepted documents are emailed to; null when it has none.
More email addresses, kept for reference only; null when there are none.
Country calling code, digits only; null when not set.
Phone number, digits only; null when not set.
Address in Costa Rica (<Ubicacion>); null when the contact has none.
object
Provincia code, one digit (GET /v1/catalogs/locations).
Cantón code, two digits.
Distrito code, two digits.
Neighborhood (barrio), by name; null when not set.
The rest of the address, free text; null when not set.
Address abroad of a foreign (05) contact; null when not set.
Whether the contact can be the customer of the documents the company issues.
Whether the contact is a supplier (the counterpart of a purchase invoice, FEC).
Internal notes; null when there are none.
When the contact was created (a reactivation keeps the original date).
When the contact last changed.
Example
{ "identificationType": "01", "identificationNumber": "3101234567", "name": "Distribuidora La Nacional S.A.", "commercialName": "La Nacional", "email": "compras@lanacional.cr", "additionalEmails": [ "contabilidad@lanacional.cr" ], "phoneCountryCode": "506", "phoneNumber": "22223333", "location": { "provincia": "1", "canton": "01", "distrito": "01", "barrio": "Carmen", "otrasSenas": "50 metros norte de la iglesia, edificio azul" }, "otrasSenasExtranjero": "1234 Ocean Ave, Miami, FL 33101, USA", "notes": "Cliente preferencial — descuento 5%"}Invalid or unknown fields, or location codes that are incomplete or unknown.
Missing or invalid JWT / API key
Tenant boundary violation or insufficient scope.
Party not found.
The contact would be neither a customer nor a supplier.