Skip to content

Create a proforma (non-fiscal quote)

POST
/v1/proformas
curl --request POST \
--url https://api.emite.cr/v1/proformas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "receiver": { "id": "01a00c73-5c09-7bb5-8b9e-d91c43bd61dc", "identificationType": "01", "identificationNumber": "3101234567", "name": "Futurabyte CR S.A.", "commercialName": "Futurabyte", "economicActivityCode": "6201.0", "location": { "provincia": "1", "canton": "01", "distrito": "01", "barrio": "Carmen", "otrasSenas": "50 metros norte de la iglesia, edificio azul" }, "phoneCountryCode": "506", "phoneNumber": "22223333", "phone": "50622223333", "email": "ventas@emite.cr", "notificationEmail": "notificaciones@emite.cr", "otrasSenasExtranjero": "1234 Ocean Ave, Miami, FL 33101, USA" }, "receiverId": "01a00c73-5c07-7bb5-8b9e-d20f16537e42", "currency": "AED", "exchangeRate": 540, "saleCondition": "01", "validUntil": "2026-06-30T23:59:59Z", "notes": "Cotización válida sujeta a disponibilidad.", "lines": [ { "lineNumber": 1, "code": "8399000000000", "partidaArancelaria": "850431200090", "vinNumbers": [ "1HGCM82633A004352" ], "pharmacyRegistry": "CR-MED-2024-1234", "pharmaceuticalForm": "01", "quantity": 1, "unitOfMeasure": "Unid", "transactionType": "01", "commercialUnitOfMeasure": "Caja de 12", "commercialCodes": [ { "tipo": "01", "codigo": "SKU-IMP-350" } ], "description": "Servicio de consultoría TI — bloque mensual", "unitPrice": 10000, "discounts": [ { "monto": 500, "codigoDescuento": "01", "naturaleza": "Descuento por volumen" } ], "subtotal": 10000, "taxes": [ { "codigo": "01", "codigoTarifa": "01", "tarifa": 13, "factor": 0.13, "monto": 1300, "exoneracion": { "tipoDocumento": "01", "tipoDocumentoOtro": "Resolución especial 2024-001", "numeroDocumento": "AL-001-2024", "articulo": "15", "inciso": "a", "nombreInstitucion": "01", "nombreInstitucionOtros": "Caja Costarricense de Seguro Social", "fechaEmision": "2024-01-15T10:00:00-06:00", "tarifaExonerada": 13, "montoExoneracion": 1300 }, "datosEspecifico": { "cantidadUnidadMedida": 355, "porcentaje": 5, "proporcion": 17.75, "volumenUnidadConsumo": 355, "impuestoUnidad": 18.5, "esJabonTocador": false } } ], "surtido": [ { "cabysCode": "2310100000000", "commercialCodes": [ { "tipo": "01", "codigo": "SKU-IMP-350" } ], "cantidad": 1, "unidadMedida": "Unid", "unidadMedidaComercial": "Caja", "detalle": "Arroz 1kg", "precioUnitario": 1000, "montoTotal": 1000, "discounts": [ { "monto": 100, "codigo": "01", "otros": "Descuento de temporada" } ], "subtotal": 1000, "ivaCobradoFabrica": "01", "baseImponible": 1000, "taxes": [ { "codigo": "01", "codigoTarifa": "08", "tarifa": 13, "datosEspecifico": { "cantidadUnidadMedida": 355, "porcentaje": 5, "proporcion": 17.75, "volumenUnidadConsumo": 355, "impuestoUnidad": 18.5, "esJabonTocador": false }, "monto": 130 } ] } ], "total": 11300 } ] }'

Creates a proforma in draft status with an auto-assigned number (e.g. PRO-00001). A proforma is NOT a fiscal document: it never gets a clave/consecutivo, never reaches Hacienda, and is env-agnostic (visible regardless of the tenant active environment). Convert it to a draft invoice later with POST /v1/proformas/:id/convert.

Media typeapplication/json
object
receiver

Inline receiver. Mutually exclusive with receiverId.

object
id

Not used: ignored when a company is created, and kept as sent in the inline party of a document.

string
Example
01a00c73-5c09-7bb5-8b9e-d91c43bd61dc
identificationType
required

Hacienda identification type: 01 cédula física, 02 cédula jurídica, 03 DIMEX, 04 NITE, 05 foreign (extranjero no domiciliado), 06 no contribuyente. Only 01–04 with an all-digit number can issue documents, because the clave embeds it.

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

Number of that identification, without separators, normalized to uppercase. Its format depends on identificationType: 01 9 digits; 02 10 positions — from 2026-11-01 the last six may be alphanumeric (decree 44648-MJ), e.g. 3101A1B2C3, which can receive documents but not issue them; 03 11–12 digits; 04 10 digits; 05 up to 20 letters, digits or hyphens; 06 9–12 digits.

string
Example
3101234567
name
required

Legal name (razón social) — <Nombre> in the XML, cut to 100 characters. A company's name cannot change through PATCH /tenants/:id (400 IMMUTABLE_FIELD): POST /tenants/:id/hacienda-sync takes it from Hacienda's registry.

string
Example
Futurabyte CR S.A.
commercialName

Trade name — <NombreComercial> in the XML when present, cut to 80 characters.

string
Example
Futurabyte
economicActivityCode

Only when creating a company: becomes its default economic activity, in Hacienda's dotted form (e.g. 6201.0). Ignored afterwards — activities are managed in /tenants/:tenantId/economic-activities — and in a document's inline party, whose activity is the document's economicActivityCodeReceptor.

string
Example
6201.0
location

Address in Costa Rica — <Ubicacion> in the XML. A company cannot issue without it (422 TENANT_LOCATION_MISSING). In a document it is never written for a 05 party; in a purchase invoice (FEC), a supplier of type 01–04 must carry it (400 SUPPLIER_LOCATION_REQUIRED).

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).

string
nullable
Example
506
phoneNumber

National number, digits only (5-20).

string
nullable
Example
22223333
phone

Deprecated: a legacy single-string phone (+506 22223333). Send phoneCountryCode + phoneNumber instead; this one is only parsed for the XML when those are absent.

string
Example
50622223333
email

Email address — <CorreoElectronico> in the XML. For a company, its main address and where its notices go when notificationEmail is empty; for a document's customer, where the accepted document is emailed.

string
Example
ventas@emite.cr
notificationEmail

Company only: a separate address for the system's notices to it (rejections, errors, summaries…). Set it with PATCH /tenants/:id; "" or null clears it and the notices go back to email. Ignored on creation and in a document's party.

string
nullable
Example
notificaciones@emite.cr
otrasSenasExtranjero

Address abroad, free text — <OtrasSenasExtranjero>, 5–300 characters in Hacienda's schema. Written only for a foreign (05) party, and required when that party is the supplier of a purchase invoice (400 SUPPLIER_FOREIGN_ADDRESS_REQUIRED).

string
Example
1234 Ocean Ave, Miami, FL 33101, USA
receiverId

Id of a contact in the company's contacts (/v1/tenants/{tenantId}/parties), marked as a customer, to quote to; its data is copied onto the proforma. Mutually exclusive with receiver (400 RECEIVER_BOTH_PROVIDED); a contact that is not a customer gives 400 PARTY_NOT_CUSTOMER. Omit both to quote without a receiver.

string
Example
01a00c73-5c07-7bb5-8b9e-d20f16537e42
currency
required

ISO 4217 currency of the quote; it must be one of the currencies enabled for the company (400 CURRENCY_NOT_ENABLED otherwise). The invoice created from the proforma keeps it.

string
Allowed values: AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYR BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XCD XDR XOF XPF XSU XUA YER ZAR ZMW ZWL
Example
CRC
exchangeRate

Exchange rate to colones (CRC per unit of currency) to show on the quote, up to 5 decimals. Optional and never fetched automatically, since a quote is not fiscal; the invoice created from the proforma receives it as its rate.

number
Example
540
saleCondition

Sale condition shown on the quote, and the default for the invoice created from it. Hacienda codes (<CondicionVenta>, Anexo nota 5): 01 cash, 02 credit, 03 consignment, 04 layaway, 05 lease with an option to buy, 06 lease in a financial function, 07 collection on behalf of a third party, 08 services to the State on credit, 09 payment of a service to the State (REP only), 10 credit sale under article 27 of the IVA law, 11 payment of a 10 sale (REP only), 12 goods not yet nationalized, 13 used goods sold by a non-taxpayer (FEC only), 14 operating lease, 15 financial lease, 99 other.

string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 99
Example
01
validUntil

Instant until which the quote is valid (ISO 8601). Once it has passed, a sent proforma reads as expired. Omit for a quote without a deadline.

string
Example
2026-06-30T23:59:59Z
notes

Free-text note printed on the quote PDF. It is not carried into the invoice created from the proforma.

string
Example
Cotización válida sujeta a disponibilidad.
lines
required

The quoted lines, in the same shape as an invoice's; at least one (PROFORMA_LINE_REQUIRED). Their amounts are checked like an invoice's (422 INVOICE_TOTALS_MISMATCH), and they become the lines of the invoice created from the proforma. Tax exonerations and combo (surtido) components are not kept on a proforma.

Array<object>
object
lineNumber
required

Number of the line in the document, starting at 1, emitted as <NumeroLinea>; the lines are written to the XML in the order of this number.

number
Example
1
code

13-digit CABYS code (Costa Rica's catalog of goods and services, published by the BCCR) of what the line sells, emitted as <CodigoCABYS>; Hacienda checks it against the catalog in force. Required on every document except a payment receipt (10), whose lines carry none (LINE_CABYS_REQUIRED). Its first digit also places the line among the services (5 to 9) or the goods (0 to 4) in the document totals.

string
Example
8399000000000
partidaArancelaria

Customs tariff heading of the goods (partida arancelaria), emitted as <PartidaArancelaria> and only on an export invoice (09). There it is required, with exactly 12 letters or digits, on every line whose CABYS code starts with 0 to 4, that is, goods (PARTIDA_ARANCELARIA_REQUIRED).

string
>= 1 characters <= 12 characters
Example
850431200090
vinNumbers

VIN or serial number of each vehicle, aircraft or vessel the line sells, one entry per unit, exactly 17 characters each (VIN_LENGTH); each is emitted as a <NumeroVINoSerie>. Hacienda asks for them when the CABYS code is a means of transport.

Array<string>
<= 1000 items
Example
[
"1HGCM82633A004352"
]
pharmacyRegistry

Ministry of Health registration number of the medicine the line sells, emitted as <RegistroMedicamento>. Hacienda asks for it when the CABYS code is a medicine with a sanitary registration.

string
<= 100 characters
Example
CR-MED-2024-1234
pharmaceuticalForm

Code of the medicine's pharmaceutical form from Hacienda's catalog (Anexo nota 19, «Código de forma farmacéutica»), emitted as <FormaFarmaceutica>; a code outside it is refused (PHARMACEUTICAL_FORM_INVALID). Like pharmacyRegistry, Hacienda asks for it on medicines with a sanitary registration.

string
Example
01
quantity
required

Quantity sold, greater than 0, up to 3 decimals, emitted as <Cantidad>. A payment receipt (10) has no quantity in its XML: there quantity × unitPrice is the amount being paid, without tax.

number
Example
1
unitOfMeasure
required

Unit of measure, as a symbol from Hacienda's catalog (Anexo nota 15), emitted as <UnidadMedida>: for example Unid (unit), Kg (kilogram), L (litre), h (hour), Sp (professional services), St (technical services) or Os (other service). The symbols are case-sensitive; Hacienda checks them, the API does not. A payment receipt (10) does not use it.

string
Example
Unid
transactionType

Why the line is on the document (Anexo nota 22), emitted as <TipoTransaccion>. Omit it for a normal sale, which is how Hacienda reads a line without it:

  • 01: normal sale of goods and services.
  • 02 / 03: the business consumes its own goods (autoconsumo), exempt / taxed.
  • 04 / 05: the business consumes its own services (autoconsumo), exempt / taxed.
  • 06 / 07: membership fee, taxed / exempt.
  • 08 / 09 / 10: capital goods for the issuer, for the receiver, or for both.
  • 11: capital goods withdrawn for the issuer's own use, exempt.
  • 12: capital goods transferred to third parties without consideration, exempt.
  • 13: goods withdrawn for own use or transferred to third parties without consideration.

Accepted on an invoice (01), a purchase invoice (08), an export invoice (09) and the credit and debit notes (03, 02); a ticket (04) and a payment receipt (10) have no such element (LINE_NOT_ALLOWED_FOR_DOCTYPE, reason transaction_type). The self-consumption of a business goes on an invoice to the business itself.

A type that names a tax condition must match the line: 02, 04, 07, 11 and 12 are exempt and carry no IVA at a positive rate, and 03 and 05 are taxed and carry one (LINE_TRANSACTION_TYPE_TAX_MISMATCH). A note that corrects such a line declares the same type, as the Anexo asks; POST /v1/invoices/{id}/credit-note copies it.

string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11 12 13
Example
05
commercialUnitOfMeasure

The business's own unit for the line, not a standard measure (a box, a pallet), emitted as <UnidadMedidaComercial> next to unitOfMeasure, which stays required. Up to 20 characters. A payment receipt (10) has no such element (LINE_NOT_ALLOWED_FOR_DOCTYPE, reason commercial_unit).

string
<= 20 characters
Example
Caja de 12
commercialCodes

The product's own codes (the seller's SKU, the buyer's code, a GTIN…), each emitted as a <CodigoComercial>. tipo (Anexo nota 12): 01 seller's code, 02 buyer's code, 03 code assigned by the manufacturer (industrial or importer), 04 internal-use code, 99 other. A combo line (surtido) must carry one of type 03 with the package's SKU or GTIN (SURTIDO_COMMERCIAL_CODE_REQUIRED).

Array<object>
<= 5 items
object
tipo
required

Who assigned the code (<CodigoComercial><Tipo>, Anexo nota 12):

  • 01: the seller's product code.
  • 02: the buyer's product code.
  • 03: code assigned by the manufacturer (industrial or importer), such as a GTIN.
  • 04: internal-use code.
  • 99: other.
string
Allowed values: 01 02 03 04 99
Example
01
codigo
required

The code itself, 1–20 characters (<CodigoComercial><Codigo>).

string
Example
SKU-IMP-350
description
required

What the line sells, as the document shows it, emitted as <Detalle> (Hacienda accepts 3–200 characters). On a payment receipt (10) it describes the payment of the original invoice and, per the Anexo, names at least the instalment.

string
<= 200 characters
Example
Servicio de consultoría TI — bloque mensual
unitPrice
required

Price of one unit before discounts and taxes, in the document currency (up to 5 decimals), emitted as <PrecioUnitario>. On a combo line (surtido) the API replaces it with the sum of the components' subtotals for one unit of the combo.

number
Example
10000
discounts

Discounts on the line, each emitted as a <Descuento> (Hacienda allows at most 5). They lower the line subtotal; codes 01, 02 and 03 cover the whole line and must be its only discount (LINE_DISCOUNT_FULL_EXCLUSIVE). Not accepted on a payment receipt (10) (LINE_NOT_ALLOWED_FOR_DOCTYPE).

Array<object>
object
monto
required

Discount amount in the document currency (up to 5 decimals), emitted as <MontoDescuento>; Hacienda accepts at most the line's quantity × unitPrice. For codes 01, 02 and 03 it must equal quantity × unitPrice (LINE_DISCOUNT_FULL_REQUIRED).

number
Example
500
codigoDescuento
required

Kind of discount, emitted as <CodigoDescuento> (Anexo nota 20):

  • 01: gift (regalía). The whole line is given away; its IVA is computed on the gross quantity × unitPrice and assumed by the issuer (<ImpuestoAsumidoEmisorFabrica>), so the customer pays none of it.
  • 02: gift or bonus with the IVA charged to the customer (regalía o bonificación, IVA cobrado al cliente). The whole line; its IVA is computed on the subtotal, which the discount leaves at 0, so on a line with no other tax the IVA monto is 0.
  • 03: bonus (bonificación). The whole line, with the IVA treatment of 01.
  • 04: volume discount.
  • 05: seasonal discount.
  • 06: promotional discount.
  • 07: commercial discount.
  • 08: frequency discount.
  • 09: sustained discount.
  • 99: any other discount, described in naturaleza.

Codes 04 to 99 lower the subtotal and the IVA is computed on what remains. Codes 01, 02 and 03 must be the only discount of their line (LINE_DISCOUNT_FULL_EXCLUSIVE).

string
Allowed values: 01 02 03 04 05 06 07 08 09 99
Example
01
naturaleza

Description of the discount, emitted as <NaturalezaDescuento> (Hacienda accepts 3–80 characters). Required for code 99, with at least 5 characters (NATURALEZA_REQUIRED): for that code the same text is also emitted as <CodigoDescuentoOTRO>, which Hacienda demands.

string
Example
Descuento por volumen
subtotal
required

quantity × unitPrice minus the line's discounts, in the document currency (up to 5 decimals), emitted as <SubTotal>. The API recomputes it and answers 422 INVOICE_TOTALS_MISMATCH when it differs by more than 0.005; on a combo line (surtido) it replaces it with the value derived from the components.

number
Example
10000
taxes
required

Taxes on the line, each emitted as an <Impuesto>. Hacienda requires at least one on every line (TAX_REQUIRED), and a code may appear only once per line (DUPLICATE_TAX_CODE). An exempt line still carries IVA (01) with tariff code 10 and a monto of 0. On a combo line (surtido) the API replaces them with the sum of the components' taxes.

Array<object>
object
codigo
required

Tax code, emitted as <Codigo> (Anexo nota 8):

  • 01: IVA (value-added tax).
  • 02: selective consumption tax (impuesto selectivo de consumo).
  • 03: single tax on fuels.
  • 04: specific tax on alcoholic beverages.
  • 05: specific tax on packaged non-alcoholic beverages and toilet soaps.
  • 06: tax on tobacco products.
  • 07: IVA with a special calculation of its taxable base.
  • 08: IVA under the used-goods regime, computed with factor.
  • 12: specific tax on cement.
  • 99: another tax.

Codes 02, 03, 04, 05, 06 and 12 are accepted only on documents in CRC (EXCISE_NOT_SUPPORTED_FOR_CURRENCY), and a payment receipt (10) accepts only the IVA codes 01, 07 and 08 (LINE_NOT_ALLOWED_FOR_DOCTYPE).

string
Allowed values: 01 02 03 04 05 06 07 08 12 99
Example
01
codigoTarifa

IVA tariff code, emitted as <CodigoTarifaIVA> (Anexo nota 8.1):

  • 01: 0% rate of RLIVA art. 32.1, which keeps the full credit right (e.g. sales to the CCSS or to municipalities).
  • 02: reduced 1%.
  • 03: reduced 2%.
  • 04: reduced 4%.
  • 05: transitional 0%, for credit and debit notes only.
  • 06: transitional 4%, for credit and debit notes only.
  • 07: transitional 8%, for credit and debit notes only.
  • 08: general 13%.
  • 09: reduced 0.5%.
  • 10: exempt (Ley 9635, art. 8); the tax monto is then 0.
  • 11: 0% without credit right, to record a good or service not subject to IVA that grants no credit.

Hacienda requires it for tax codes 01 and 07. On an export invoice (09) every IVA tax must use 10 (LINE_NOT_ALLOWED_FOR_DOCTYPE, reason export_tariff).

string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11
Example
08
tarifa
required

Tax rate as a percentage (13 for 13%, 0.5 for 0.5%), emitted as <Tarifa>. With code 01 it must be the rate of codigoTarifa (Hacienda rejects a mismatch); for 02 and 99 it is the rate the applicable rule sets, and for 12 (cement) it is 5%. For code 08 the XML carries factor instead, and the per-unit codes 03 to 06 take their amount from datosEspecifico, not from this rate.

number
Example
13
factor

Factor set by the Ministry of Finance for IVA under the used-goods regime (code 08), as a decimal with up to 4 places, emitted as <FactorCalculoIVA> instead of <Tarifa>. Required for 08 (FACTOR_REQUIRED): the IVA is then the taxable base × this factor.

number
Example
0.13
monto
required

Amount of this tax in the document currency (up to 5 decimals), emitted as <Monto>: always the full tax, also when an exoneracion covers part of it. The API recomputes it and answers 422 INVOICE_TOTALS_MISMATCH when it differs by more than 0.005:

  • 01 and 07: taxable base × tarifa / 100; 08: taxable base × factor. The base is the line subtotal plus its taxes 02, 04, 05 and 12, or the gross quantity × unitPrice when the line has discount 01 or 03.
  • 02 and 12: subtotal × tarifa / 100.
  • 03 to 06: the formula of datosEspecifico.
  • Any other code is taken as sent.
number
Example
1300
exoneracion

The authorization that exonerates the customer from all or part of this tax, emitted as <Exoneracion> inside the tax. Use it on an IVA tax (01, 07 or 08), the only ones whose exoneration the line and document totals count; the tax monto stays the full tax and the exonerated share is declared in montoExoneracion. Not accepted on an export invoice (09) or a payment receipt (10) (LINE_NOT_ALLOWED_FOR_DOCTYPE).

object
tipoDocumento
required

Kind of document that grants the exoneration, emitted as <TipoDocumentoEX1> (Anexo nota 10.1):

  • 01: purchases authorized by the Dirección General de Tributación (DGT).
  • 02: exempt sales to diplomats.
  • 03: authorized by a special law.
  • 04: Dirección General de Hacienda (DGH) exemption, generic local authorization.
  • 05: DGH exemption under Transitorio V (engineering, architecture, surveying and civil-works services).
  • 06: tourism services registered with the Costa Rican Tourism Institute (ICT).
  • 07: Transitorio XVII (collection, sorting and storage of recyclable and reusable materials).
  • 08: free-trade-zone exoneration (zona franca).
  • 09: services complementary to exports (RLIVA art. 11).
  • 10: municipal corporations (corporaciones municipales).
  • 11: DGH exemption, specific local-tax authorization.
  • 99: any other document, described in tipoDocumentoOtro.

The Anexo reserves 01, 05, 06 and 07 for credit and debit notes.

string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11 99
Example
01
tipoDocumentoOtro

What kind of document it is when tipoDocumento is 99, emitted as <TipoDocumentoOTRO>. Required for 99 (EXONERACION_TIPO_DOCUMENTO_OTRO_REQUIRED); Hacienda accepts 5–100 characters.

string
Example
Resolución especial 2024-001
numeroDocumento
required

Number of the exoneration or authorization document, written exactly as the issuing institution printed it, hyphens included; emitted as <NumeroDocumento> (Hacienda accepts 3–40 characters). With tipoDocumento 02, 03 or 08 it is the number of the law that grants the exoneration. With 04 or 11 Hacienda checks it against the authorization it issued, which must be in force; GET /v1/hacienda/exoneracion/{autorizacion} reads an authorization of the AL-XXXXXXXX-XX form.

string
Example
AL-001-2024
articulo

Article of the law that establishes the exoneration, emitted as <Articulo>. Hacienda requires it for tipoDocumento 02, 03, 06, 07 and 08; its schema types it as a whole number of up to 6 digits.

string
Example
15
inciso

Subsection (inciso) of that article, when the article refers to one; emitted as <Inciso>. Hacienda's schema types it as a whole number of up to 6 digits.

string
Example
a
nombreInstitucion
required

Institution that issued the exoneration document, emitted as <NombreInstitucion> (Anexo nota 23):

  • 01: Ministry of Finance (Ministerio de Hacienda).
  • 02: Ministry of Foreign Affairs and Worship.
  • 03: Ministry of Agriculture and Livestock.
  • 04: Ministry of Economy, Industry and Commerce.
  • 05: Costa Rican Red Cross.
  • 06: Costa Rica Fire Department (Benemérito Cuerpo de Bomberos).
  • 07: Asociación Obras del Espíritu Santo.
  • 08: Federación Cruzada Nacional de Protección al Anciano (Fecrunapa).
  • 09: Escuela de Agricultura de la Región Húmeda (EARTH).
  • 10: Instituto Centroamericano de Administración de Empresas (INCAE).
  • 11: Junta de Protección Social (JPS).
  • 12: Autoridad Reguladora de los Servicios Públicos (Aresep).
  • 99: another institution, named in nombreInstitucionOtros.
string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11 12 99
Example
01
nombreInstitucionOtros

Name of the issuing institution when nombreInstitucion is 99, emitted as <NombreInstitucionOtros>. Required for 99 (EXONERACION_NOMBRE_INSTITUCION_OTROS_REQUIRED); Hacienda accepts 5–160 characters.

string
Example
Caja Costarricense de Seguro Social
fechaEmision
required

When the exoneration document was issued: an ISO 8601 date-time, emitted as <FechaEmisionEX>. With tipoDocumento 04 or 11 Hacienda checks it against the authorization and rejects the document if it differs.

string
Example
2024-01-15T10:00:00-06:00
tarifaExonerada
required

Percentage points of the tax that the exoneration covers, emitted as <TarifaExonerada>: 13 exonerates a 13% IVA in full, 4 leaves 9 points of it to pay. When it is lower than the tax's tarifa, only that share of the line's base is reported as exonerated and the rest as taxed. With tipoDocumento 04 or 11 Hacienda rejects a rate higher than the authorization grants.

number
Example
13
montoExoneracion
required

Amount of tax the exoneration covers, in the document currency (up to 5 decimals), emitted as <MontoExoneracion>: the line's IVA base × tarifaExonerada / 100, never more than the tax's monto. It is subtracted from the line's net tax; send this exact figure, because the API derives the line total and the document totals from that same calculation.

number
Example
1300
datosEspecifico

Per-unit data of a specific tax, emitted as <DatosImpuestoEspecifico>. Required for codes 03, 04, 05 and 06 (SPECIFIC_TAX_DATA_REQUIRED) and ignored for the others. The API computes the tax monto from it with the Anexo formulas, quantity being the line's:

  • 03: cantidadUnidadMedida × impuestoUnidad.
  • 04: quantity × proporcion × impuestoUnidad.
  • 05 beverage: quantity × cantidadUnidadMedida × impuestoUnidad / volumenUnidadConsumo.
  • 05 toilet soap: quantity × volumenUnidadConsumo × impuestoUnidad.
  • 06: quantity × cantidadUnidadMedida × impuestoUnidad.

Codes 03 to 06 are not accepted on a purchase invoice (08) or an export invoice (09), whose schemas have no place for this data (LINE_NOT_ALLOWED_FOR_DOCTYPE).

object
cantidadUnidadMedida
required

Quantity of the unit of measure the tax applies to, up to 2 decimals, emitted as <CantidadUnidadMedida>. Code 03 (fuel): the litres of fuel of the whole line (the tax is this × impuestoUnidad, not multiplied by the line quantity). Codes 04 and 05: the millilitres of the container sold. Code 06 (tobacco): the per-unit measure the tax is levied on (the tax is quantity × this × impuestoUnidad).

number
Example
355
porcentaje

Alcohol by volume of the beverage, as a percentage (5 for 5%, up to 2 decimals), emitted as <Porcentaje>. Required for code 04 (SPECIFIC_TAX_FIELD_REQUIRED).

number
Example
5
proporcion

Code 04: millilitres of absolute alcohol per unit, porcentaje / 100 × cantidadUnidadMedida (up to 5 decimals), emitted as <Proporcion>. Hacienda requires it for 04; when it is omitted the API computes it.

number
Example
17.75
volumenUnidadConsumo

Code 05: the reference volume in millilitres for a beverage, or the grams of toilet soap sold (up to 2 decimals), emitted as <VolumenUnidadConsumo>. Required for 05 (SPECIFIC_TAX_FIELD_REQUIRED).

number
Example
355
impuestoUnidad
required

Tax per unit of measure, as the law of each specific tax sets it (up to 5 decimals), emitted as <ImpuestoUnidad>: per litre for 03, per millilitre of absolute alcohol for 04, per reference volume for a 05 beverage, per gram for 05 soap and per unit of cantidadUnidadMedida for 06. In colones: the API accepts specific taxes only on documents in CRC.

number
Example
18.5
esJabonTocador

Code 05 only: true when the product is toilet soap, so the tax is quantity × volumenUnidadConsumo × impuestoUnidad; otherwise the beverage formula, quantity × cantidadUnidadMedida × impuestoUnidad / volumenUnidadConsumo, applies. Not part of the XML: it only selects the formula.

boolean
Example
false
surtido

Components of a combo, kit or assortment billed as one line (surtido), emitted as <DetalleSurtido>: 2 to 20 products with different CABYS codes (SURTIDO_MIN_COMPONENTS, SURTIDO_DUPLICATE_CABYS), each described for ONE unit of the combo. The API recomputes every amount of the components and of the line from the components' quantities, prices, discounts and taxes, overwriting what was sent. Not accepted on a purchase invoice (08) or a payment receipt (10) (SURTIDO_NOT_ALLOWED_FOR_DOCTYPE). The Anexo allows a combo to be billed this way only by its manufacturer or importer; anyone else lists its products as separate lines.

Array<object>
object
cabysCode
required

13-digit CABYS code of the component, emitted as <CodigoCABYSSurtido>; Hacienda checks it against the catalog in force. No two components of a combo may share one (SURTIDO_DUPLICATE_CABYS).

string
Example
2310100000000
commercialCodes

Optional codes of the component (the seller's SKU, a GTIN…), each emitted as a <CodigoComercialSurtido>, with the same tipo codes as the line's commercialCodes (at most 5).

Array<object>
object
tipo
required

Who assigned the code (<CodigoComercial><Tipo>, Anexo nota 12):

  • 01: the seller's product code.
  • 02: the buyer's product code.
  • 03: code assigned by the manufacturer (industrial or importer), such as a GTIN.
  • 04: internal-use code.
  • 99: other.
string
Allowed values: 01 02 03 04 99
Example
01
codigo
required

The code itself, 1–20 characters (<CodigoComercial><Codigo>).

string
Example
SKU-IMP-350
cantidad
required

Quantity of this component in ONE unit of the combo (up to 3 decimals), emitted as <CantidadSurtido>; Hacienda requires it to be greater than 0.

number
Example
1
unidadMedida
required

Unit of measure of the component, a symbol from Hacienda's catalog (Anexo nota 15) such as Unid, like the line's unitOfMeasure; emitted as <UnidadMedidaSurtido>.

string
Example
Unid
unidadMedidaComercial

The business's own unit for the component, not a standard measure (e.g. a box or a pallet), emitted as <UnidadMedidaComercialSurtido>.

string
Example
Caja
detalle
required

What the component is, emitted as <DetalleSurtido> (Hacienda accepts 3–200 characters).

string
Example
Arroz 1kg
precioUnitario
required

Price of one unit of the component before discounts and taxes, in the document currency (up to 5 decimals), emitted as <PrecioUnitarioSurtido>; Hacienda requires it to be greater than 0. With cantidad, the discounts and the tax rates, it is what the API computes the combo from.

number
Example
1000
montoTotal
required

cantidad × precioUnitario, emitted as <MontoTotalSurtido>. The API recomputes it and overwrites what was sent.

number
Example
1000
discounts

Discounts on the component, each emitted as a <DescuentoSurtido> (at most 5). A combo's discounts go here: the API sets the line unitPrice to the sum of the components' subtotals, after these discounts.

Array<object>
object
monto
required

Discount on the component for ONE unit of the combo, in the document currency (up to 5 decimals), emitted as <MontoDescuentoSurtido>; Hacienda accepts at most the component's montoTotal.

number
Example
100
codigo
required

Kind of discount, from the same catalog as a line discount's codigoDescuento (Anexo nota 20): 01 gift (regalía), 02 gift or bonus with the IVA charged to the customer, 03 bonus (bonificación), 04 volume, 05 seasonal, 06 promotional, 07 commercial, 08 frequency, 09 sustained, 99 other; emitted as <CodigoDescuentoSurtido>. With 01 or 03 the IVA of the component is computed on its gross montoTotal and assumed by the issuer, and then every component of the combo must carry one of them (SURTIDO_BONIFICACION_ALL_OR_NONE).

string
Example
01
otros

Description of the discount when codigo is 99, emitted as <DescuentoSurtidoOtros>: required then, 3–80 characters (DESCUENTO_OTROS_REQUIRED).

string
Example
Descuento de temporada
subtotal
required

montoTotal minus the component's discounts, emitted as <SubTotalSurtido>. The API recomputes it and overwrites what was sent.

number
Example
1000
ivaCobradoFabrica

Only for taxpayers that pay IVA at factory level (Anexo nota 21), emitted as <IVACobradoFabricaSurtido>:

  • 01: sale of goods with IVA under the special system of IVA at factory level.
  • 02: exempt sale under that system (factory, wholesale and customs level), because the goods already bore the tax at factory level.

Not written on an export invoice (09).

string
Example
01
baseImponible
required

IVA base of the component, emitted as <BaseImponibleSurtido> (not on an export invoice): its subtotal (its gross montoTotal when it carries discount 01 or 03) plus its taxes 02, 04 and 05. The API recomputes it and overwrites what was sent.

number
Example
1000
taxes
required

Taxes on the component, each emitted as an <ImpuestoSurtido>; Hacienda requires at least one. A combo may mix components with different IVA rates: the line's taxes are their sum per code and rate, × the line quantity.

Array<object>
object
codigo
required

Tax code of the component, from the same catalog as a line tax's codigo (Anexo nota 8): 01 IVA, 02 selective consumption tax, 04 alcoholic beverages, 05 packaged non-alcoholic beverages and toilet soaps, 06 tobacco, 07 IVA with a special base, 08 IVA on used goods, 99 other; emitted as <CodigoImpuestoSurtido>. The fuel (03) and cement (12) taxes are refused inside a combo (SURTIDO_EXCISE_NOT_ALLOWED).

string
Example
01
codigoTarifa

IVA tariff code of the component, from the same catalog as a line tax's codigoTarifa (Anexo nota 8.1; e.g. 08 general 13%, 10 exempt), emitted as <CodigoTarifaIVASurtido>. Hacienda requires it with tax code 01.

string
Example
08
tarifa

Tax rate as a percentage (13 for 13%), emitted as <TarifaSurtido>; with code 01 it must be the rate of codigoTarifa. The API computes the amount of an IVA tax as baseImponible × this rate / 100.

number
Example
13
datosEspecifico

Per-unit data of a specific tax (04, 05 or 06) on the component, emitted as <DatosImpuestoEspecificoSurtido>; Hacienda requires it for those codes. Same fields and formulas as a line tax's datosEspecifico, with the component's cantidad as the quantity.

object
cantidadUnidadMedida
required

Quantity of the unit of measure the tax applies to, up to 2 decimals, emitted as <CantidadUnidadMedida>. Code 03 (fuel): the litres of fuel of the whole line (the tax is this × impuestoUnidad, not multiplied by the line quantity). Codes 04 and 05: the millilitres of the container sold. Code 06 (tobacco): the per-unit measure the tax is levied on (the tax is quantity × this × impuestoUnidad).

number
Example
355
porcentaje

Alcohol by volume of the beverage, as a percentage (5 for 5%, up to 2 decimals), emitted as <Porcentaje>. Required for code 04 (SPECIFIC_TAX_FIELD_REQUIRED).

number
Example
5
proporcion

Code 04: millilitres of absolute alcohol per unit, porcentaje / 100 × cantidadUnidadMedida (up to 5 decimals), emitted as <Proporcion>. Hacienda requires it for 04; when it is omitted the API computes it.

number
Example
17.75
volumenUnidadConsumo

Code 05: the reference volume in millilitres for a beverage, or the grams of toilet soap sold (up to 2 decimals), emitted as <VolumenUnidadConsumo>. Required for 05 (SPECIFIC_TAX_FIELD_REQUIRED).

number
Example
355
impuestoUnidad
required

Tax per unit of measure, as the law of each specific tax sets it (up to 5 decimals), emitted as <ImpuestoUnidad>: per litre for 03, per millilitre of absolute alcohol for 04, per reference volume for a 05 beverage, per gram for 05 soap and per unit of cantidadUnidadMedida for 06. In colones: the API accepts specific taxes only on documents in CRC.

number
Example
18.5
esJabonTocador

Code 05 only: true when the product is toilet soap, so the tax is quantity × volumenUnidadConsumo × impuestoUnidad; otherwise the beverage formula, quantity × cantidadUnidadMedida × impuestoUnidad / volumenUnidadConsumo, applies. Not part of the XML: it only selects the formula.

boolean
Example
false
monto
required

Amount of this tax for ONE unit of the combo, emitted as <MontoImpuestoSurtido>. The API recomputes it from the rate or from datosEspecifico and overwrites what was sent; the line's own taxes are the sum over the components × the line quantity.

number
Example
130
total
required

Line total, emitted as <MontoTotalLinea>: the subtotal plus the net tax, which is the sum of the tax montos minus the tax the issuer assumes (the IVA of a line with discount 01 or 03, and the specific taxes 03, 04, 05 and 12) and minus the exonerated amounts. The API recomputes it and answers 422 INVOICE_TOTALS_MISMATCH when it differs by more than 0.005 (or the sum of all line totals by more than 0.01); on a combo line (surtido) it replaces it.

number
Example
11300

Proforma created

Media typeapplication/json
object
id
required

Id of the proforma, used in the /v1/proformas/{id} routes.

string format: uuid
tenantId
required

Id of the company the proforma belongs to.

string format: uuid
number
required

Proforma number: PRO- and the company's own sequence, padded to 5 digits (PRO-00001). Not a fiscal number: a proforma has no clave or consecutivo and never reaches Hacienda.

string
status
required

Status as of now:

  • draft: being prepared; it can be edited or deleted.
  • sent: marked as sent to the customer; it can still be edited.
  • accepted / rejected: marked as accepted or declined by the customer.
  • converted: turned into a draft invoice (convertedToInvoiceId).
  • cancelled: withdrawn.
  • expired: a sent proforma whose validUntil has passed; computed on read, never stored.

All but converted and expired are set with PATCH /v1/proformas/{id}/status.

string
Allowed values: draft sent accepted rejected converted cancelled expired
validUntil
required

Instant until which the quote is valid (ISO 8601); null for a quote without a deadline. Once it has passed, a sent proforma reads expired.

string format: date-time
nullable
receiver
required

The customer the quote is for, as captured when it was created or last edited (a copy of the contact when receiverPartyId is set). Null for a quote without a receiver.

object
id

Not used: ignored when a company is created, and kept as sent in the inline party of a document.

string
identificationType
required

Hacienda identification type: 01 cédula física, 02 cédula jurídica, 03 DIMEX, 04 NITE, 05 foreign (extranjero no domiciliado), 06 no contribuyente. Only 01–04 with an all-digit number can issue documents, because the clave embeds it.

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

Number of that identification, without separators, normalized to uppercase. Its format depends on identificationType: 01 9 digits; 02 10 positions — from 2026-11-01 the last six may be alphanumeric (decree 44648-MJ), e.g. 3101A1B2C3, which can receive documents but not issue them; 03 11–12 digits; 04 10 digits; 05 up to 20 letters, digits or hyphens; 06 9–12 digits.

string
name
required

Legal name (razón social) — <Nombre> in the XML, cut to 100 characters. A company's name cannot change through PATCH /tenants/:id (400 IMMUTABLE_FIELD): POST /tenants/:id/hacienda-sync takes it from Hacienda's registry.

string
commercialName

Trade name — <NombreComercial> in the XML when present, cut to 80 characters.

string
economicActivityCode

Only when creating a company: becomes its default economic activity, in Hacienda's dotted form (e.g. 6201.0). Ignored afterwards — activities are managed in /tenants/:tenantId/economic-activities — and in a document's inline party, whose activity is the document's economicActivityCodeReceptor.

string
location

Address in Costa Rica — <Ubicacion> in the XML. A company cannot issue without it (422 TENANT_LOCATION_MISSING). In a document it is never written for a 05 party; in a purchase invoice (FEC), a supplier of type 01–04 must carry it (400 SUPPLIER_LOCATION_REQUIRED).

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
canton
required

Cantón code within that provincia, two digits (01, 02…).

string
distrito
required

Distrito code within that cantón, two digits (01, 02…).

string
barrio

Neighborhood (barrio), by name — <Barrio>, which Hacienda requires to be 5–50 characters when present.

string
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
phoneCountryCode

Dial code without "+" (1-3 digits).

string
nullable
phoneNumber

National number, digits only (5-20).

string
nullable
phone

Deprecated: a legacy single-string phone (+506 22223333). Send phoneCountryCode + phoneNumber instead; this one is only parsed for the XML when those are absent.

string
email

Email address — <CorreoElectronico> in the XML. For a company, its main address and where its notices go when notificationEmail is empty; for a document's customer, where the accepted document is emailed.

string
notificationEmail

Company only: a separate address for the system's notices to it (rejections, errors, summaries…). Set it with PATCH /tenants/:id; "" or null clears it and the notices go back to email. Ignored on creation and in a document's party.

string
nullable
otrasSenasExtranjero

Address abroad, free text — <OtrasSenasExtranjero>, 5–300 characters in Hacienda's schema. Written only for a foreign (05) party, and required when that party is the supplier of a purchase invoice (400 SUPPLIER_FOREIGN_ADDRESS_REQUIRED).

string
receiverPartyId
required

Id of the contact the quote was made for, when it was created with receiverId; null for a receiver given inline or none. The invoice created from the proforma is linked to the same contact.

string format: uuid
nullable
currency
required

ISO 4217 currency of the quote; every amount in it is in this currency.

string
exchangeRate
required

Exchange rate to colones (CRC per unit of currency) given for the quote, as a decimal string; null when none was given.

string
nullable
saleCondition
required

Sale condition shown on the quote, and the default for the invoice created from it; null when none was given, and then the conversion must provide one. Hacienda codes (<CondicionVenta>, Anexo nota 5): 01 cash, 02 credit, 03 consignment, 04 layaway, 05 lease with an option to buy, 06 lease in a financial function, 07 collection on behalf of a third party, 08 services to the State on credit, 09 payment of a service to the State (REP only), 10 credit sale under article 27 of the IVA law, 11 payment of a 10 sale (REP only), 12 goods not yet nationalized, 13 used goods sold by a non-taxpayer (FEC only), 14 operating lease, 15 financial lease, 99 other.

string
nullable
Allowed values: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 99
notes
required

Free-text note printed on the quote PDF; null when none. It is not carried into the invoice created from the proforma.

string
nullable
lines
required

The quoted lines, in lineNumber order, in the same shape as an invoice's lines (without tax exonerations or combo components, which a proforma does not keep).

Array<object>
object
lineNumber
required

Number of the line in the document, starting at 1, emitted as <NumeroLinea>; the lines are written to the XML in the order of this number.

number
code

13-digit CABYS code (Costa Rica's catalog of goods and services, published by the BCCR) of what the line sells, emitted as <CodigoCABYS>; Hacienda checks it against the catalog in force. Required on every document except a payment receipt (10), whose lines carry none (LINE_CABYS_REQUIRED). Its first digit also places the line among the services (5 to 9) or the goods (0 to 4) in the document totals.

string
partidaArancelaria

Customs tariff heading of the goods (partida arancelaria), emitted as <PartidaArancelaria> and only on an export invoice (09). There it is required, with exactly 12 letters or digits, on every line whose CABYS code starts with 0 to 4, that is, goods (PARTIDA_ARANCELARIA_REQUIRED).

string
>= 1 characters <= 12 characters
vinNumbers

VIN or serial number of each vehicle, aircraft or vessel the line sells, one entry per unit, exactly 17 characters each (VIN_LENGTH); each is emitted as a <NumeroVINoSerie>. Hacienda asks for them when the CABYS code is a means of transport.

Array<string>
<= 1000 items
pharmacyRegistry

Ministry of Health registration number of the medicine the line sells, emitted as <RegistroMedicamento>. Hacienda asks for it when the CABYS code is a medicine with a sanitary registration.

string
<= 100 characters
pharmaceuticalForm

Code of the medicine's pharmaceutical form from Hacienda's catalog (Anexo nota 19, «Código de forma farmacéutica»), emitted as <FormaFarmaceutica>; a code outside it is refused (PHARMACEUTICAL_FORM_INVALID). Like pharmacyRegistry, Hacienda asks for it on medicines with a sanitary registration.

string
quantity
required

Quantity sold, greater than 0, up to 3 decimals, emitted as <Cantidad>. A payment receipt (10) has no quantity in its XML: there quantity × unitPrice is the amount being paid, without tax.

number
unitOfMeasure
required

Unit of measure, as a symbol from Hacienda's catalog (Anexo nota 15), emitted as <UnidadMedida>: for example Unid (unit), Kg (kilogram), L (litre), h (hour), Sp (professional services), St (technical services) or Os (other service). The symbols are case-sensitive; Hacienda checks them, the API does not. A payment receipt (10) does not use it.

string
transactionType

Why the line is on the document (Anexo nota 22), emitted as <TipoTransaccion>. Omit it for a normal sale, which is how Hacienda reads a line without it:

  • 01: normal sale of goods and services.
  • 02 / 03: the business consumes its own goods (autoconsumo), exempt / taxed.
  • 04 / 05: the business consumes its own services (autoconsumo), exempt / taxed.
  • 06 / 07: membership fee, taxed / exempt.
  • 08 / 09 / 10: capital goods for the issuer, for the receiver, or for both.
  • 11: capital goods withdrawn for the issuer's own use, exempt.
  • 12: capital goods transferred to third parties without consideration, exempt.
  • 13: goods withdrawn for own use or transferred to third parties without consideration.

Accepted on an invoice (01), a purchase invoice (08), an export invoice (09) and the credit and debit notes (03, 02); a ticket (04) and a payment receipt (10) have no such element (LINE_NOT_ALLOWED_FOR_DOCTYPE, reason transaction_type). The self-consumption of a business goes on an invoice to the business itself.

A type that names a tax condition must match the line: 02, 04, 07, 11 and 12 are exempt and carry no IVA at a positive rate, and 03 and 05 are taxed and carry one (LINE_TRANSACTION_TYPE_TAX_MISMATCH). A note that corrects such a line declares the same type, as the Anexo asks; POST /v1/invoices/{id}/credit-note copies it.

string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11 12 13
commercialUnitOfMeasure

The business's own unit for the line, not a standard measure (a box, a pallet), emitted as <UnidadMedidaComercial> next to unitOfMeasure, which stays required. Up to 20 characters. A payment receipt (10) has no such element (LINE_NOT_ALLOWED_FOR_DOCTYPE, reason commercial_unit).

string
<= 20 characters
commercialCodes

The product's own codes (the seller's SKU, the buyer's code, a GTIN…), each emitted as a <CodigoComercial>. tipo (Anexo nota 12): 01 seller's code, 02 buyer's code, 03 code assigned by the manufacturer (industrial or importer), 04 internal-use code, 99 other. A combo line (surtido) must carry one of type 03 with the package's SKU or GTIN (SURTIDO_COMMERCIAL_CODE_REQUIRED).

Array<object>
<= 5 items
object
tipo
required

Who assigned the code (<CodigoComercial><Tipo>, Anexo nota 12):

  • 01: the seller's product code.
  • 02: the buyer's product code.
  • 03: code assigned by the manufacturer (industrial or importer), such as a GTIN.
  • 04: internal-use code.
  • 99: other.
string
Allowed values: 01 02 03 04 99
codigo
required

The code itself, 1–20 characters (<CodigoComercial><Codigo>).

string
description
required

What the line sells, as the document shows it, emitted as <Detalle> (Hacienda accepts 3–200 characters). On a payment receipt (10) it describes the payment of the original invoice and, per the Anexo, names at least the instalment.

string
<= 200 characters
unitPrice
required

Price of one unit before discounts and taxes, in the document currency (up to 5 decimals), emitted as <PrecioUnitario>. On a combo line (surtido) the API replaces it with the sum of the components' subtotals for one unit of the combo.

number
discounts

Discounts on the line, each emitted as a <Descuento> (Hacienda allows at most 5). They lower the line subtotal; codes 01, 02 and 03 cover the whole line and must be its only discount (LINE_DISCOUNT_FULL_EXCLUSIVE). Not accepted on a payment receipt (10) (LINE_NOT_ALLOWED_FOR_DOCTYPE).

Array<object>
object
monto
required

Discount amount in the document currency (up to 5 decimals), emitted as <MontoDescuento>; Hacienda accepts at most the line's quantity × unitPrice. For codes 01, 02 and 03 it must equal quantity × unitPrice (LINE_DISCOUNT_FULL_REQUIRED).

number
codigoDescuento
required

Kind of discount, emitted as <CodigoDescuento> (Anexo nota 20):

  • 01: gift (regalía). The whole line is given away; its IVA is computed on the gross quantity × unitPrice and assumed by the issuer (<ImpuestoAsumidoEmisorFabrica>), so the customer pays none of it.
  • 02: gift or bonus with the IVA charged to the customer (regalía o bonificación, IVA cobrado al cliente). The whole line; its IVA is computed on the subtotal, which the discount leaves at 0, so on a line with no other tax the IVA monto is 0.
  • 03: bonus (bonificación). The whole line, with the IVA treatment of 01.
  • 04: volume discount.
  • 05: seasonal discount.
  • 06: promotional discount.
  • 07: commercial discount.
  • 08: frequency discount.
  • 09: sustained discount.
  • 99: any other discount, described in naturaleza.

Codes 04 to 99 lower the subtotal and the IVA is computed on what remains. Codes 01, 02 and 03 must be the only discount of their line (LINE_DISCOUNT_FULL_EXCLUSIVE).

string
Allowed values: 01 02 03 04 05 06 07 08 09 99
naturaleza

Description of the discount, emitted as <NaturalezaDescuento> (Hacienda accepts 3–80 characters). Required for code 99, with at least 5 characters (NATURALEZA_REQUIRED): for that code the same text is also emitted as <CodigoDescuentoOTRO>, which Hacienda demands.

string
subtotal
required

quantity × unitPrice minus the line's discounts, in the document currency (up to 5 decimals), emitted as <SubTotal>. The API recomputes it and answers 422 INVOICE_TOTALS_MISMATCH when it differs by more than 0.005; on a combo line (surtido) it replaces it with the value derived from the components.

number
taxes
required

Taxes on the line, each emitted as an <Impuesto>. Hacienda requires at least one on every line (TAX_REQUIRED), and a code may appear only once per line (DUPLICATE_TAX_CODE). An exempt line still carries IVA (01) with tariff code 10 and a monto of 0. On a combo line (surtido) the API replaces them with the sum of the components' taxes.

Array<object>
object
codigo
required

Tax code, emitted as <Codigo> (Anexo nota 8):

  • 01: IVA (value-added tax).
  • 02: selective consumption tax (impuesto selectivo de consumo).
  • 03: single tax on fuels.
  • 04: specific tax on alcoholic beverages.
  • 05: specific tax on packaged non-alcoholic beverages and toilet soaps.
  • 06: tax on tobacco products.
  • 07: IVA with a special calculation of its taxable base.
  • 08: IVA under the used-goods regime, computed with factor.
  • 12: specific tax on cement.
  • 99: another tax.

Codes 02, 03, 04, 05, 06 and 12 are accepted only on documents in CRC (EXCISE_NOT_SUPPORTED_FOR_CURRENCY), and a payment receipt (10) accepts only the IVA codes 01, 07 and 08 (LINE_NOT_ALLOWED_FOR_DOCTYPE).

string
Allowed values: 01 02 03 04 05 06 07 08 12 99
codigoTarifa

IVA tariff code, emitted as <CodigoTarifaIVA> (Anexo nota 8.1):

  • 01: 0% rate of RLIVA art. 32.1, which keeps the full credit right (e.g. sales to the CCSS or to municipalities).
  • 02: reduced 1%.
  • 03: reduced 2%.
  • 04: reduced 4%.
  • 05: transitional 0%, for credit and debit notes only.
  • 06: transitional 4%, for credit and debit notes only.
  • 07: transitional 8%, for credit and debit notes only.
  • 08: general 13%.
  • 09: reduced 0.5%.
  • 10: exempt (Ley 9635, art. 8); the tax monto is then 0.
  • 11: 0% without credit right, to record a good or service not subject to IVA that grants no credit.

Hacienda requires it for tax codes 01 and 07. On an export invoice (09) every IVA tax must use 10 (LINE_NOT_ALLOWED_FOR_DOCTYPE, reason export_tariff).

string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11
tarifa
required

Tax rate as a percentage (13 for 13%, 0.5 for 0.5%), emitted as <Tarifa>. With code 01 it must be the rate of codigoTarifa (Hacienda rejects a mismatch); for 02 and 99 it is the rate the applicable rule sets, and for 12 (cement) it is 5%. For code 08 the XML carries factor instead, and the per-unit codes 03 to 06 take their amount from datosEspecifico, not from this rate.

number
factor

Factor set by the Ministry of Finance for IVA under the used-goods regime (code 08), as a decimal with up to 4 places, emitted as <FactorCalculoIVA> instead of <Tarifa>. Required for 08 (FACTOR_REQUIRED): the IVA is then the taxable base × this factor.

number
monto
required

Amount of this tax in the document currency (up to 5 decimals), emitted as <Monto>: always the full tax, also when an exoneracion covers part of it. The API recomputes it and answers 422 INVOICE_TOTALS_MISMATCH when it differs by more than 0.005:

  • 01 and 07: taxable base × tarifa / 100; 08: taxable base × factor. The base is the line subtotal plus its taxes 02, 04, 05 and 12, or the gross quantity × unitPrice when the line has discount 01 or 03.
  • 02 and 12: subtotal × tarifa / 100.
  • 03 to 06: the formula of datosEspecifico.
  • Any other code is taken as sent.
number
exoneracion

The authorization that exonerates the customer from all or part of this tax, emitted as <Exoneracion> inside the tax. Use it on an IVA tax (01, 07 or 08), the only ones whose exoneration the line and document totals count; the tax monto stays the full tax and the exonerated share is declared in montoExoneracion. Not accepted on an export invoice (09) or a payment receipt (10) (LINE_NOT_ALLOWED_FOR_DOCTYPE).

object
tipoDocumento
required

Kind of document that grants the exoneration, emitted as <TipoDocumentoEX1> (Anexo nota 10.1):

  • 01: purchases authorized by the Dirección General de Tributación (DGT).
  • 02: exempt sales to diplomats.
  • 03: authorized by a special law.
  • 04: Dirección General de Hacienda (DGH) exemption, generic local authorization.
  • 05: DGH exemption under Transitorio V (engineering, architecture, surveying and civil-works services).
  • 06: tourism services registered with the Costa Rican Tourism Institute (ICT).
  • 07: Transitorio XVII (collection, sorting and storage of recyclable and reusable materials).
  • 08: free-trade-zone exoneration (zona franca).
  • 09: services complementary to exports (RLIVA art. 11).
  • 10: municipal corporations (corporaciones municipales).
  • 11: DGH exemption, specific local-tax authorization.
  • 99: any other document, described in tipoDocumentoOtro.

The Anexo reserves 01, 05, 06 and 07 for credit and debit notes.

string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11 99
tipoDocumentoOtro

What kind of document it is when tipoDocumento is 99, emitted as <TipoDocumentoOTRO>. Required for 99 (EXONERACION_TIPO_DOCUMENTO_OTRO_REQUIRED); Hacienda accepts 5–100 characters.

string
numeroDocumento
required

Number of the exoneration or authorization document, written exactly as the issuing institution printed it, hyphens included; emitted as <NumeroDocumento> (Hacienda accepts 3–40 characters). With tipoDocumento 02, 03 or 08 it is the number of the law that grants the exoneration. With 04 or 11 Hacienda checks it against the authorization it issued, which must be in force; GET /v1/hacienda/exoneracion/{autorizacion} reads an authorization of the AL-XXXXXXXX-XX form.

string
articulo

Article of the law that establishes the exoneration, emitted as <Articulo>. Hacienda requires it for tipoDocumento 02, 03, 06, 07 and 08; its schema types it as a whole number of up to 6 digits.

string
inciso

Subsection (inciso) of that article, when the article refers to one; emitted as <Inciso>. Hacienda's schema types it as a whole number of up to 6 digits.

string
nombreInstitucion
required

Institution that issued the exoneration document, emitted as <NombreInstitucion> (Anexo nota 23):

  • 01: Ministry of Finance (Ministerio de Hacienda).
  • 02: Ministry of Foreign Affairs and Worship.
  • 03: Ministry of Agriculture and Livestock.
  • 04: Ministry of Economy, Industry and Commerce.
  • 05: Costa Rican Red Cross.
  • 06: Costa Rica Fire Department (Benemérito Cuerpo de Bomberos).
  • 07: Asociación Obras del Espíritu Santo.
  • 08: Federación Cruzada Nacional de Protección al Anciano (Fecrunapa).
  • 09: Escuela de Agricultura de la Región Húmeda (EARTH).
  • 10: Instituto Centroamericano de Administración de Empresas (INCAE).
  • 11: Junta de Protección Social (JPS).
  • 12: Autoridad Reguladora de los Servicios Públicos (Aresep).
  • 99: another institution, named in nombreInstitucionOtros.
string
Allowed values: 01 02 03 04 05 06 07 08 09 10 11 12 99
nombreInstitucionOtros

Name of the issuing institution when nombreInstitucion is 99, emitted as <NombreInstitucionOtros>. Required for 99 (EXONERACION_NOMBRE_INSTITUCION_OTROS_REQUIRED); Hacienda accepts 5–160 characters.

string
fechaEmision
required

When the exoneration document was issued: an ISO 8601 date-time, emitted as <FechaEmisionEX>. With tipoDocumento 04 or 11 Hacienda checks it against the authorization and rejects the document if it differs.

string
tarifaExonerada
required

Percentage points of the tax that the exoneration covers, emitted as <TarifaExonerada>: 13 exonerates a 13% IVA in full, 4 leaves 9 points of it to pay. When it is lower than the tax's tarifa, only that share of the line's base is reported as exonerated and the rest as taxed. With tipoDocumento 04 or 11 Hacienda rejects a rate higher than the authorization grants.

number
montoExoneracion
required

Amount of tax the exoneration covers, in the document currency (up to 5 decimals), emitted as <MontoExoneracion>: the line's IVA base × tarifaExonerada / 100, never more than the tax's monto. It is subtracted from the line's net tax; send this exact figure, because the API derives the line total and the document totals from that same calculation.

number
datosEspecifico

Per-unit data of a specific tax, emitted as <DatosImpuestoEspecifico>. Required for codes 03, 04, 05 and 06 (SPECIFIC_TAX_DATA_REQUIRED) and ignored for the others. The API computes the tax monto from it with the Anexo formulas, quantity being the line's:

  • 03: cantidadUnidadMedida × impuestoUnidad.
  • 04: quantity × proporcion × impuestoUnidad.
  • 05 beverage: quantity × cantidadUnidadMedida × impuestoUnidad / volumenUnidadConsumo.
  • 05 toilet soap: quantity × volumenUnidadConsumo × impuestoUnidad.
  • 06: quantity × cantidadUnidadMedida × impuestoUnidad.

Codes 03 to 06 are not accepted on a purchase invoice (08) or an export invoice (09), whose schemas have no place for this data (LINE_NOT_ALLOWED_FOR_DOCTYPE).

object
cantidadUnidadMedida
required

Quantity of the unit of measure the tax applies to, up to 2 decimals, emitted as <CantidadUnidadMedida>. Code 03 (fuel): the litres of fuel of the whole line (the tax is this × impuestoUnidad, not multiplied by the line quantity). Codes 04 and 05: the millilitres of the container sold. Code 06 (tobacco): the per-unit measure the tax is levied on (the tax is quantity × this × impuestoUnidad).

number
porcentaje

Alcohol by volume of the beverage, as a percentage (5 for 5%, up to 2 decimals), emitted as <Porcentaje>. Required for code 04 (SPECIFIC_TAX_FIELD_REQUIRED).

number
proporcion

Code 04: millilitres of absolute alcohol per unit, porcentaje / 100 × cantidadUnidadMedida (up to 5 decimals), emitted as <Proporcion>. Hacienda requires it for 04; when it is omitted the API computes it.

number
volumenUnidadConsumo

Code 05: the reference volume in millilitres for a beverage, or the grams of toilet soap sold (up to 2 decimals), emitted as <VolumenUnidadConsumo>. Required for 05 (SPECIFIC_TAX_FIELD_REQUIRED).

number
impuestoUnidad
required

Tax per unit of measure, as the law of each specific tax sets it (up to 5 decimals), emitted as <ImpuestoUnidad>: per litre for 03, per millilitre of absolute alcohol for 04, per reference volume for a 05 beverage, per gram for 05 soap and per unit of cantidadUnidadMedida for 06. In colones: the API accepts specific taxes only on documents in CRC.

number
esJabonTocador

Code 05 only: true when the product is toilet soap, so the tax is quantity × volumenUnidadConsumo × impuestoUnidad; otherwise the beverage formula, quantity × cantidadUnidadMedida × impuestoUnidad / volumenUnidadConsumo, applies. Not part of the XML: it only selects the formula.

boolean
surtido

Components of a combo, kit or assortment billed as one line (surtido), emitted as <DetalleSurtido>: 2 to 20 products with different CABYS codes (SURTIDO_MIN_COMPONENTS, SURTIDO_DUPLICATE_CABYS), each described for ONE unit of the combo. The API recomputes every amount of the components and of the line from the components' quantities, prices, discounts and taxes, overwriting what was sent. Not accepted on a purchase invoice (08) or a payment receipt (10) (SURTIDO_NOT_ALLOWED_FOR_DOCTYPE). The Anexo allows a combo to be billed this way only by its manufacturer or importer; anyone else lists its products as separate lines.

Array<object>
object
cabysCode
required

13-digit CABYS code of the component, emitted as <CodigoCABYSSurtido>; Hacienda checks it against the catalog in force. No two components of a combo may share one (SURTIDO_DUPLICATE_CABYS).

string
commercialCodes

Optional codes of the component (the seller's SKU, a GTIN…), each emitted as a <CodigoComercialSurtido>, with the same tipo codes as the line's commercialCodes (at most 5).

Array<object>
object
tipo
required

Who assigned the code (<CodigoComercial><Tipo>, Anexo nota 12):

  • 01: the seller's product code.
  • 02: the buyer's product code.
  • 03: code assigned by the manufacturer (industrial or importer), such as a GTIN.
  • 04: internal-use code.
  • 99: other.
string
Allowed values: 01 02 03 04 99
codigo
required

The code itself, 1–20 characters (<CodigoComercial><Codigo>).

string
cantidad
required

Quantity of this component in ONE unit of the combo (up to 3 decimals), emitted as <CantidadSurtido>; Hacienda requires it to be greater than 0.

number
unidadMedida
required

Unit of measure of the component, a symbol from Hacienda's catalog (Anexo nota 15) such as Unid, like the line's unitOfMeasure; emitted as <UnidadMedidaSurtido>.

string
unidadMedidaComercial

The business's own unit for the component, not a standard measure (e.g. a box or a pallet), emitted as <UnidadMedidaComercialSurtido>.

string
detalle
required

What the component is, emitted as <DetalleSurtido> (Hacienda accepts 3–200 characters).

string
precioUnitario
required

Price of one unit of the component before discounts and taxes, in the document currency (up to 5 decimals), emitted as <PrecioUnitarioSurtido>; Hacienda requires it to be greater than 0. With cantidad, the discounts and the tax rates, it is what the API computes the combo from.

number
montoTotal
required

cantidad × precioUnitario, emitted as <MontoTotalSurtido>. The API recomputes it and overwrites what was sent.

number
discounts

Discounts on the component, each emitted as a <DescuentoSurtido> (at most 5). A combo's discounts go here: the API sets the line unitPrice to the sum of the components' subtotals, after these discounts.

Array<object>
object
monto
required

Discount on the component for ONE unit of the combo, in the document currency (up to 5 decimals), emitted as <MontoDescuentoSurtido>; Hacienda accepts at most the component's montoTotal.

number
codigo
required

Kind of discount, from the same catalog as a line discount's codigoDescuento (Anexo nota 20): 01 gift (regalía), 02 gift or bonus with the IVA charged to the customer, 03 bonus (bonificación), 04 volume, 05 seasonal, 06 promotional, 07 commercial, 08 frequency, 09 sustained, 99 other; emitted as <CodigoDescuentoSurtido>. With 01 or 03 the IVA of the component is computed on its gross montoTotal and assumed by the issuer, and then every component of the combo must carry one of them (SURTIDO_BONIFICACION_ALL_OR_NONE).

string
otros

Description of the discount when codigo is 99, emitted as <DescuentoSurtidoOtros>: required then, 3–80 characters (DESCUENTO_OTROS_REQUIRED).

string
subtotal
required

montoTotal minus the component's discounts, emitted as <SubTotalSurtido>. The API recomputes it and overwrites what was sent.

number
ivaCobradoFabrica

Only for taxpayers that pay IVA at factory level (Anexo nota 21), emitted as <IVACobradoFabricaSurtido>:

  • 01: sale of goods with IVA under the special system of IVA at factory level.
  • 02: exempt sale under that system (factory, wholesale and customs level), because the goods already bore the tax at factory level.

Not written on an export invoice (09).

string
baseImponible
required

IVA base of the component, emitted as <BaseImponibleSurtido> (not on an export invoice): its subtotal (its gross montoTotal when it carries discount 01 or 03) plus its taxes 02, 04 and 05. The API recomputes it and overwrites what was sent.

number
taxes
required

Taxes on the component, each emitted as an <ImpuestoSurtido>; Hacienda requires at least one. A combo may mix components with different IVA rates: the line's taxes are their sum per code and rate, × the line quantity.

Array<object>
object
codigo
required

Tax code of the component, from the same catalog as a line tax's codigo (Anexo nota 8): 01 IVA, 02 selective consumption tax, 04 alcoholic beverages, 05 packaged non-alcoholic beverages and toilet soaps, 06 tobacco, 07 IVA with a special base, 08 IVA on used goods, 99 other; emitted as <CodigoImpuestoSurtido>. The fuel (03) and cement (12) taxes are refused inside a combo (SURTIDO_EXCISE_NOT_ALLOWED).

string
codigoTarifa

IVA tariff code of the component, from the same catalog as a line tax's codigoTarifa (Anexo nota 8.1; e.g. 08 general 13%, 10 exempt), emitted as <CodigoTarifaIVASurtido>. Hacienda requires it with tax code 01.

string
tarifa

Tax rate as a percentage (13 for 13%), emitted as <TarifaSurtido>; with code 01 it must be the rate of codigoTarifa. The API computes the amount of an IVA tax as baseImponible × this rate / 100.

number
datosEspecifico

Per-unit data of a specific tax (04, 05 or 06) on the component, emitted as <DatosImpuestoEspecificoSurtido>; Hacienda requires it for those codes. Same fields and formulas as a line tax's datosEspecifico, with the component's cantidad as the quantity.

object
cantidadUnidadMedida
required

Quantity of the unit of measure the tax applies to, up to 2 decimals, emitted as <CantidadUnidadMedida>. Code 03 (fuel): the litres of fuel of the whole line (the tax is this × impuestoUnidad, not multiplied by the line quantity). Codes 04 and 05: the millilitres of the container sold. Code 06 (tobacco): the per-unit measure the tax is levied on (the tax is quantity × this × impuestoUnidad).

number
porcentaje

Alcohol by volume of the beverage, as a percentage (5 for 5%, up to 2 decimals), emitted as <Porcentaje>. Required for code 04 (SPECIFIC_TAX_FIELD_REQUIRED).

number
proporcion

Code 04: millilitres of absolute alcohol per unit, porcentaje / 100 × cantidadUnidadMedida (up to 5 decimals), emitted as <Proporcion>. Hacienda requires it for 04; when it is omitted the API computes it.

number
volumenUnidadConsumo

Code 05: the reference volume in millilitres for a beverage, or the grams of toilet soap sold (up to 2 decimals), emitted as <VolumenUnidadConsumo>. Required for 05 (SPECIFIC_TAX_FIELD_REQUIRED).

number
impuestoUnidad
required

Tax per unit of measure, as the law of each specific tax sets it (up to 5 decimals), emitted as <ImpuestoUnidad>: per litre for 03, per millilitre of absolute alcohol for 04, per reference volume for a 05 beverage, per gram for 05 soap and per unit of cantidadUnidadMedida for 06. In colones: the API accepts specific taxes only on documents in CRC.

number
esJabonTocador

Code 05 only: true when the product is toilet soap, so the tax is quantity × volumenUnidadConsumo × impuestoUnidad; otherwise the beverage formula, quantity × cantidadUnidadMedida × impuestoUnidad / volumenUnidadConsumo, applies. Not part of the XML: it only selects the formula.

boolean
monto
required

Amount of this tax for ONE unit of the combo, emitted as <MontoImpuestoSurtido>. The API recomputes it from the rate or from datosEspecifico and overwrites what was sent; the line's own taxes are the sum over the components × the line quantity.

number
total
required

Line total, emitted as <MontoTotalLinea>: the subtotal plus the net tax, which is the sum of the tax montos minus the tax the issuer assumes (the IVA of a line with discount 01 or 03, and the specific taxes 03, 04, 05 and 12) and minus the exonerated amounts. The API recomputes it and answers 422 INVOICE_TOTALS_MISMATCH when it differs by more than 0.005 (or the sum of all line totals by more than 0.01); on a combo line (surtido) it replaces it.

number
totals
required

Totals of the quote, computed from its lines with the same rules as an invoice's <ResumenFactura>; a proforma has no other charges. Recomputed on every edit.

object
totalServGravados
required

Services taxed with IVA, <TotalServGravados>: the service lines' amounts before discounts (quantity × unit price), less the share covered by an exoneration. Like every total here, in the document currency with up to 5 decimals.

number
totalServExentos
required

Services exempt from IVA (tariff code 10), <TotalServExentos>: the service lines' amounts before discounts.

number
totalServExonerado
required

Services whose IVA is exonerated, <TotalServExonerado>: the share of taxed service amounts covered by the receiver's exoneration (<Exoneracion> on the line's tax).

number
totalServNoSujeto
required

Services not subject to IVA, <TotalServNoSujeto>: the service lines' amounts before discounts.

number
totalMercGravadas
required

Goods taxed with IVA, <TotalMercanciasGravadas>: the goods lines' amounts before discounts, less the share covered by an exoneration.

number
totalMercExentas
required

Goods exempt from IVA (tariff code 10), <TotalMercanciasExentas>: the goods lines' amounts before discounts.

number
totalMercExonerada
required

Goods whose IVA is exonerated, <TotalMercExonerada>: the share of taxed goods amounts covered by the receiver's exoneration.

number
totalMercNoSujeta
required

Goods not subject to IVA, <TotalMercNoSujeta>: the goods lines' amounts before discounts.

number
totalGravado
required

All taxed sales, <TotalGravado>: totalServGravados + totalMercGravadas.

number
totalExento
required

All exempt sales, <TotalExento>: totalServExentos + totalMercExentas.

number
totalExonerado
required

All exonerated sales, <TotalExonerado>: totalServExonerado + totalMercExonerada.

number
totalNoSujeto
required

All sales not subject to IVA, <TotalNoSujeto>: totalServNoSujeto + totalMercNoSujeta.

number
totalVenta
required

Total sale before discounts, <TotalVenta>: the sum of quantity × unit price over the lines, equal to totalGravado + totalExento + totalExonerado + totalNoSujeto.

number
totalDescuentos
required

Sum of the lines' discounts, <TotalDescuentos>.

number
totalVentaNeta
required

Net sale, <TotalVentaNeta>: totalVenta − totalDescuentos.

number
totalImpuesto
required

Tax charged to the receiver, <TotalImpuesto>: the sum of the lines' tax amounts, less the exonerated share and less the tax the issuer assumes (totalImpAsumEmisorFabrica).

number
totalImpAsumEmisorFabrica

Tax that the receiver does not pay because the issuer assumes it or it was charged at the factory, <TotalImpAsumEmisorFabrica>: the IVA of lines discounted as a gift or a bonus (discount codes 01 regalía and 03 bonificación) plus the specific taxes 03 (fuel), 04 (alcoholic beverages), 05 (bottled non-alcoholic beverages and toilet soaps) and 12 (cement). Emitted to the XML only when greater than zero.

number
totalOtrosCargos

Sum of the other charges (otherCharges[].montoCargo), <TotalOtrosCargos>; added to totalComprobante. 0 or absent when the document has none.

number
totalComprobante
required

Document total, <TotalComprobante>: totalVentaNeta + totalImpuesto + totalOtrosCargos (Hacienda's formula also subtracts <TotalIVADevuelto>, IVA refunded on health services paid by card, which EmiteCR does not use). Positive on a credit note too: subtract credit notes yourself when adding up sales.

number
convertedToInvoiceId
required

Id of the draft invoice created from the proforma (POST /v1/proformas/{id}/convert); null until it is converted, and again if that invoice is deleted.

string format: uuid
nullable
convertedAt
required

When the proforma was converted (ISO 8601 instant); null until then.

string format: date-time
nullable
createdAt
required

When the proforma was created (ISO 8601 instant).

string format: date-time
updatedAt
required

When the proforma last changed (ISO 8601 instant): an edit, a status change or its conversion.

string format: date-time
Example
{
"number": "PRO-00001",
"status": "draft",
"validUntil": "2026-06-30T23:59:59.000Z",
"receiver": {
"id": "01a00c73-5c09-7bb5-8b9e-d91c43bd61dc",
"identificationType": "01",
"identificationNumber": "3101234567",
"name": "Futurabyte CR S.A.",
"commercialName": "Futurabyte",
"economicActivityCode": "6201.0",
"location": {
"provincia": "1",
"canton": "01",
"distrito": "01",
"barrio": "Carmen",
"otrasSenas": "50 metros norte de la iglesia, edificio azul"
},
"phoneCountryCode": "506",
"phoneNumber": "22223333",
"phone": "50622223333",
"email": "ventas@emite.cr",
"notificationEmail": "notificaciones@emite.cr",
"otrasSenasExtranjero": "1234 Ocean Ave, Miami, FL 33101, USA"
},
"currency": "CRC",
"exchangeRate": "540.00000",
"saleCondition": "01",
"lines": [
{
"lineNumber": 1,
"code": "8399000000000",
"partidaArancelaria": "850431200090",
"vinNumbers": [
"1HGCM82633A004352"
],
"pharmacyRegistry": "CR-MED-2024-1234",
"pharmaceuticalForm": "01",
"quantity": 1,
"unitOfMeasure": "Unid",
"transactionType": "01",
"commercialUnitOfMeasure": "Caja de 12",
"commercialCodes": [
{
"tipo": "01",
"codigo": "SKU-IMP-350"
}
],
"description": "Servicio de consultoría TI — bloque mensual",
"unitPrice": 10000,
"discounts": [
{
"monto": 500,
"codigoDescuento": "01",
"naturaleza": "Descuento por volumen"
}
],
"subtotal": 10000,
"taxes": [
{
"codigo": "01",
"codigoTarifa": "01",
"tarifa": 13,
"factor": 0.13,
"monto": 1300,
"exoneracion": {
"tipoDocumento": "01",
"tipoDocumentoOtro": "Resolución especial 2024-001",
"numeroDocumento": "AL-001-2024",
"articulo": "15",
"inciso": "a",
"nombreInstitucion": "01",
"nombreInstitucionOtros": "Caja Costarricense de Seguro Social",
"fechaEmision": "2024-01-15T10:00:00-06:00",
"tarifaExonerada": 13,
"montoExoneracion": 1300
},
"datosEspecifico": {
"cantidadUnidadMedida": 355,
"porcentaje": 5,
"proporcion": 17.75,
"volumenUnidadConsumo": 355,
"impuestoUnidad": 18.5,
"esJabonTocador": false
}
}
],
"surtido": [
{
"cabysCode": "2310100000000",
"commercialCodes": [
{
"tipo": "01",
"codigo": "SKU-IMP-350"
}
],
"cantidad": 1,
"unidadMedida": "Unid",
"unidadMedidaComercial": "Caja",
"detalle": "Arroz 1kg",
"precioUnitario": 1000,
"montoTotal": 1000,
"discounts": [
{
"monto": 100,
"codigo": "01",
"otros": "Descuento de temporada"
}
],
"subtotal": 1000,
"ivaCobradoFabrica": "01",
"baseImponible": 1000,
"taxes": [
{
"codigo": "01",
"codigoTarifa": "08",
"tarifa": 13,
"datosEspecifico": {
"cantidadUnidadMedida": 355,
"porcentaje": 5,
"proporcion": 17.75,
"volumenUnidadConsumo": 355,
"impuestoUnidad": 18.5,
"esJabonTocador": false
},
"monto": 130
}
]
}
],
"total": 11300
}
],
"totals": {
"totalServGravados": 1000,
"totalServExentos": 0,
"totalServExonerado": 0,
"totalServNoSujeto": 0,
"totalMercGravadas": 0,
"totalMercExentas": 0,
"totalMercExonerada": 0,
"totalMercNoSujeta": 0,
"totalGravado": 1000,
"totalExento": 0,
"totalExonerado": 0,
"totalNoSujeto": 0,
"totalVenta": 1000,
"totalDescuentos": 0,
"totalVentaNeta": 1000,
"totalImpuesto": 130,
"totalImpAsumEmisorFabrica": 0,
"totalOtrosCargos": 0,
"totalComprobante": 1130
}
}