Skip to content

Apply tenant config: profile, branches, terminals, activities, PDF branding

PUT
/v1/partner/tenants/{id}/config
curl --request PUT \
--url https://api.emite.cr/v1/partner/tenants/example/config \
--header 'Content-Type: application/json' \
--data '{ "profile": { "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" }, "branches": [ { "code": "2", "name": "Sucursal Escazú", "isDefault": true } ], "terminals": [ { "branchCode": "1", "code": "2", "name": "Caja 2", "isDefault": true } ], "syncEconomicActivities": false, "defaultEconomicActivityCode": "5610.0", "pdfBranding": { "accentColor": "#2563EB", "headerBandMode": "accent", "headerBandColor": "#1E293B", "fontFamily": "roboto", "logoPosition": "left", "logoSize": "sm", "tableDensity": "compact", "tableRowStripe": true, "showQr": true, "showCabys": true, "showEconomicActivity": true, "showColonesEquivalent": true, "taglineEs": "Soluciones tecnológicas a su medida", "taglineEn": "Tailored tech solutions", "footerNoteEs": "Cuenta BAC: CR05... | SINPE: 8888-0000", "footerNoteEn": "Bank account... | Mobile pay: 8888-0000", "thankYouEs": "¡Gracias por su compra!", "thankYouEn": "Thank you for your business!", "watermarkTextEs": "COPIA", "watermarkTextEn": "COPY" }, "customerEmail": { "enabled": true } }'

Every section is optional; only the ones present are applied, in this order: profile, branches, terminals, the economic activities (syncEconomicActivities / defaultEconomicActivityCode) and pdfBranding. Branches upsert by code and terminals by branchCode + code. The sections are applied one after another, NOT in one transaction: when one fails, the call answers that section's error and what was applied before it — earlier sections, and earlier rows of the same section — stays saved. Read GET /partner/tenants/:id/config to see where it stopped; sending the same body again is safe, since every section is an upsert. On success, returns the resulting branches, terminals and activities, ids included.

id
required
string
x-partner-key
string

Partner app credential (ecp_*)

Media typeapplication/json
object
profile

Profile fields to change: trade name, email, fiscal address, phone. The legal name and the identification never change.

object
commercialName

New trade name (<NombreComercial> on its documents).

string
Example
El Fogón
email

New main email address (<CorreoElectronico> of its documents).

string
Example
admin@elfogon.cr
location

New fiscal address, replacing the stored one whole. The company cannot issue without one (readiness.location).

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

New dial code without +, 1–3 digits.

string
Example
506
phoneNumber

New phone number, digits only.

string
Example
22223333
branches

Branches to create or update by code (up to 50); the ones not listed stay as they are.

Array<object>
object
code
required

Branch number, 1–3 digits, zero-padded to 3 (2 → 002) — the first digits of its consecutivos, and the key of the upsert: an existing code is updated, a new one created.

string
Example
2
name
required

Name of the branch; documents do not show it.

string
Example
Sucursal Escazú
isDefault

Make it the company's default branch — the one a document uses when it names no branchCode — taking the flag from the previous one. Omitted, an existing branch keeps its flag and a new one is not the default.

boolean
terminals

Terminals to create or update by branchCode + code (up to 200), applied after branches; the ones not listed stay as they are.

Array<object>
object
branchCode
required

Code of the branch the terminal belongs to (1–3 digits, zero-padded). It must exist, or be upserted in branches of the same call: 404 BRANCH_NOT_FOUND otherwise.

string
Example
1
code
required

Terminal number, 1–5 digits, zero-padded to 5 — the digits after the branch code in its consecutivos. With branchCode, the key of the upsert. Map each physical POS device to its own terminal so devices never share a counter.

string
Example
2
name
required

Name of the terminal; documents do not show it.

string
Example
Caja 2
isDefault

Make it its branch's default terminal — the one a document of that branch uses when it names no terminalCode — taking the flag from the previous one. Omitted, an existing terminal keeps its flag and a new one is not the default.

boolean
syncEconomicActivities

Replace the company's economic activities with the ones Hacienda's registry (padrón) lists for its cédula. If the current default is no longer listed, send defaultEconomicActivityCode too, or it answers 409 DEFAULT_ACTIVITY_DROPPED and the activities are left untouched.

boolean
defaultEconomicActivityCode

Activity to make the default, in dotted form (e.g. 5610.0). With syncEconomicActivities it must be one Hacienda lists (409 INVALID_NEW_DEFAULT); alone, one the company already has (400 ECONOMIC_ACTIVITY_NOT_FOUND).

string
Example
5610.0
pdfBranding

Changes to the look of its PDFs — the same partial patch as pdfBranding of PATCH /tenants/me/settings (a field sent as null goes back to its default). The logo is uploaded with PUT /partner/tenants/:id/logo.

object
accentColor

Hex color #RRGGBB. Null to reset.

string
nullable
Example
#2563EB
headerBandMode

Color of the dark surfaces — the title band and the header row of the lines table: accent uses accentColor, ink a neutral navy (the default). headerBandColor overrides both. Null to reset.

string
nullable
Allowed values: accent ink
Example
ink
headerBandColor

Hex color #RRGGBB; overrides headerBandMode. Null to reset.

string
nullable
Example
#1E293B
fontFamily

Typeface of the whole document; roboto by default. A character the family lacks is drawn in Inter. Null to reset.

string
nullable
Allowed values: roboto lora inter montserrat opensans merriweather
Example
roboto
logoPosition

Where the logo sits in the header: left or right (the default) of the company's details, or center, above them. Null to reset.

string
nullable
Allowed values: left center right
Example
right
logoSize

Box the logo is fitted into, keeping its proportions: sm (80×50 pt), md (110×70 pt, the default) or lg (140×90 pt). Null to reset.

string
nullable
Allowed values: sm md lg
Example
md
tableDensity

Row padding of the lines and other-charges tables: compact, normal (the default) or comfortable. Null to reset.

string
nullable
Allowed values: compact normal comfortable
Example
normal
tableRowStripe

Alternate-row striping. Null to reset.

boolean
nullable
Example
true
showQr

Ignored: every fiscal document carries the Hacienda QR, at the bottom right (the position MH-DGT-RES-0027-2024, art. 5, prescribes; the requirement itself is suspended by its Transitorio III). Accepted for backward compatibility.

boolean
nullable
Example
true
showCabys

Render the per-line CABYS code subtext.

boolean
nullable
Example
true
showEconomicActivity

Render the issuer economic-activity line.

boolean
nullable
Example
true
showColonesEquivalent

Render the CRC equivalent for foreign-currency docs.

boolean
nullable
Example
true
taglineEs

Short line under the company's name, on PDFs rendered in Spanish (taglineEn is the English one; neither falls back to the other). Empty or null = no tagline.

string
nullable <= 120 characters
Example
Soluciones tecnológicas a su medida
taglineEn

The tagline on PDFs rendered in English. Empty or null = no tagline.

string
nullable <= 120 characters
Example
Tailored tech solutions
footerNoteEs

Note in the page footer of PDFs rendered in Spanish, printed BEFORE the legal footer, which always stays. Empty or null = no note.

string
nullable <= 300 characters
Example
Cuenta BAC: CR05... | SINPE: 8888-0000
footerNoteEn

The footer note on PDFs rendered in English. Empty or null = no note.

string
nullable <= 300 characters
Example
Bank account... | Mobile pay: 8888-0000
thankYouEs

Message between the lines table and the totals, on PDFs rendered in Spanish. Empty or null = no message.

string
nullable <= 200 characters
Example
¡Gracias por su compra!
thankYouEn

The thank-you message on PDFs rendered in English. Empty or null = none.

string
nullable <= 200 characters
Example
Thank you for your business!
watermarkTextEs

Faint diagonal text stamped on every page of PDFs rendered in Spanish (e.g. COPIA). Empty or null = no watermark.

string
nullable <= 30 characters
Example
COPIA
watermarkTextEn

The watermark on PDFs rendered in English. Empty or null = no watermark.

string
nullable <= 30 characters
Example
COPY
customerEmail

Whether EmiteCR emails the company's customer each accepted document. Off for a company a partner provisions, until the partner turns it on here.

object
enabled
required

On: once Hacienda accepts a document whose receiver has an email, EmiteCR emails that receiver the PDF, the signed XML and Hacienda's response. It goes out in the company's name: its trade name (its legal name without one) as the sender's name over EmiteCR's sending address, replies to the company's email, and the partner's name in the footer; EmiteCR's brand never appears. A document without a receiver email gets nothing. Off: nothing is sent automatically. Either way, POST /invoices/:id/resend-email with the company's API key sends one on request.

boolean
Example
true
Media typeapplication/json
object
branches
required

The company's branches (deleted ones left out), in no particular order.

Array<object>
object
id
required

Identifier of the branch — the branchId the numbering endpoints (sequences) ask for.

string format: uuid
code
required

Branch number, zero-padded to 3 digits — the first digits of its consecutivos. A provisioned company starts with 001 (Casa Matriz).

string
name
required

Name of the branch.

string
isDefault
required

Whether it is the company's default branch — the one a document uses when it names no branchCode. True for one branch at most.

boolean
terminals
required

The terminals of every branch in branches (deleted ones left out), grouped by branch.

Array<object>
object
id
required

Identifier of the terminal — the terminalId the numbering endpoints (sequences) ask for.

string format: uuid
branchId
required

Identifier of the branch it belongs to (an id of branches).

string format: uuid
code
required

Terminal number, zero-padded to 5 digits and unique within its branch — the digits after the branch code in its consecutivos. A provisioned company starts with 00001 (Terminal Principal) in branch 001.

string
name
required

Name of the terminal.

string
isDefault
required

Whether it is its branch's default terminal — the one a document of that branch uses when it names no terminalCode. True for one terminal per branch at most.

boolean
economicActivities
required

The company's economic activities (the ones a sync dropped are left out), in no particular order.

Array<object>
object
id
required

Identifier of the activity.

string format: uuid
code
required

Hacienda's activity code in its dotted form — what defaultEconomicActivityCode takes and a document carries as <CodigoActividadEmisor>.

string
description
required

Name of the activity as Hacienda's registry lists it. null for an activity set by code (at provisioning) until syncEconomicActivities brings the registry's list.

string
nullable
isDefault
required

Whether it is the company's default activity — the one a document uses when it names none. True for one activity at most.

boolean
customerEmail
required

Whether EmiteCR emails the company's customer each accepted document, and under which name and reply address.

object
enabled
required

On: once Hacienda accepts a document whose receiver has an email, EmiteCR emails that receiver the PDF, the signed XML and Hacienda's response. It goes out in the company's name: its trade name (its legal name without one) as the sender's name over EmiteCR's sending address, replies to the company's email, and the partner's name in the footer; EmiteCR's brand never appears. A document without a receiver email gets nothing. Off: nothing is sent automatically. Either way, POST /invoices/:id/resend-email with the company's API key sends one on request.

boolean
senderName
required

The name the email goes out under (the sender's name, the header and the body): the company's trade name, or its legal name without one. Read from EmiteCR's record of the company, the one profile changes.

string
replyTo
required

Where the customer's reply goes: the company's email. Null when that email is not a valid address; a reply then goes to EmiteCR's sending address instead.

string
nullable
Example
{
"branches": [
{
"code": "001",
"name": "Casa Matriz"
}
],
"terminals": [
{
"code": "00001",
"name": "Terminal Principal"
}
],
"economicActivities": [
{
"code": "5610.11"
}
],
"customerEmail": {
"enabled": true,
"senderName": "El Fogón",
"replyTo": "facturas@elfogon.cr"
}
}