Apply tenant config: profile, branches, terminals, activities, PDF branding
const url = 'https://api.emite.cr/v1/partner/tenants/example/config';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"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}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Partner app credential (ecp_*)
Request Bodyrequired
Section titled “Request Bodyrequired”object
Profile fields to change: trade name, email, fiscal address, phone. The legal name and the identification never change.
object
New trade name (<NombreComercial> on its documents).
Example
El FogónNew main email address (<CorreoElectronico> of its documents).
Example
admin@elfogon.crNew fiscal address, replacing the stored one whole. The company cannot issue without one (readiness.location).
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 azulNew dial code without +, 1–3 digits.
Example
506New phone number, digits only.
Example
22223333Branches to create or update by code (up to 50); the ones not listed stay as they are.
object
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.
Example
2Name of the branch; documents do not show it.
Example
Sucursal Escazú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.
Terminals to create or update by branchCode + code (up to 200), applied after branches; the ones not listed stay as they are.
object
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.
Example
1Terminal 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.
Example
2Name of the terminal; documents do not show it.
Example
Caja 2Make 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.
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.
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).
Example
5610.0Changes 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
Hex color #RRGGBB. Null to reset.
Example
#2563EBColor 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.
Example
inkHex color #RRGGBB; overrides headerBandMode. Null to reset.
Example
#1E293BTypeface of the whole document; roboto by default. A character the family lacks is drawn in Inter. Null to reset.
Example
robotoWhere the logo sits in the header: left or right (the default) of the company's details, or center, above them. Null to reset.
Example
rightBox 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.
Example
mdRow padding of the lines and other-charges tables: compact, normal (the default) or comfortable. Null to reset.
Example
normalAlternate-row striping. Null to reset.
Example
trueIgnored: 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.
Example
trueRender the per-line CABYS code subtext.
Example
trueRender the issuer economic-activity line.
Example
trueRender the CRC equivalent for foreign-currency docs.
Example
trueShort 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.
Example
Soluciones tecnológicas a su medidaThe tagline on PDFs rendered in English. Empty or null = no tagline.
Example
Tailored tech solutionsNote in the page footer of PDFs rendered in Spanish, printed BEFORE the legal footer, which always stays. Empty or null = no note.
Example
Cuenta BAC: CR05... | SINPE: 8888-0000The footer note on PDFs rendered in English. Empty or null = no note.
Example
Bank account... | Mobile pay: 8888-0000Message between the lines table and the totals, on PDFs rendered in Spanish. Empty or null = no message.
Example
¡Gracias por su compra!The thank-you message on PDFs rendered in English. Empty or null = none.
Example
Thank you for your business!Faint diagonal text stamped on every page of PDFs rendered in Spanish (e.g. COPIA). Empty or null = no watermark.
Example
COPIAThe watermark on PDFs rendered in English. Empty or null = no watermark.
Example
COPYWhether EmiteCR emails the company's customer each accepted document. Off for a company a partner provisions, until the partner turns it on here.
object
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.
Example
trueResponses
Section titled “Responses”object
The company's branches (deleted ones left out), in no particular order.
object
Identifier of the branch — the branchId the numbering endpoints (sequences) ask for.
Branch number, zero-padded to 3 digits — the first digits of its consecutivos. A provisioned company starts with 001 (Casa Matriz).
Name of the branch.
Whether it is the company's default branch — the one a document uses when it names no branchCode. True for one branch at most.
The terminals of every branch in branches (deleted ones left out), grouped by branch.
object
Identifier of the terminal — the terminalId the numbering endpoints (sequences) ask for.
Identifier of the branch it belongs to (an id of branches).
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.
Name of the terminal.
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.
The company's economic activities (the ones a sync dropped are left out), in no particular order.
object
Identifier of the activity.
Hacienda's activity code in its dotted form — what defaultEconomicActivityCode takes and a document carries as <CodigoActividadEmisor>.
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.
Whether it is the company's default activity — the one a document uses when it names none. True for one activity at most.
Whether EmiteCR emails the company's customer each accepted document, and under which name and reply address.
object
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.
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.
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.
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" }}