Update tenant settings (transactional with audit log)
const url = 'https://api.emite.cr/v1/tenants/me/settings';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabledCurrencies":["CRC","USD"],"defaultCurrency":"AED","notificationPreferences":{"invoiceRejected":true,"invoiceTimeout":true,"invoiceError":true,"recipientUndeliverable":false,"invoiceAcceptedReceiver":false,"recurringFailed":true,"importCompleted":true,"scheduledSendFailed":true,"invoiceAcceptedEmisor":"each","invoiceAcceptedReceiverCopyToSelf":false,"whatsappEnabled":true,"acceptanceReminders":true,"fiscalReminders":true,"archiveReminders":true},"formatPreferences":{"formatLocale":"es-CR","dateStyle":"short","timeStyle":"12h","currencyDisplay":"code"},"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"}}'};
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/me/settings \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "enabledCurrencies": [ "CRC", "USD" ], "defaultCurrency": "AED", "notificationPreferences": { "invoiceRejected": true, "invoiceTimeout": true, "invoiceError": true, "recipientUndeliverable": false, "invoiceAcceptedReceiver": false, "recurringFailed": true, "importCompleted": true, "scheduledSendFailed": true, "invoiceAcceptedEmisor": "each", "invoiceAcceptedReceiverCopyToSelf": false, "whatsappEnabled": true, "acceptanceReminders": true, "fiscalReminders": true, "archiveReminders": true }, "formatPreferences": { "formatLocale": "es-CR", "dateStyle": "short", "timeStyle": "12h", "currencyDisplay": "code" }, "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" } }'PATCH with shallow-merge semantics: enabledCurrencies and defaultCurrency are REPLACED; notificationPreferences, formatPreferences and pdfBranding are merged field by field (only the fields sent change; a pdfBranding field sent as null goes back to its default). Concurrent edits are serialized. Disabling a currency does not touch items — their prices in it are kept and come back if it is enabled again — but is refused while drafts use it, and a document in a disabled currency cannot be created. defaultCurrency must end up among enabledCurrencies (400 DEFAULT_CURRENCY_NOT_ENABLED); writing pdfBranding needs a plan with PDF branding (402 FEATURE_NOT_IN_PLAN). Every successful update is audited. Returns the settings after the update, as GET does.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Currencies the company works in, as ISO 4217 codes; REPLACES the whole list (at least one). Dropping a currency that still has draft invoices answers 409 CURRENCY_HAS_DRAFTS; the item prices in it are kept and come back if it is enabled again.
Example
[ "CRC", "USD"]Currency new invoices and new items start in. It must be one of the enabled currencies after this update (400 DEFAULT_CURRENCY_NOT_ENABLED).
Example
CRCThe email and WhatsApp notice switches. Partial: only the fields sent change, the rest keep their stored value.
object
Email the company's notification address when Hacienda rejects one of its documents.
Example
trueEmail the company when Hacienda has not answered about a document in 24 hours.
Example
trueEmail the company when one of its documents ends in error.
Example
trueEmail the company when an accepted document's customer copy cannot be sent because the customer's email address is invalid.
Example
falseSend the CUSTOMER (the receiver) each accepted document by email, with its PDF, signed XML and Hacienda's response. false leaves the delivery to the company; a resend requested from the document still goes out.
Example
falseEmail the company when a run of a recurring invoice schedule fails for good (the schedule pauses itself).
Example
trueEmail the company when an XML bulk-import batch finishes; it also governs the WhatsApp summary of batches that arrive through the inbound mailbox.
Example
trueEmail the company when the scheduled send of a draft fails (no credentials, quota exhausted, signing error…).
Example
trueWhen the issuer hears that Hacienda accepted one of its documents: each (one email per document, PDF and XML attached), daily (a morning summary of the previous day) or off.
Example
dailyDeprecated: has no effect and reads back as false. Use invoiceAcceptedEmisor.
Example
falseCompany-wide switch for WhatsApp notifications: false silences them for every member, whatever each one chose on the phone they linked (opt-in per member, off by default).
Example
trueRemind the company, by email and on WhatsApp, of purchase documents whose acceptance deadline is near (3 days, 1 day and the last day of the deadline). A document left unanswered is presumed fully accepted.
Example
trueEmail the company ahead of its tax-calendar deadlines (7, 3 and 1 days before, and on the day).
Example
trueRemind the owner and the administrators, once a quarter, to download the XML backup of the documents the company issued and received in production in that quarter.
Example
trueHow numbers, money and dates are written on the PDFs, emails and screens. Partial: only the fields sent change.
object
Locale that writes numbers, money and dates on the PDFs, emails and screens — independent of the language of the text. One of es-CR (the default), es-MX, es-AR, es-ES, en-US, en-GB, pt-BR, fr-FR.
Example
es-CRLength of dates, as Intl.DateTimeFormat's dateStyle in that locale. Defaults to short.
Example
mediumClock used for times. Defaults to 24h.
Example
24hHow amounts name their currency, as Intl.NumberFormat's currencyDisplay: code (e.g. CRC), symbol, narrowSymbol (e.g. ₡, the default) or name (the currency's name).
Example
symbolThe look of the company's PDFs (the logo has its own endpoint). Partial: only the fields sent change, and one sent as null goes back to its default. Writing it needs a plan with PDF branding (402 FEATURE_NOT_IN_PLAN).
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
COPYResponses
Section titled “Responses”object
Currencies the company works in (ISO 4217): the ones its documents and item prices may use. At least one.
Currency new invoices and items start in; always one of enabledCurrencies.
The email and WhatsApp notice switches, every one with its effective value (a switch never written reads as its default: true, and daily for invoiceAcceptedEmisor).
object
Email the company's notification address when Hacienda rejects one of its documents.
Email the company when Hacienda has not answered about a document in 24 hours.
Email the company when one of its documents ends in error.
Email the company when the customer's copy of an accepted document cannot be sent because the customer's email address is invalid.
Email the CUSTOMER (the receiver) each accepted document, with its PDF, signed XML and Hacienda's response. false leaves the delivery to the company.
Email the company when a run of a recurring invoice schedule fails for good (the schedule pauses itself).
Email the company when an XML bulk-import batch finishes (it also governs the WhatsApp summary of batches that arrive through the inbound mailbox).
Email the company when the scheduled send of a draft fails (no credentials, quota exhausted, signing error…).
When the company hears that Hacienda accepted one of its documents: each (one email per document, PDF and XML attached), daily (a morning summary of the previous day, the default) or off.
Deprecated: has no effect, and the settings read always answers false.
Company-wide switch for WhatsApp notifications: false silences them for every member, whatever each one chose on the phone they linked (opt-in per member, off by default).
Remind the company, by email and on WhatsApp, of purchase documents whose acceptance deadline is near (3 days, 1 day and the last day of the deadline). A document left unanswered is presumed fully accepted.
Email the company ahead of its tax-calendar deadlines (7, 3 and 1 days before, and on the day).
Remind the owner and the administrators, once a quarter, to download the XML backup of the documents the company issued and received in production in that quarter.
How numbers, money and dates are written on its PDFs, emails and screens.
object
Locale that writes numbers, money and dates on the PDFs, emails and screens — independent of the language of the text. es-CR by default.
Length of dates, as Intl.DateTimeFormat's dateStyle in that locale. short by default.
Clock used for times. 24h by default.
How amounts name their currency, as Intl.NumberFormat's currencyDisplay: code (e.g. CRC), symbol, narrowSymbol (e.g. ₡, the default) or name (the currency's name).
The look of the company's PDFs, every field with its effective value (the default where the company changed nothing). The logo has its own endpoint.
object
Accent color (#RRGGBB) of the «Total a pagar» bar and the card accents.
Color of the dark surfaces (title band, header row of the lines table): accent uses accentColor, ink a neutral navy. headerBandColor overrides both.
Explicit #RRGGBB for those dark surfaces; null = follow headerBandMode.
Typeface of the whole document.
Where the logo sits in the header, relative to the company's details.
Box the logo is fitted into: sm 80×50 pt, md 110×70 pt, lg 140×90 pt.
Row padding of the lines and other-charges tables.
Alternate-row striping in those tables.
Deprecated: always true — every fiscal document carries the Hacienda QR.
Print the CAByS code under each line.
Print the company's economic activity in the header.
On a foreign-currency document, print the colones equivalent (the «Total en colones» row and the exchange rate).
Tagline under the company's name on PDFs in Spanish; null = none.
The tagline on PDFs in English; null = none.
Note in the page footer of PDFs in Spanish, before the legal footer; null = none.
The footer note on PDFs in English; null = none.
Message between the lines table and the totals on PDFs in Spanish; null = none.
The thank-you message on PDFs in English; null = none.
Faint diagonal text on every page of PDFs in Spanish; null = no watermark.
The watermark on PDFs in English; null = no watermark.
Example
{ "enabledCurrencies": [ "CRC", "USD" ], "defaultCurrency": "AED", "notificationPreferences": { "invoiceAcceptedEmisor": "each" }, "formatPreferences": { "formatLocale": "es-CR", "dateStyle": "short", "timeStyle": "12h", "currencyDisplay": "code" }, "pdfBranding": { "accentColor": "#2563EB", "headerBandMode": "accent", "fontFamily": "roboto", "logoPosition": "left", "logoSize": "sm", "tableDensity": "compact" }}Missing or invalid JWT / API key.
Settings mutation requires the settings:write scope.
CURRENCY_HAS_DRAFTS — draft invoices in the currency being disabled. Resolve drafts first.