Supported scenarios
What Sello files on day one, and how it refuses the rest before a consecutivo is spent.
Sello is self-service. Nobody asks what you sell before you connect, so what
Sello supports is written down here, and the same list is enforced by
POST /v1/documents. A document outside it is refused before a consecutivo
is allocated, before your quota is charged, and before the Idempotency-Key is
reserved. The refusal costs nothing, and you can retry the same key with a
corrected body.
Read this page before you upload a certificate. If your business issues something in the Refused column, Sello is not ready for you yet, and the table says whether that is planned.
How a refusal looks
{
"type": "https://sello.cr/problems/unsupported-scenario",
"title": "Unsupported scenario",
"status": 422,
"detail": "This document is outside the scenarios Sello supports (matrix 2026-11.22). This request allocated no consecutivo, charged no quota and reserved no idempotency key; correct the document and retry under the same Idempotency-Key. See https://ca-sello-docs.orangesmoke-cacc8fb5.eastus2.azurecontainerapps.io/docs/guides/supported-scenarios.",
"matrixVersion": "2026-11.22",
"scenarios": ["condicion-venta"],
"errors": [
{ "path": "resumenFactura.codigoTipoMoneda.codigoMoneda", "message": "condicionVenta 10 in USD is not supported yet: which exchange rate the code-11 REP that collects the sale uses is open with a tax adviser (#666 question 3); Sello files condición 10 in CRC.", "code": "unsupported_scenario" }
]
}scenarios[]— the distinct ids of the dimensions that failed, in the order of the table below. Map on these, not on the message text.errors[]— one entry per offending field, with a full sentence naming the value you sent and what is supported.matrixVersion— the version of the matrix that judged the document. It changes when the envelope widens.
Every refusal is reported at once: a body with three gaps gets three errors.
The matrix
Matrix version 2026-11.22. Every refusal carries this version as matrixVersion.
| Dimension | Supported | Refused | scenarios[] id |
|---|---|---|---|
Document type (tipo) | FE Factura Electrónica, TE Tiquete Electrónico, NC Nota de Crédito Electrónica, ND Nota de Débito Electrónica, FEC Factura Electrónica de Compra, FEE Factura Electrónica de Exportación, REP Recibo Electrónico de Pago | none — every v4.4 comprobante type is filed | document-type |
Currency (resumenFactura.codigoTipoMoneda) | CRC (tipoCambio exactly 1), every other code of the v4.4 CodigoMonedaType enumeration (167, e.g. EUR, JPY, USD), tipoCambio > 0; CRC may leave out tipoCambio and is signed at 1, and USD and EUR may leave it out and get the stored BCCR reference sell (venta) rate for the Costa Rica date of the document (or the latest stored within the 7 days before; none stored is a 503 exchange-rate-unavailable). A USD or EUR rate that is sent more than 1% from the stored one issues with an exchange_rate_divergence warning | a code outside the XSD enumeration — it is an old ISO snapshot, so VES, BYN, MRU, STN, SLE and ZWG are refused and their predecessors VEF, BYR, MRO, STD, SLL and ZWL file; a CRC rate other than 1; a zero or negative rate; any code but CRC, USD and EUR without a tipoCambio | currency, exchange-rate |
Actividad económica (codigoActividad, codigoActividadReceptor) | any actividad the emisor actually holds: the code registered at provisioning (which Sello fills in when the request omits one), or any other code Hacienda's /fe/ae padrón lists as ACTIVE for the emisor — a taxpayer with several actividades may file under any of them. Sent in the six-character dot form dddd.d (e.g. 4690.0). A codigoActividadReceptor is admitted on the same test against the receptor's padrón. On an FEC the roles swap: codigoActividad would be the SUPPLIER's, so Sello never fills yours in and never checks it against your padrón, and codigoActividadReceptor — obligatory there — is yours, admitted without a padrón read when it is your registered code | a code that is neither the registered one nor active in the emisor's padrón (the annex rejects a code missing from the RUT, after the consecutivo); a request code when the emisor has none registered; five or six digits before the dot (12345.6, 123456.7); the bare six-digit form (469000, Hacienda's -408); no code at all — the request sends none and the emisor has none registered; a codigoActividadReceptor that is not active in the receptor's padrón, or a receptor Hacienda cannot be asked about (the element is optional on an FE, so omitting it always works); a codigoActividadReceptor on a TE, under every matrix — the TiqueteElectronico schema has no such element, and a buyer naming its actividad is buying for its business, so it is owed an FE. The padrón is read only when the code sent is not the registered one, so the registered code files whether or not Hacienda is reachable | codigo-actividad |
| Emisor identificación | tipo 01–04 with the number in the shape its tipo prescribes (física 9 digits, jurídica 10, DIMEX 11–12, NITE 10; no leading zero on física/DIMEX, no hyphens; a 05/06 number is 1–20 letters and digits) — the number Sello binds to the emisor row | a number that does not match its tipo (the annex rejects the comprobante; correct the emisor where it was provisioned) | emisor-numero |
| Receptor | identified: receptor.identificacion present, tipo 01–04 or 06, with the number in the shape its tipo prescribes (física 9 digits, jurídica 10, DIMEX 11–12, NITE 10; no leading zero on física/DIMEX, no hyphens; a 06 number is 1–20 letters and digits, no punctuation). An FEE may also name a tipo 05 (Extranjero No Domiciliado) receptor, the usual one for an export: its number 1–20 letters and digits with no padrón check, and its address in otrasSenasExtranjero. Sello checks the SHAPE; whether the number is a real one in the Registro Civil, the Registro Nacional or the DGT is Hacienda's check, and no public registry exposes it — a well-shaped number that is not real is rejected by Hacienda after the consecutivo. On a TE the receptor is OPTIONAL — a sale to a consumidor final may name no buyer, or a buyer with no identificación (annex p. 22: Receptor and Identificación are condition 2 on a TE) — and an NC or ND whose every reference is a TE (tipoDocIR 04) may name none either, since a nota carries the original's receptor (p. 23). A TE that names its buyer is still a tiquete: it cannot support the buyer's gastos or créditos (Decreto 44739-H art. 20), so a buyer who will deduct the purchase, or asks for a factura, is owed an FE (art. 4.1.f) | a receptor with no identificación on an FE, or on a nota that references anything but a TE; a number that does not match its tipo; tipo 05 (Extranjero No Domiciliado) on an FE — the annex allows it only under condición 12, which is not supported; an invoice to a foreign receptor is an FEE | receptor-identified, receptor-tipo, receptor-numero |
Correo electrónico (emisor, receptor) | the structure both Hacienda expressions admit (the annex's and the XSD documentation's, which differ): one bare address, local@domain.tld, whitespace admitted either side (the emisor address is required; the receptor address is judged when sent) | a quoted local part ("juan perez"@x.com), a trailing dot (a@b.), a display name (Nombre <a@b.com>), a list of addresses, a domain with no dot, anything without an @ — the annex says Hacienda "rechazará el comprobante" | correo-electronico |
Nombres (emisor.nombre, receptor.nombre, nombreComercial) | the XSD lengths, counted as the XSD counts (code points): emisor Nombre 5–100, receptor Nombre 3–100, NombreComercial 3–80 when sent | a shorter or longer name | nombre |
Ubicación (emisor.ubicacion, otrasSenasExtranjero) | Provincia one digit 1–7, Canton and Distrito two digits each and not 00 (the XSD types all three as xs:positiveInteger), and the triple must name a distrito in Hacienda's Codificacionubicacion_V4.4 (ANEXOS nota 14 — the reception validates it; vendored under docs/reference/hacienda-v4.4/), Barrio 5–50 when sent, OtrasSenas 5–250; receptor.otrasSenasExtranjero 5–300 when sent and only for a receptor of tipo 05 (the XSD puts the foreign address on the receptor for FE and NC, and on the emisor only for an FEC) | a code of the wrong width, a zero code (0, 00), or a provincia/cantón/distrito triple the catalogue does not know; a Barrio or OtrasSenas under 5 characters; emisor.otrasSenasExtranjero on anything but an FEC (the FE/NC EmisorType has no such element) | ubicacion |
Teléfono (emisor.telefono) | when sent: CodigoPais an integer of at most 3 digits, NumTelefono 8 to 20 digits (the annex's floor; a Costa Rican line is 8) | letters, a +, spaces or hyphens in either field; a country code over 3 digits; a number under 100 (the XSD facet); a number shorter than the annex's 8 digits, including the special short numbers it excepts by example (911) — omit telefono, which is optional | telefono |
| Condición de venta | 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 99 (annex nota 5: contado, crédito, consignación, apartado, the four arrendamiento / cobro / Estado codes, 12 mercancía no nacionalizada, 13 bienes usados de un no contribuyente, 99 otros); 02 crédito carries plazoCredito, a whole number of days from 1 to 99999 (the XSD's totalDigits 5); 99 carries condicionVentaOtros of 5 to 100 characters; 12 on an FE only (the annex: "únicamente será permitido en el comprobante Factura Electrónica"); 13 on an FEC only, from a tipo 06 supplier (see the FEC row); 09 (pago de servicios prestados al Estado) on a REP only, and a REP carries nothing else — the annex: "se utilizarán únicamente en Recibos Electrónicos de Pago. Estos serán los únicos códigos permitidos en dicho Comprobante Electrónico". A REP 09 references the 08 FE it collects (tipoDocIR 01, its clave, código 17), carries one medio de pago and no plazoCredito, and each line states montoTotal = subtotal, one IVA entry (código 01) whose amount is tarifa × subtotal, and montoTotalLinea = subtotal + that IVA; 10 (venta a crédito en IVA hasta 90 días, LIVA art. 27) on an FE, NC or ND in CRC, with a plazoCredito of 1 to 90 days and an identified receptor, every line one IVA entry (código 01) at the same codigoTarifa and tarifa, above zero, with no exoneración and no otros cargos. Sello records the IVA débito a code-10 FE defers, and GET /v1/documents/{clave} returns its deferral (status, collected, outstanding, lapsesAt); when day 90 ends with a balance outstanding Sello sends deferral.lapsed and computes no IVA; 11 on a REP that collects one sale (one tipoDocIR 01 or 04 reference), under the REP 09 line rules; against a code-10 FE Sello filed, the sale must be accepted and name the same receptor, and the REP's totalComprobante must be at most the sale's outstanding balance (its total less every REP in flight or accepted and every NC against it) | 10 on a TE, FEC or FEE (the code-11 REP names the sale's receptor, and a TE may omit it); 10 with a plazoCredito above 90; 10 or 11 in another currency (#666 question 3, the exchange rate); 10 on several rates, a zero rate, an exoneración or otros cargos (#666 question 2, a partial payment across rates); a code-11 REP collecting two sales or none (referencia-count), or against a sale Sello filed that is not accepted or whose outstanding balance it exceeds (referencia-numero); an ND against a code-10 sale Sello filed; 09 or 11 on anything but a REP, and any other code on a REP, under every matrix; a REP 09 or 11 whose reference is a comprobante Sello filed under any condición but 08 or 10, or to another receptor (referencia-numero); a REP 09 line whose IVA rate the 08 FE Sello filed does not carry (tax-tarifa; Hacienda's REP guide, p. 2: "Se aplicara la tarifa que corresponda al bien o servicio facturado originalmente"); a plazoCredito on a REP (inexistente in its schema); a REP line with a descuento, a tax código other than 01, or a montoTotalLinea that is not subtotal + tarifa × subtotal; a REP with no informacionReferencia; 02 or 10 without a plazoCredito; a plazoCredito outside 1 to 99999 days under any condición; 99 without condicionVentaOtros, or with one outside 5–100 characters; condicionVentaOtros under any other code; 12 on an NC; 13 on an FE, NC or ND (footnote 24: "Aplicará únicamente en factura electrónica de compra") | condicion-venta |
| Medio de pago | 01, 02, 03, 04, 05, 06, 07, 99 — the eight v4.4 TipoMedioPago codes — up to 4 per document (the XSD's own ceiling). With several methods each states its totalMedioPago and the amounts sum to totalComprobante; 99 carries medioPagoOtros (3–100 characters) — on the entry, or at the document level when the medios are bare codes (#446). Omitted only under condición de venta 02, 08 or 10 — a sale on credit, where nothing has been paid. A card (02) on Servicios de salud humana lines taxed at 4 % returns that IVA as totalIVADevuelto, computed by the server: all of it when the card pays alone, and (monto pagado tarjeta / venta neta) × that IVA, capped at it, when the card shares the payment or the health lines share the document (annex p.55, footnote 16; #526). The card amount comes first; the other methods then sum to the totalComprobante net of the refund | a code outside the eight; more than 4 methods; a split where any method omits totalMedioPago, or where the amounts do not sum to totalComprobante (Hacienda rejects the document); 99 without medioPagoOtros, or a medioPagoOtros beside any other code, or a document-level one with no single bare 99 to attach to; no medio de pago at all under any condición but 02, 08 and 10; two or more methods on a REP (its receipt files one); on an FEE, a card among several methods on Servicios de salud humana lines taxed at 4 % (the prorated refund is proven on the FE, TE, NC and ND; #717) | medio-pago |
Tax per line (impuesto[]) | one entry per código, código 01, 02, 03, 04, 05, 06, 08, 12, 99: the line's IVA (01, or 08 with its factor for used goods) beside its specific taxes — 02 selectivo de consumo, 03 combustibles, 04 bebidas alcohólicas, 05 bebidas sin alcohol y jabones de tocador, 06 tabaco, 12 cemento, 99 with its codigoImpuestoOtro (#363). 02, 04, 05 and 12 enter the IVA's BaseImponible (annex p. 37), and 03, 04, 05 and 12 are borne by the emisor (see below). The IVA carries tarifa 01, 02, 03, 04, 08, 09, 10, 11 (exempt = 10, not subject = 11) — plus 05, 06 on an NC only, which nota 8.1 reserves for notas — with the tarifa percentage nota 8.1 gives that code | any other tax code; 05 or 06 on an FE; 07 (disabled in v4.4); a tarifa that contradicts its code; a monto that is neither tarifa × subtotal nor its 2-place rounding (annex §II rounds a digit ≥ 5 up, so an exact 0.065 is 0.07, never 0.06); two entries for one código; two IVA regimes on one line (01 beside 08: the factor replaces the ordinary IVA, it does not add to it); a specific-tax monto that is not its annex formula — the sandbox accepted amounts one colón off on 04, 06 and 08 (run 36944604617), so this refusal is the only check; montoExportacion | tax-code, tax-tarifa, tax-monto, tax-count, monto-exportacion |
Factura de exportación (FEE) and its partidaArancelaria | an export is exempt (Ley 9635 art. 8): each line is IVA código 01 at codigoTarifa 10 (annex footnote 33), the shape the sandbox accepted, and its value goes to totalServExentos / totalMercanciasExentas. A line selling a GOOD (CABYS starting 0–4) carries a 12-digit partidaArancelaria — so does a good on an NC or ND that modifies an FEE (tipoDocIR 19 or 12), annex p. 26. A service line owes none | any other tarifa on an FEE line; any tax code but 01 on an FEE line (an 08 factor or a specific tax would charge a foreign buyer tax on an export); refused under every matrix: tarifa 01 or 11 on an FEE (they are no sujeto, and the no-sujeto totals are inexistente on an FEE, annex pp. 51-52 — Hacienda answers tarifa 01 with -101); a good with no partidaArancelaria on an FEE or on a nota that modifies one; a partidaArancelaria that is not exactly 12 digits; and the field on an FE, TE, FEC or REP, whose schema has no such element | tax-code, tax-tarifa, partida-arancelaria |
Factura de compra (FEC) — the tenant BUYS, and signs as the receptor | the receptor is your own taxpayer (bound to the emisor row, as the emisor is on every other type), with codigoActividadReceptor your actividad; the emisor is the SUPPLIER, of tipo 05, 06. A 05 (Extranjero No Domiciliado) supplier carries an informacionReferencia with tipoDocIR 16 naming its own invoice (annex p. 19), its address in otrasSenasExtranjero; a 06 (No Contribuyente) supplier sells under condición 13 (bienes usados, p. 19 footnote 18), each line IVA código 01 at codigoTarifa 10, 11 — a no contribuyente charges no IVA. codigoActividad is the SUPPLIER's activity on an FEC and is omitted — Sello never writes yours there — and ProveedorSistemas is you. An NC (tipoDocIR 17) or ND (18) to an FEC keeps the FEC's roles: the supplier is its emisor, of tipo 05 (no address: the NC and ND emisor has no otrasSenasExtranjero, and ubicacion is omitted), and you are its receptor and sign it — the one shape the sandbox accepted on 2026-10-03; with you as emisor it answered -60 (issued to the supplier) and -520 (issued to yourself). Against an FEC Sello filed, both blocks must match the FEC's The reverse charge on a foreign service (LIVA art. 4 ¶3, RLIVA art. 25.1) has no flag on the FEC: declaring it, and any withholding, stays yours, and no Mensaje Receptor answers an FEC | refused under every matrix: a 05 supplier with no tipoDocIR 16 reference; a 06 supplier under any condición but 13; a line from a 06 supplier whose CABYS is a service (sections 5–9), since footnote 18 allows a 06 only for adquisiciones de bienes usados; a codigoActividad from a 05 or 06 supplier (CodigoActividadEmisor is checked against the padrón del RUT, where neither has an entry — Sello used to write the tenant's code there, and the sandbox answered every such FEC with -407); and in this envelope: a supplier of tipo 01, 02, 03, 04 (the annex requires it to be inscrito, which Sello cannot prove before the consecutivo; the sandbox answered a tipo 01 seller with -37); condición 13 from any supplier but a 06; tax code 08 (the used-goods factor regime) on a line from any supplier but a 06 — a foreign service states its IVA as código 01; on a 06 supplier's line, any tax code but 01 or any tarifa but those listed | referencia-tipo-doc, condicion-venta, emisor-tipo, codigo-actividad, tax-code, tax-tarifa |
Specific-tax data (impuesto[].datosImpuestoEspecifico, codigoImpuestoOtro, factorCalculoIVA) | a factorCalculoIVA within its Decimal(5,4) facet; the rest follow the tax code | a datosImpuestoEspecifico on a tax code other than 03–06 (annex footnote 9 scopes the node to those four), or missing on one of them; 04 without porcentaje and proporcion, 05 without volumenUnidadConsumo; the node on an FEE, FEC or REP, where it is inexistente; tax code 99 with no codigoImpuestoOtro, or one outside 5–100 characters; tax code 08 with no factorCalculoIVA; a codigoTarifa missing on code 01 or 07, or a tarifa missing on 01, 02, 07 or 99. Every value is held to its XSD facet under EVERY matrix, because the builder emits it verbatim: factorCalculoIVA Decimal(5,4), tarifa Decimal(4,2), cantidadUnidadMedida and volumenUnidadConsumo (7,2), porcentaje (4,2), proporcion (10,5), and none of them negative | tax-especifico, tax-codigo-otro, tax-factor, tax-tarifa |
Factor de cálculo del IVA (impuesto[].factorCalculoIVA) | the Ministerio de Hacienda factor, within Decimal(5,4), on código 08 (IVA Régimen de Bienes Usados), whose monto is factor × subtotal | a 08 without a factor, or whose monto is not factor × subtotal. It REPLACES the rate the engine would otherwise verify, so a matrix that admits one admits an amount nothing checks; a value outside Decimal(5,4), or negative, is refused under every matrix. Stating a factor never stands the IVA amount check down: where a tarifa is stated, Monto is still tarifa × base | tax-factor |
Tax the emisor bears (impuesto[].asumidoPorEmisor) | none by flag — the assumed taxes this envelope files are the ones the document itself derives, summed into TotalImpAsumEmisorFabrica: a regalía or bonificación (codigoDescuento 01/03, #474); ivaCobradoFabrica; the specific taxes 03, 04, 05 and 12, which the annex (p. 45) makes cobrados a nivel de fábrica: the emisor bears them with no flag, their TotalDesgloseImpuesto entry is 0 (p. 53), and Hacienda rejects one filed as a tax the buyer pays (-476, -488; #363) | the flag on any entry. It moves the amount into ImpuestoAsumidoEmisorFabrica and out of ImpuestoNeto, which contradicts a MontoTotalLinea and a TotalImpuesto computed without it; and it is refused under every matrix on an FEC, FEE or REP, whose schemas define no ImpuestoAsumidoEmisorFabrica | impuesto-asumido |
IVA cobrado a nivel de fábrica (ivaCobradoFabrica) | codes 01 and 02 (nota 21): the line's IVA becomes a tax the emisor bears, carried in ImpuestoAsumidoEmisorFabrica, and its ImpuestoNeto is 0 | a value outside 01/02; the field on an FEE, FEC or REP, where the element is inexistente | iva-cobrado-fabrica |
Exoneración (impuesto[].exoneracion) | on the IVA entry (código 01) of an FE, NC or ND, TipoDocumentoEX1 08, 99. porcentajeExoneracion is TarifaExonerada in tarifa POINTS (annex p. 45: 13 relieves a 13 % line in full), at most the entry's tarifa; montoExoneracion is points ÷ 100 × the line's subtotal plus its 02/04/05/12 taxes (exact, or rounded to 2); numeroDocumento of 3 to 40 characters, and for 02, 03 and 08 the number of the law that grants the exoneración, in digits (annex: "debe de indicar el número de la ley que lo autoriza" — 7210 for a zona franca), never an authorization number; articulo for 02, 03 and 08; fechaEmision an xs:dateTime. The exonerado totals are each line's montoTotal × Σ montoExoneracion ÷ Σ IVA monto | any other TipoDocumentoEX1 (01, 05–07 are inhabilitados; 11 is the notas' only and not yet filed); an exoneración on a tax other than 01, beside an assumed tax, or on an FEE; a 02/03/08 numeroDocumento that is not a law number; an amount or rate off the formula; an exonerated total off the derived one | exoneracion, resumen-field |
Otros cargos (otrosCargos[], nota 16) | up to 15 per document, each with tipoDocumentoOC 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 99, a detalle of 1 to 160 characters, a montoCargo greater than zero, and an optional porcentajeOC in whole points (10 for the 10 % service charge). 99 carries tipoDocumentoOTROS (5 to 100 characters). 04 Cobro de un tercero carries identificacionTercero (tipo 01–05, its number in its tipo's shape) and nombreTercero (5 to 100 characters) — the annex requires a registered taxpayer, which Hacienda checks and Sello cannot see before the number is spent. The charges carry no tax; Sello derives totalOtrosCargos and adds it to totalComprobante, and does not compute montoCargo from the percentage, since the annex names no base for it. A document may carry NO line when every charge is 04, 08, 09, 10 (annex p. 47); Sello then omits DetalleServicio | a code outside nota 16; 99 without tipoDocumentoOTROS, or that field on another code; 04 without its tercero, a tercero of tipo 06, or tercero fields on another code; a zero or negative montoCargo; a sent totalOtrosCargos that is not the sum of the charges, or a non-zero one with no charges; charges whose sum, or the totalComprobante they produce, does not fit 18 digits with 5 decimals; a document with no line unless every charge is 04, 08, 09, 10 | otros-cargos, resumen-field |
Discount (descuento.codigoDescuento, naturalezaDescuento) | code 01, 02, 03, 04, 05, 06, 07, 08, 09, 99; a naturalezaDescuento, when sent, of 3 to 80 characters (code points). 01 Regalías and 03 Bonificaciones are taxed on montoTotal (the value before the discount) and their IVA is carried as tax ASSUMED BY THE EMISOR: the line's ImpuestoAsumidoEmisorFabrica is the whole assessed tax, its ImpuestoNeto is 0, and the buyer owes nothing on the gift. 99 Otros carries codigoDescuentoOTRO (5 to 100 characters) and a naturalezaDescuento, both obligatory under it (annex p. 36) | a 01 or 03 whose montoDescuento is not the whole montoTotal — a regalía or bonificación gives the line away, and Hacienda rejects a partial one (-518, #474); 99 without codigoDescuentoOTRO or without naturalezaDescuento; a codigoDescuentoOTRO on any other code, or outside 5 to 100 characters; any other code; a naturaleza under 3 or over 80 characters | codigo-descuento |
Assumed tax total (resumenFactura.totalImpAsumEmisorFabrica) | omitted — Sello derives it — or the sum of the lines' ImpuestoAsumidoEmisorFabrica (zero when no line is a regalía or a bonificación) | any other value; Hacienda re-computes the sum and rejects a mismatch | resumen-assumed-tax |
References per document (informacionReferencia[]) | at most 10 (the v4.4 XSD's InformacionReferencia maxOccurs="10"). On an NC with one reference to a comprobante Sello filed, the credits are also capped at its total plus its notas de débito (annex p. 58, #473); a comprobante filed before that cap existed, another provider's clave, an NC naming several comprobantes, or a comprobante with a credit a nota de débito annulled is left to Hacienda. Only notas filed through Sello for the account are counted: a nota de débito filed by another route is not | an eleventh reference | referencia-count |
Reference code (NC and ND informacionReferencia[].codigo) | 01, 02, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 99; required whenever tipoDocIR is not 13 (annex pp. 57–58). 13, 14, 15 and 16 are the 2026-04-22 annex update — usable since that date, obligatory from 2026-11-01; plus 17 on a REP only, which annex nota 9 footnote 35 reserves to it | a reference with no codigo (except under tipoDocIR 13, Facturación mes vencido); 99 Otros without its codigoReferenciaOTRO (5 to 100 characters, obligatory under it, annex p. 58), or that field on any other código; 17 on anything but a REP — annex nota 9 footnote 35 reserves it to the Recibo Electrónico de Pago and only the REP schema enumerates it; 12 on anything but an NC (nota 9 item 3); a código naming the other kind of nota — 06 on an ND, 09 on an ND, 10 on an NC; on an ND, an annulling código (01, 13) whose tipoDocIR is not 03 — the annex names one annulment a nota de débito makes, of a nota de crédito (§d, p. 56); 16 whose tipoDocIR is not 10 (Comprobante electrónico rechazado por el Ministerio de Hacienda, nota 10) — Hacienda answers -29 to a replacement that names the rejected comprobante as anything else (sandbox run 36727891368; refiled as 10 it was accepted, run 36729167998); 03 does not exist in v4.4 | referencia-codigo |
Reference document type (informacionReferencia[].tipoDocIR) | 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 99; 99 Otros carries tipoDocRefOTRO (5 to 100 characters, obligatory under it, annex p. 57) | 99 without tipoDocRefOTRO, or that field on any other type; under every matrix, a nota citing an FEC (17 or 18) beside a reference of another type, since the two need opposite emisors; in this envelope, a nota to an FEC whose emisor is not tipo 05 | referencia-tipo-doc, emisor-tipo |
Reference number (informacionReferencia[].numero) | for an electronic comprobante (tipoDocIR 01–04, 09, 10, 11, 12, 15, 17, 18, 19, 20): its 50-digit clave, with a clave's structure (506, the date ddMMyy, the 12-digit identificación, the 20-digit consecutivo, situación 1–3, an 8-digit code), a real encoded date that is fechaEmisionIR's Costa Rica day, and — where tipoDocIR names one type (01–04, 12, 15, 17, 19, 20) — that type in the consecutivo's 9th–10th digits and this taxpayer's identificación (zero-padded to 12) as its issuer; free text for a paper document | fifty digits that are not a clave; a clave dated another day than fechaEmisionIR; an FE clave under tipoDocIR 03, or any such mismatch; another taxpayer's clave; on an NC or ND, a clave Sello filed for this account whose receptor is not this document's — the annex requires the original's receptor (Receptor › Número) and Hacienda rejects a mismatch — or, for a factura electrónica de compra, whose emisor or receptor is not this nota's (a nota to an FEC keeps its roles; Hacienda answers -520 and -60); on an NC with that single reference, a credit that would take the credits on that comprobante past its total plus its notas de débito (annex p. 58: "no podrán superar el monto acumulado del comprobante … más la suma de las notas de débito"), counting credits still pending and not those Hacienda rejected | referencia-numero |
Reference date (informacionReferencia[].fechaEmisionIR) | an xs:dateTime with hours 00–23 and a real calendar date, e.g. 2026-09-02T10:15:00-06:00, no more than ten years before the document's fechaEmision | a reference more than ten years old (the annex: "no supere una antigüedad de 10 años"); a date without a time; the schema's 24:00:00 (send 00:00:00 of the next day); February 30th; year 0000; any other shape | referencia-fecha |
Reference number (informacionReferencia[].numero) | the referenced comprobante's 50-digit clave when tipoDocIR names an electronic document (01–04, 09, 10, 11, 12, 15, 17, 18, 19, 20); free text up to 50 characters for the other types | anything but a 50-digit clave for those types | referencia-numero |
Reference reason (informacionReferencia[].razon) | 3 to 180 characters, counted as the XSD counts them (code points); required whenever tipoDocIR is not 13 (annex pp. 57–58: "Deberá contener mínimo 3 caracteres y un máximo de 180") | a reference with no razon (except under tipoDocIR 13, Facturación mes vencido); a razón under 3 or over 180 characters | referencia-razon |
| Detalle (line description) | 3 to 200 characters, counted as the XSD counts them (code points; CRLF is one) | shorter or longer | detalle |
| Characters (every string field) | XML 1.0 characters: tab, LF, CR, U+0020 and up; any emoji | control characters such as NUL or U+0001; lone surrogates — escapeXml does not remove them, so the document could not be signed or would be rejected after the consecutivo | xml-chars |
| Unidad de medida | the 101 values of the v4.4 UnidadMedidaType enumeration (e.g. Unid, Sp, kg, m, L, h) | anything else, including a different case | unidad-medida |
| CABYS codes enabled for surtidos | the three catalog codes Hacienda enables for combos/surtidos/paquetes (2399999002200, 3532901000000, 3532902000000), each with the two obligations the annex attaches to them, and only for an emisor that has stated manufacturerOrImporter: true on its profile — annex footnote 8 reserves surtidos to fabricantes, industriales e importadores, and no Hacienda source says who is one, so the statement is the customer's and the profile audit records who made it | such a code without a detalleSurtido, or without a codigoComercial of tipo 03 carrying at least 3 characters — the annex makes both obligatory on such a line | cabys-surtido |
| CABYS codes whose sector owes extra line fields | a line whose CABYS names a sector the v4.4 annex gives obligatory extra elements carries them: medicamentos para uso humano (prefixes 3562, 3563 → RegistroMedicamento and FormaFarmaceutica); vehículos automotores y motocicletas (prefixes 4911, 4912, 4913, 4914, 4991 → NumeroVINoSerie) | such a line with any of its owed fields absent — the annex makes them obligatory, and Sello refuses the absence rather than sign an incomplete line | cabys-sector |
Código comercial (codigoComercial) | up to 5 { tipo, codigo } pairs per line, tipo 01, 02, 03, 04, 99 (nota 12: 01 vendedor, 02 comprador, 03 fabricante/industrial/importador, 04 uso interno, 99 otros), codigo 1 to 20 characters | more than 5 pairs, a tipo outside nota 12, a codigo over 20 characters, and the field on a REP, where CodigoComercial is inexistente | codigo-comercial |
Surtidos (detalleSurtido, the Detalle de Productos del Surtido node) | on FE, TE, NC, ND, and only for an emisor that has stated manufacturerOrImporter: true on its profile — annex footnote 8 reserves surtidos to fabricantes, industriales e importadores, and no Hacienda source says who is one, so the statement is the customer's and the profile audit records who made it: up to 20 components per line, each a full product line of its own (CABYS, cantidad, unidad de medida, detalle, precio unitario, monto total, up to 5 descuentos, subtotal and at least one tax). The line's own price, total and tax entries are the ROLL-UP of its components: the annex computes the package's tax as "la suma de los montos de impuestos individuales de las líneas de detalle de los componentes del surtido" | a detalleSurtido on any other type or on an NC or ND that modifies an FEE, or from an emisor that has not stated manufacturerOrImporter: true (refused as surtido, before the consecutivo); a surtido line whose own impuesto carries an exoneración (refused as exoneracion: the line's tax is the roll-up of its components and carries no tarifa, so the relief cannot be checked). Refused under every matrix: the node on an FEC or REP, where it is inexistente; more than 20 components; a component CABYS that is not 13 characters, a detalle outside 3–200, a unidad de medida outside the enumeration, a negative amount, more than 5 descuentos, a código 99 descuento with no descuentoSurtidoOtros of 3–80 characters, a component with no tax; a component discounted under código 01 (regalía) or 03 (bonificación), because the annex taxes that gift on its monto total and counts the IVA as assumed by the emisor (pp. 32 and 46) and Sello does not yet carry a component's assumed IVA into the line and the resumen — bill the gift as its own line, which is supported; a datosImpuestoEspecifico on a component of an FEE, where DatosImpuestoEspecificoSurtido is inexistente; and, on the surtido line itself, a datosImpuestoEspecifico or an IVA rate of its own — the annex says "no se deberá utilizar este campo" there and puts both on the component | surtido |
Sector fields (tipoTransaccion, unidadMedidaComercial, numeroVINoSerie, registroMedicamento, formaFarmaceutica, emisor.registrofiscal8707) | all six; tipoTransaccion as nota 22 code 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, each code but 01 on a line that meets its nota 22 rule (exento codes at codigoTarifa 10, gravado codes at a positive tarifa) | Each is refused, under every matrix, outside its XSD facet (tipoTransaccion outside nota 22's 01–13; unidadMedidaComercial over 20 characters; a numeroVINoSerie over 17, or more than 1000 of them; registroMedicamento over 100; formaFarmaceutica over 3, or not a code of nota 19's Código de forma Farmacéutica list exactly as published (04, not 004; Hacienda answers -403 otherwise); registrofiscal8707 not 1–12 digits) and on a document type where the element is inexistente — tipoTransaccion on a TE, and all six on a REP | tipo-transaccion, unidad-medida-comercial, numero-vin, registro-medicamento, registro-fiscal-8707 |
Otros (otros.otroTexto, otros.textos[], otros.contenidos[]) | free text with no tax meaning, emitted as <Otros>: every OtroTexto (the single otroTexto first, then textos) before any OtroContenido, each 1 to 500 characters as the XSD counts them, with an optional codigo attribute of 1 to 500 | a text or codigo outside those bounds; any of them on a REP, whose schema has no Otros | otros |
| Cantidad | a Decimal(16,3) greater than zero — the annex (Cantidad, p. 27): "Se deberá incluir un valor mayor a cero. Caso contrario se rechazará el comprobante" | zero; a negative quantity; not a decimal | cantidad |
Line amounts (precioUnitario, montoTotal, descuento.montoDescuento, subtotal, montoTotalLinea) | zero or positive — the XSD types each as DecimalDineroType, minInclusive 0, and MontoTotal is cantidad × precioUnitario; precioUnitario itself is greater than zero (annex PrecioUnitario) | a negative amount; a zero precioUnitario (the annex's surtido exception is refused above); a negative cantidad against a positive precioUnitario (a reversal is a nota de crédito) | monto-linea |
SubTotal (subtotal) | exactly montoTotal − descuento.montoDescuento (the annex defines SubTotal that way for every line, and computeLineItem derives it so) | any other value — Hacienda re-derives SubTotal and rejects the document after the consecutivo; a wrong SubTotal beside a consistent montoTotalLinea used to pass | subtotal |
Line fields a non-REP document requires (codigo, cantidad, unidadMedida, precioUnitario) | all four present, on FE, TE, NC, ND, FEC and FEE — CodigoCABYS, Cantidad, UnidadMedida and PrecioUnitario are condition 1/2 for those six types | any of the four absent. They are condition 4 (non-existent) on a recibo electrónico de pago alone, so a REP omits all four and no other type may. The refusal lands before the consecutivo is allocated, so it costs no fiscal number | linea-field |
Resumen totals that must be absent or 0 | none — every resumen total is derived, and a stated one must equal Sello's derivation | a stated total that differs from the derived one | resumen-field |
| Fecha de emisión | an xs:dateTime with hours 00–23 and a real calendar date, in the Costa Rica offset -06:00; today, in Costa Rica, under situación 1 or 2 (/v1 sets it for you); today or earlier under situación 3 (sin internet) | any other shape or offset; the schema's 24:00:00 (send 00:00:00 of the next day); another date with situación 1 or 2; a future date under any situación | fecha-emision |
Situación (situacion) | 1 normal (the default); 3 sin internet; 2 contingencia WITH an informacionReferencia entry carrying both tipoDocIR 08 ("Comprobante emitido en contingencia", nota 10) and codigo 05 ("Sustituye comprobante provisional por contingencia", nota 9) in the same entry, naming the paper voucher's own number and date — the annex requires it outright (§d of the document description: "en el caso de comprobantes electrónicos que sustituyen comprobantes físicos emitidos por contingencia, se debe hacer referencia al comprobante provisional"; §g p. 67 defines the digit) | 2 with no such reference, or whose references never pair 05 with 08: a contingency clave for a document that replaces nothing. Hacienda accepts such a document (no XSD facet ties the clave's 42nd digit to the reference block) and the trail from the paper voucher to the filed comprobante then does not exist and cannot be added, because the clave is signed. Situación 3 (sin internet) is not subject to this: §g gives it its own definition and no physical voucher is involved | situacion |
Reference codes 13–17, and the period a correction lands in
Hacienda's 2026-04-22 revision of the annexes added 13, 14, 15, 16, 17 to nota 9.
They may be used since that date and are obligatory from 2026-11-01.
13, 14, 15, 16 are legal on all seven document types. 17 is not:
footnote 35 reserves it to the Recibo Electrónico de Pago, and only that schema enumerates it,
so Sello refuses 17 anywhere else (referencia-codigo) rather than signing a document Hacienda would reject.
The accounting effect. Used on a nota de crédito or de débito, 01, 02, 06, 12 land their accounting effect in the period the nota was issued, while 13, 14 land it in the period of the comprobante being corrected.
Sello signs the código you send; it does not file your declaración autoliquidativa,
so choosing between 02 and 14 decides which period the correction lands in, and that choice is yours.
The replacement after an annulment. After an annulment with 01 the replacement comprobante references the annulled document with 07; after an annulment with 13 the replacement comprobante references the annulled document with 15.
Sello does not check the pairing and cannot: it judges one document at a time, and the nota that annulled
the comprobante your replacement references is a different document. Hacienda checks the pair on its side.
The replacement after a rejection. 16 replaces a comprobante Hacienda rejected. The replacement takes a new consecutivo,
and its reference names the rejected document by its clave with tipoDocIR 10, not 01:
a rejected comprobante is not on record as a factura. This rule sits inside one reference entry, so Sello checks it
and refuses any other tipoDocIR under 16 (referencia-codigo) before a consecutivo is spent.
What is refused, and whether it is planned
| Refused family | scenarios[] id(s) | Status |
|---|---|---|
Factura de compra (FEC) from a supplier of tipo 01–04 — régimen especial agropecuario, régimen simplificado | emisor-tipo | planned, the follow-up to #678 — the annex requires that supplier to be inscrito, and Sello cannot prove it before the consecutivo (the sandbox answered a tipo 01 seller with -37) |
Exoneración of TipoDocumentoEX1 02, 03, 09 and 10 | exoneracion | planned — each is one matrix entry and an accepted sandbox golden, and none has its golden yet |
Exoneración of TipoDocumentoEX1 04 (Exenciones DGH autorizadas) | exoneracion | the /fe/ex check is built (#669) and binds the day 04 is admitted; it waits on a current authorization to file its sandbox golden with |
Exoneración of TipoDocumentoEX1 11 (autorización de impuesto local concreta) | exoneracion | not planned yet — Hacienda checks it against an authorization Sello cannot read before the consecutivo |
Exoneración of a tax other than IVA 01 (a specific tax, or a factor line) | exoneracion | not planned — the exonerado totals are the share of the line's IVA, and nothing derives the relief of a specific tax |
Exoneración beside an assumed tax (codigoDescuento 01/03, ivaCobradoFabrica, asumidoPorEmisor, or a specific tax 03/04/05/12 — cobrado a nivel de fábrica, so assumed with no flag) | exoneracion | not planned — the annex (p. 46) gives no rule for netting the relief out of an assumed tax; bill the exonerated sale on its own line |
Exoneración on a factura de exportación (FEE) | exoneracion | not planned — the element does not exist in the FEE schema; an export is exempt at tarifa 10 |
Exoneración on a recibo electrónico de pago (REP) | exoneracion | not planned — the element does not exist in the REP schema |
Exoneración on a factura de compra (FEC) | exoneracion | not yet — no sandbox golden files one; the published matrix admits it on an FE, an NC and an ND only |
Exoneración on a tiquete electrónico (TE) | exoneracion | not yet — no sandbox golden files an exonerated TE, and a TE names no receptor whose exoneración it would be |
A tax the emisor bears by FLAG (asumidoPorEmisor) on a specific tax the buyer would otherwise pay — 02, 06 or 99 | impuesto-asumido, resumen-field | the engine computes it since #363; the envelope derives the assumed taxes the document itself states (regalías, ivaCobradoFabrica, and 03/04/05/12, which the annex makes cobrados a nivel de fábrica) and admits the flag once a live acceptance proves it on another código |
| Several medios de pago on one REP | medio-pago | not planned — the REP shape that earned sandbox acceptance carries one method and no TotalMedioPago; issue one REP per medio |
The special export tax on a good (montoExportacion, annex p. 44) | monto-exportacion | not yet — no sandbox run has settled its tax code or whether it counts in the totals, so an FEE files at tarifa 10 with none |
| Transitional IVA tariffs 05 and 06 on an FE, and 07 anywhere | tax-tarifa | not planned — nota 8.1 reserves 05 and 06 for notas de crédito y débito and disables 07 |
| Condición de venta 10 on several IVA rates, a zero rate, an exoneración or otros cargos | condicion-venta | blocked on #666 question 2 — a tax adviser has to answer how a partial payment is applied across rates |
| Condición de venta 10 or 11 in a currency other than CRC | condicion-venta | blocked on #666 question 3 — a tax adviser has to answer which exchange rate a code-11 REP uses |
Tiquete or factura: which one to issue
A tiquete electrónico (TE) is for a sale to a consumidor final, the
buyer who uses what it buys (Decreto 44739-H, art. 2 inc. 25). The buyer
cannot use a tiquete to justify a gasto or claim a tax crédito (arts. 2.25 and
20). So:
- Send a TE for a counter sale. The receptor is optional: send none, a name alone, or a name with an identificación (annex p. 22 makes the Receptor condition 2 on a TE). Hacienda checks an identificación you send against its padrones.
- Send an FE when the buyer will deduct the purchase, or asks for a factura. The decree owes the buyer one then (art. 4.1.f).
- Sello cannot tell which one you need from the cédula. A company can be a
consumidor final, and a person can buy for a business, so Sello does not
refuse a TE to a cédula jurídica. It refuses one signal outright: a TE that
carries
codigoActividadReceptor. The tiquete schema has no such element, and a buyer naming its actividad is buying for its business. - To annul or correct a TE, send an
NCorNDwithtipoDocIR04. If the TE named nobody, the nota names nobody either; if it named a buyer, the nota names the same buyer (annex p. 23: a nota's receptor must match the original's).
Factura de compra: when you are the buyer
A factura electrónica de compra (FEC) is the document you issue for
something you bought, when the seller cannot issue one to you. You are the
receptor and you sign it; the seller is the emisor. Sello files two kinds of
seller for now:
- A supplier abroad (emisor tipo
05, Extranjero No Domiciliado), for a service or good bought from outside Costa Rica. Send its own invoice as aninformacionReferenciawithtipoDocIR16; the annex (p. 19) makes that reference obligatory. State the line's IVA as código01with its tarifa; tax código08, the used-goods factor, is refused on an FEC. - A private seller of used goods (emisor tipo
06, No Contribuyente), under condición de venta13. The seller charges no IVA, so each line is IVA código01at tarifa10(exenta) or11(no sujeta). Every line must be a good (a CABYS starting0–4): the annex allows this seller only for used goods, so a service from a private person is refused.
A seller who is a Costa Rican taxpayer (tipo 01–04, for example a régimen
especial agropecuario producer) is refused for now: the annex requires that
seller to be inscrito, and Sello cannot check that before it spends a number.
Three things work differently from an FE:
- Leave out
codigoActividad. On an FEC it is the seller's activity, and neither kind of seller has one in the RUT. Your own activity goes incodigoActividadReceptor, which an FEC requires. - The reverse charge is yours. When you buy a service from abroad, the IVA on it falls on you (Ley 9635 art. 4, third paragraph; reglamento art. 25.1). The FEC has no field that declares it, so Sello does not compute it: you declare it, and any withholding, in your own return.
- Nobody answers an FEC. There is no Mensaje Receptor for it, because you are already the receptor.
To correct or annul an FEC, send an NC (tipoDocIR 17) or an ND
(tipoDocIR 18) naming its clave. The nota keeps the FEC's roles: the
seller the FEC named is its emisor, with no address (the nota's emisor
block has no otrasSenasExtranjero, and leave out ubicacion), and you
are its receptor and sign it. That is the one shape Hacienda's sandbox
accepted; with you as emisor it rejected the nota whichever receptor it named.
For now the seller must be a supplier abroad (tipo 05), and a nota to an FEC
cites nothing else.
Why refuse rather than try
Every refused row is a shape Sello has not proven end to end against Hacienda, or one the XML builder cannot express yet. A document that Hacienda rejects after Sello signed it has already consumed a number out of your series, and a document Hacienda accepts with the wrong shape is worse: it is legally binding and wrong forever. A 422 that names the field is the cheap failure.
Ten rows are not about support at all. A cantidad that is not greater than zero, a negative
line amount (or a negative cantidad against a positive precioUnitario), a
subtotal that is not montoTotal minus the line's discount, a
normal-situation document dated on another day, a contingency document
(situacion 2) that references no paper voucher, a correo electrónico without
the structure both Hacienda expressions admit, a Nombre, Ubicación or Teléfono
outside the XSD's facets, and a character XML 1.0 forbids in any string field
are invalid documents under the v4.4 XSD and annex, and are refused for that
reason — every matrix keeps them, because Hacienda would reject the signed
document after the consecutivo is spent.
The wording of every refusal in this band speaks about this request: it
allocated no consecutivo, charged no quota and reserved no idempotency key.
It says nothing about the key itself — an earlier request under the same
Idempotency-Key may have settled after its lease lapsed — which is why the
right retry is always the same key with a corrected body: you replay that
answer if there is one, and file once if there is not.
What is not on this page
- Validation. Malformed bodies (a missing field, a bad decimal, a
condicionVentathe document type's schema does not allow) are refused by validation first, withtypehttps://sello.cr/problems/validation. The matrix judges a well-formed document. - CABYS. A code that is not in the catalog is its own refusal; see CABYS and IVA rates.
- The Odoo connector. It maps posted customer invoices to
FEand credit notes toNC, inside this matrix. Anything else it finds in your Odoo is reported in the invoice's chatter, not filed. - The portal. Documents → Emitir factura issues an
FEor aTEin colones with IVA lines, and an acceptedFEorTE's page issues anNCor anNDagainst it, all inside this matrix.FEC,FEEandREP, and every other shape, go through/v1or the Odoo connector. See Desde el portal.
Related
- Issuing documents — the seven types and the
tipodiscriminator. - Error handling — the problem+json shape.
- Contingencia — qué hacer si Hacienda no responde: the situación
2document this matrix admits, and the two-business-day replacement window that follows an outage.