Skip to content

Provision a headless managed tenant (idempotent per cédula)

POST
/v1/partner/tenants
curl --request POST \
--url https://api.emite.cr/v1/partner/tenants \
--header 'Content-Type: application/json' \
--data '{ "identificationType": "01", "identificationNumber": "3101234567", "name": "Restaurante El Fogón S.A.", "commercialName": "El Fogón", "email": "admin@elfogon.cr", "location": { "provincia": "1", "canton": "01", "distrito": "01", "barrio": "Carmen", "otrasSenas": "50 metros norte de la iglesia, edificio azul" }, "phoneCountryCode": "506", "phoneNumber": "22223333", "defaultLocale": "es", "economicActivityCode": "5610.0" }'

Creates a company with no users or memberships, production as its active environment and every notification email off. It starts with branch 001 (Casa Matriz) and terminal 00001 (Terminal Principal) as its defaults and, when economicActivityCode is sent, that activity as its default. Always answers 200 — created tells a new company apart. When this partner already manages the identification, the existing company is returned unchanged (created: false; the payload is not applied — use the config endpoint); when it belongs to a company this partner released, that company comes back with its numbering intact (created: false, revived: true). 409 PARTNER_TENANT_CEDULA_CONFLICT when the identification belongs to any other company; 403 PARTNER_MAX_TENANTS_REACHED when the partner already manages its maximum number of companies (a revival needs room too).

x-partner-key
string

Partner app credential (ecp_*)

Media typeapplication/json
object
identificationType
required

Hacienda identification type of the company: 01 cédula física, 02 cédula jurídica, 03 DIMEX, 04 NITE, 05 foreign, 06 no contribuyente. With identificationNumber it is what provisioning is idempotent on: the same pair again returns the same company (created: false), and one held by anybody else answers 409 PARTNER_TENANT_CEDULA_CONFLICT.

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

Normalized to uppercase; its format depends on identificationType. From 2026-11-01 a cédula jurídica (type 02) may carry an alphanumeric consecutive (decree 44648-MJ), e.g. 3101A1B2C3: such a company can be provisioned and configured but cannot issue documents — readiness.issuerIdSupported says so before the first attempt.

string
Example
3101234567
name
required

Legal name (razón social) — <Nombre> on its documents. The config endpoint cannot change it later.

string
Example
Restaurante El Fogón S.A.
commercialName

Trade name shown on its documents (<NombreComercial>).

string
Example
El Fogón
email
required

The company's main email address — <CorreoElectronico> of its documents. Nothing is mailed to it: a provisioned company starts with every notification off.

string
Example
admin@elfogon.cr
location

Fiscal address. Optional here, but the company cannot issue without it (readiness.location; emission answers 422 TENANT_LOCATION_MISSING) — it can also be set later through profile.location of the config endpoint.

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; 506 is assumed when absent.

string
Example
506
phoneNumber

Phone number, digits only — <Telefono> on its documents.

string
Example
22223333
defaultLocale

Language of what is sent on the company's behalf without a person choosing one — emails such as the grant-access invitation, and the PDFs they attach. A PDF downloaded through the API follows its own ?locale= instead.

string
default: es
Allowed values: es en
economicActivityCode

Becomes the company's default economic activity, in Hacienda's dotted form: four digits, a dot and one digit (5610.0), the six characters the XSD admits.

string
Example
5610.0
Media typeapplication/json
object
tenantId
required

Identifier of the company — the :id of every /partner/tenants/:id/* route. Every repeat of the call for the same identification returns the same one.

string format: uuid
created
required

true when this call created the company. false when this partner already managed that identification — the existing company is returned as it is, without applying this payload to it (change it through PUT /partner/tenants/:id/config) — or when a company this partner had released came back (revived).

boolean
revived

Present, and true, only when the identification belonged to a company this partner had released (DELETE /partner/tenants/:id): that same company comes back with its numbering intact, taking the legal name, trade name (cleared when not sent) and email of this payload and, when sent, its address, phone and economic activity. Its API keys and credentials went with the release and have to be set up again.

boolean
Examplegenerated
{
"tenantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"created": true,
"revived": true
}