Create a catalog item with at least one variant
const url = 'https://api.emite.cr/v1/tenants/example/items';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"cabysCode":"8399000000000","name":"Servicio de consultoría TI","description":"Consultoría en arquitectura de software — bloque mensual de 40 horas","defaultTaxCode":"01","defaultTaxRateCode":"08","defaultTaxRate":13,"defaultTaxFactor":0.3,"secondaryTaxes":[{"codigo":"02","codigoTarifa":"08","tarifa":10,"datosEspecifico":{"cantidadUnidadMedida":355,"porcentaje":5,"volumenUnidadConsumo":355,"impuestoUnidad":18.5,"esJabonTocador":false}}],"pharmacyRegistry":"CR-MED-2024-1234","pharmaceuticalForm":"01","notes":"Producto estrella — promo Q4","variants":[{"code":"IMP-350-UNI","variantName":"Cerveza Imperial 350ml — Unidad","unitOfMeasure":"Unid","unitOfMeasureCommercial":"Caja x12","prices":[{"currency":"AED","unitPrice":950}],"packSize":12,"innerUnitOfMeasure":"Unid","commercialCodes":[{"tipo":"01","codigo":"SKU-IMP-350"}],"barcode":"7441001234567","isDefault":true,"isActive":true,"sortOrder":0}],"isSurtido":false,"surtidoComponents":[{"sourceItemId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","cabysCode":"2310100000000","name":"Arroz 1kg","description":"Arroz blanco grano largo","unitOfMeasure":"Unid","unitOfMeasureCommercial":"Caja","prices":[{"currency":"AED","unitPrice":950}],"quantity":1,"ivaCodigoTarifa":"08","ivaTarifa":13}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.emite.cr/v1/tenants/example/items \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "cabysCode": "8399000000000", "name": "Servicio de consultoría TI", "description": "Consultoría en arquitectura de software — bloque mensual de 40 horas", "defaultTaxCode": "01", "defaultTaxRateCode": "08", "defaultTaxRate": 13, "defaultTaxFactor": 0.3, "secondaryTaxes": [ { "codigo": "02", "codigoTarifa": "08", "tarifa": 10, "datosEspecifico": { "cantidadUnidadMedida": 355, "porcentaje": 5, "volumenUnidadConsumo": 355, "impuestoUnidad": 18.5, "esJabonTocador": false } } ], "pharmacyRegistry": "CR-MED-2024-1234", "pharmaceuticalForm": "01", "notes": "Producto estrella — promo Q4", "variants": [ { "code": "IMP-350-UNI", "variantName": "Cerveza Imperial 350ml — Unidad", "unitOfMeasure": "Unid", "unitOfMeasureCommercial": "Caja x12", "prices": [ { "currency": "AED", "unitPrice": 950 } ], "packSize": 12, "innerUnitOfMeasure": "Unid", "commercialCodes": [ { "tipo": "01", "codigo": "SKU-IMP-350" } ], "barcode": "7441001234567", "isDefault": true, "isActive": true, "sortOrder": 0 } ], "isSurtido": false, "surtidoComponents": [ { "sourceItemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "cabysCode": "2310100000000", "name": "Arroz 1kg", "description": "Arroz blanco grano largo", "unitOfMeasure": "Unid", "unitOfMeasureCommercial": "Caja", "prices": [ { "currency": "AED", "unitPrice": 950 } ], "quantity": 1, "ivaCodigoTarifa": "08", "ivaTarifa": 13 } ] }'Invoice lines are built from the items in this catalog. Each item has 1-N variants, each with its own SKU (code), unitOfMeasure and per-currency prices ([{ currency, unitPrice }], each currency enabled for the company). CABYS and tax data (defaultTaxCode, defaultTaxRateCode, defaultTaxRate) are shared across variants. For a surtido (isSurtido: true), the variant prices are derived from surtidoComponents and the prices sent are ignored. Use GET /v1/cabys/:codigo/suggested-iva to derive the tax codes from a CAByS code.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Tenant UUID.
Request Bodyrequired
Section titled “Request Bodyrequired”object
13-digit CABYS code (Costa Rica's catalog of goods and services) that classifies the item: the code (<CodigoCABYS>) of an invoice line that sells it. Find codes with GET /v1/cabys/search, and the IVA Hacienda publishes for one with GET /v1/cabys/:codigo/suggested-iva.
Example
8399000000000Name of the product or service, 1–120 characters. The EmiteCR app uses it as the description (<Detalle>) of the invoice lines it builds from the item; Hacienda's schema asks for at least 3 characters there.
Example
Servicio de consultoría TILonger description, up to 200 characters (the EmiteCR app pre-fills it with the CABYS description). Catalog searches match it; the invoice lines the app builds take name, not this field.
Example
Consultoría en arquitectura de software — bloque mensual de 40 horasCode of the item's main tax (CodigoImpuestoType, Anexo nota 8), the first tax of an invoice line that sells it (<Impuesto><Codigo>):
01: IVA.07: IVA with a special calculation (the rate goes indefaultTaxRate).08: IVA under the used-goods regime, computed withdefaultTaxFactor.
Omit the defaultTax* fields for no default tax. Excise taxes go in secondaryTaxes.
Example
01IVA rate code (CodigoTarifaIVAType, <CodigoTarifaIVA>) for defaultTaxCode 01: 08 general 13%, 04 reduced 4%, 03 reduced 2%, 02 reduced 1%, 09 reduced 0.5%, 10 exempt, 01 0% (RLIVA art. 32), 11 0% without credit right, and the transitional 05 0%, 06 4% and 07 8%, which Hacienda reserves for credit and debit notes. GET /v1/catalogs/iva-tariffs lists them with labels.
Example
08Rate of the main tax as a percentage (13 = 13%), 0–100 with up to 2 decimals (<Tarifa>). Required whenever defaultTaxCode is set, 08 included: the item stores its main tax whole, or not at all.
Example
13Factor for the used-goods IVA regime, only with defaultTaxCode 08: 0 to 1 with up to 4 decimals. The IVA of a line is then its taxable base × this factor, written as <FactorCalculoIVA> instead of <Tarifa>.
Example
0.3Excise and other non-IVA taxes of the item, up to 5, added after the main tax to an invoice line that sells it. The EmiteCR app does not use them on a surtido, whose taxes come from its components.
object
Tax code (<Impuesto><Codigo>, Anexo nota 8):
02: selective consumption tax (ad valorem).03: single tax on fuels (per unit).04: specific tax on alcoholic beverages (per unit).05: specific tax on packaged non-alcoholic beverages and toilet soaps (per unit).06: tax on tobacco products (per unit).12: specific tax on cement (ad valorem).99: another tax. Hacienda asks for its description (<CodigoImpuestoOTRO>), which the API does not send.
Except 99, these taxes are accepted only on invoices in CRC (422 EXCISE_NOT_SUPPORTED_FOR_CURRENCY).
Example
02Optional two-digit code, written as <CodigoTarifaIVA> of the tax when present. That element takes the IVA rate codes of GET /v1/catalogs/iva-tariffs.
Example
08Ad valorem rate as a percentage for 02, 12 and 99 (<Tarifa>); for 02 and 12 the tax is this percentage of the line's subtotal. The per-unit codes 03 to 06 take their amount from datosEspecifico, not from this rate (the EmiteCR app sends 0 for them).
Example
10Per-unit data for codes 03 to 06 (<DatosImpuestoEspecifico>), which an invoice line with those codes requires; leave it out for 02, 12 and 99. The tax of a line is computed from it (Anexo formulas): 03 cantidadUnidadMedida × impuestoUnidad; 04 quantity × millilitres of absolute alcohol × impuestoUnidad; 05 see esJabonTocador; 06 quantity × cantidadUnidadMedida × impuestoUnidad.
object
Quantity of the unit of measure the tax is set on, up to 2 decimals (<CantidadUnidadMedida>): litres of fuel for 03; millilitres of the container sold for 04 and 05; for 06, the quantity per unit sold that impuestoUnidad applies to. The 03 formula does not multiply by the line quantity, so a line with that code must carry the litres it sells.
Example
355Alcohol by volume as a percentage, code 04 only (<Porcentaje>); an invoice line with 04 requires it. With cantidadUnidadMedida it gives the millilitres of absolute alcohol (<Proporcion>) the 04 tax is computed on.
Example
5Code 05 only (<VolumenUnidadConsumo>): the reference volume in millilitres for a drink, or the grams of toilet soap sold. An invoice line with 05 requires it.
Example
355Tax per unit in colones, as the regulation of each specific tax sets it, up to 5 decimals (<ImpuestoUnidad>).
Example
18.5Code 05 only: true for a toilet soap, whose tax is quantity × volumenUnidadConsumo × impuestoUnidad; false or absent for a drink, quantity × cantidadUnidadMedida × impuestoUnidad ÷ volumenUnidadConsumo. Only selects the formula: it is not sent to Hacienda.
Example
falseMinistry of Health registration number of a medicine, up to 100 characters (<RegistroMedicamento> of an invoice line). Hacienda asks for it when the item is a medicine with a sanitary registration.
Example
CR-MED-2024-1234Pharmaceutical form of a medicine, as a code of Hacienda's «Código de forma farmacéutica» catalog (Anexo nota 19; for example 04 is cápsula), written as <FormaFarmaceutica> of an invoice line. Like pharmacyRegistry, for medicines with a sanitary registration.
Example
01Internal notes, up to 2000 characters. Never sent to Hacienda nor printed.
Example
Producto estrella — promo Q4The formats or presentations the item is sold in, at least one. Each has its own SKU (code), unit and per-currency prices; CABYS and taxes are the item's. With several variants exactly one must be isDefault: true (422 otherwise). Later changes go through the …/variants endpoints.
object
The variant's SKU, 1–50 characters, unique among the company's variants (409 when another one has it). Bulk imports match existing items by it, and for a surtido the EmiteCR app sends it as the type-03 commercial code the invoice line requires.
Example
IMP-350-UNIName of this format or presentation, 1–120 characters, shown next to the item name in catalog pickers; catalog searches match it.
Example
Cerveza Imperial 350ml — UnidadUnit the variant is sold in, as a symbol of Hacienda's unit catalog (UnidadMedidaType, standard RTC 443:2010; case-sensitive): for example Unid (unit), Kg (kilogram), L (litre), h (hour), Sp (professional services), Os (other service). The unitOfMeasure (<UnidadMedida>) of an invoice line that sells it.
Example
UnidFree-text commercial name of the package, up to 20 characters, kept with the catalog. Invoice lines do not carry it.
Example
Caja x12The variant's prices, one per currency (1 to 10). Prices are independent: a variant may have a price in some of the company's currencies only, and an invoice uses the price in its own currency. Ignored for a surtido, whose prices are derived from its components.
object
Currency of the price (ISO 4217). It must be one of the company's enabled currencies (400 CURRENCY_NOT_ENABLED), and appear only once per variant (400 VARIANT_PRICE_DUPLICATE_CURRENCY).
Example
CRCPrice of one unit in that currency, before discounts and taxes, up to 5 decimals: the unit price an invoice in that currency uses (<PrecioUnitario> of a line, <PrecioUnitarioSurtido> of a surtido component). A price is never derived from another currency with an exchange rate.
Example
950How many inner units this variant holds (e.g. 12 for a box of 12), greater than 0 with up to 3 decimals. Send it together with innerUnitOfMeasure: both or neither. Catalog information only.
Example
12Unit of the inner units packSize counts (e.g. Unid, L), a symbol of the same Hacienda catalog as unitOfMeasure. Both or neither with packSize.
Example
UnidUp to 5 codes that identify the variant elsewhere (the seller's SKU, the buyer's code, a GTIN…), in the shape of an invoice line's commercialCodes (<CodigoComercial>). Kept with the catalog: the API does not add them to invoices, so copy them into a line that should carry them.
object
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.
Example
01The code itself, 1–20 characters (<CodigoComercial><Codigo>).
Example
SKU-IMP-350Barcode (GTIN, EAN or UPC), up to 50 characters; the format is not checked. The catalog search matches it by prefix, so a scanner can find the variant.
Example
7441001234567Marks the item's main variant, the one catalog lists show. An item with a single variant gets it automatically; with several variants in one request, exactly one must be true (422 otherwise). On POST …/variants, true makes the new variant the default and demotes the previous one.
Example
truefalse pauses the variant without deleting it: the EmiteCR invoice picker and the WhatsApp agent stop offering it. Defaults to true.
Example
truePosition among the item's variants, ascending. Defaults to the variant's position in the request when the item is created, and to 0 when a variant is added later.
Example
0Marks the item as a surtido: a combo, pack or assortment of products sold as one line, whose components the invoice lists (<DetalleSurtido>). It needs surtidoComponents, and its variants get their prices from them. The CABYS codes for surtidos (e.g. 2399999002200, assorted food products) require that breakdown on the invoice.
Example
falseComponents of ONE unit of the surtido, required when isSurtido is true: 2 to 20, with distinct CABYS codes that are not surtido codes themselves (400 SURTIDO_MIN_COMPONENTS, SURTIDO_DUPLICATE_CABYS, SURTIDO_NESTING_NOT_ALLOWED). All of them need prices in the same currencies (400 SURTIDO_COMPONENT_CURRENCY_MISMATCH): a variant's price in a currency is the sum of quantity × price of the components.
object
Id of the catalog item this component was taken from, kept as a link to it; absent for a component written inline.
13-digit CABYS code of the component. It cannot be a surtido code itself (SURTIDO_NESTING_NOT_ALLOWED) nor repeat another component's (SURTIDO_DUPLICATE_CABYS).
Example
2310100000000Name of the component. EmiteCR's invoice form writes it as the component's <DetalleSurtido>, which Hacienda accepts with 3–200 characters.
Example
Arroz 1kgOptional longer description of the component, kept with the definition.
Example
Arroz blanco grano largoUnit of measure of the component, a symbol from Hacienda's catalog (Anexo nota 15) such as Unid; EmiteCR's invoice form uses it as the component's unidadMedida.
Example
UnidThe business's own unit for the component (e.g. a box), not a standard measure.
Example
CajaPrice of one unit of the component in each currency it is sold in, one entry per currency, each enabled for the company (CURRENCY_NOT_ENABLED) and none repeated (VARIANT_PRICE_DUPLICATE_CURRENCY). Every component of the surtido must have prices in the same currencies (SURTIDO_COMPONENT_CURRENCY_MISMATCH): the price of the surtido in a currency is the sum of quantity × price of its components.
object
Currency of the price (ISO 4217). It must be one of the company's enabled currencies (400 CURRENCY_NOT_ENABLED), and appear only once per variant (400 VARIANT_PRICE_DUPLICATE_CURRENCY).
Example
CRCPrice of one unit in that currency, before discounts and taxes, up to 5 decimals: the unit price an invoice in that currency uses (<PrecioUnitario> of a line, <PrecioUnitarioSurtido> of a surtido component). A price is never derived from another currency with an exchange rate.
Example
950Quantity of this component in ONE unit of the surtido (up to 3 decimals). It multiplies the component's price in the surtido's price, and EmiteCR's invoice form uses it as the component's cantidad, which Hacienda wants greater than 0.
Example
1IVA tariff code of the component (Anexo nota 8.1; e.g. 08 general 13%, 10 exempt). The components of a combo may carry different rates; EmiteCR's invoice form gives the component an IVA tax with this code.
Example
08IVA rate of the component as a percentage (13 for 13%), the rate of ivaCodigoTarifa.
Example
13Responses
Section titled “Responses”The item created, with its variants.
object
Id of the item — the {itemId} of the item routes.
13-digit CABYS code that classifies the item (<CodigoCABYS> of its lines).
Name of the product or service.
Longer description; null when it has none.
Code of the main tax (01 IVA, 07 IVA with a special calculation, 08 IVA under the used-goods regime); null when the item has no default tax.
IVA rate code (<CodigoTarifaIVA>, e.g. 08 = 13%); null when not set.
Rate of the main tax as a percentage, as a decimal STRING with 2 decimals (e.g. "13.00"); null when the item has no default tax.
Factor of the used-goods IVA regime (defaultTaxCode 08), as a decimal STRING with 4 decimals (e.g. "0.3000"); null when not set.
Excise and other non-IVA taxes of the item, as they were sent (numbers stay JSON numbers here); null when it has none.
object
Tax code (<Impuesto><Codigo>, Anexo nota 8):
02: selective consumption tax (ad valorem).03: single tax on fuels (per unit).04: specific tax on alcoholic beverages (per unit).05: specific tax on packaged non-alcoholic beverages and toilet soaps (per unit).06: tax on tobacco products (per unit).12: specific tax on cement (ad valorem).99: another tax. Hacienda asks for its description (<CodigoImpuestoOTRO>), which the API does not send.
Except 99, these taxes are accepted only on invoices in CRC (422 EXCISE_NOT_SUPPORTED_FOR_CURRENCY).
Optional two-digit code, written as <CodigoTarifaIVA> of the tax when present. That element takes the IVA rate codes of GET /v1/catalogs/iva-tariffs.
Ad valorem rate as a percentage for 02, 12 and 99 (<Tarifa>); for 02 and 12 the tax is this percentage of the line's subtotal. The per-unit codes 03 to 06 take their amount from datosEspecifico, not from this rate (the EmiteCR app sends 0 for them).
Per-unit data for codes 03 to 06 (<DatosImpuestoEspecifico>), which an invoice line with those codes requires; leave it out for 02, 12 and 99. The tax of a line is computed from it (Anexo formulas): 03 cantidadUnidadMedida × impuestoUnidad; 04 quantity × millilitres of absolute alcohol × impuestoUnidad; 05 see esJabonTocador; 06 quantity × cantidadUnidadMedida × impuestoUnidad.
object
Quantity of the unit of measure the tax is set on, up to 2 decimals (<CantidadUnidadMedida>): litres of fuel for 03; millilitres of the container sold for 04 and 05; for 06, the quantity per unit sold that impuestoUnidad applies to. The 03 formula does not multiply by the line quantity, so a line with that code must carry the litres it sells.
Alcohol by volume as a percentage, code 04 only (<Porcentaje>); an invoice line with 04 requires it. With cantidadUnidadMedida it gives the millilitres of absolute alcohol (<Proporcion>) the 04 tax is computed on.
Code 05 only (<VolumenUnidadConsumo>): the reference volume in millilitres for a drink, or the grams of toilet soap sold. An invoice line with 05 requires it.
Tax per unit in colones, as the regulation of each specific tax sets it, up to 5 decimals (<ImpuestoUnidad>).
Code 05 only: true for a toilet soap, whose tax is quantity × volumenUnidadConsumo × impuestoUnidad; false or absent for a drink, quantity × cantidadUnidadMedida × impuestoUnidad ÷ volumenUnidadConsumo. Only selects the formula: it is not sent to Hacienda.
Ministry of Health registration number of a medicine; null when not set.
Pharmaceutical form code of a medicine (Anexo nota 19); null when not set.
Internal notes; null when there are none.
active, or archived: hidden from the default list (?status=active) and from the invoice pickers, still referenced by documents already created.
When the item was created.
When the item itself was last changed (base fields, status or surtido composition); variant and price edits do not move it.
The item's variants that are not deleted, paused ones included, ordered by sortOrder, each with its per-currency prices.
object
Id of the variant — the {variantId} of the variant routes.
Id of the item it belongs to.
The variant's SKU, unique among the company's variants.
Name of this format or presentation; null when it has none.
Unit the variant is sold in, a symbol of Hacienda's unit catalog.
Free-text commercial name of the package; null when it has none.
The variant's active prices, one per currency, ordered by currency code. Sparse: a variant may have no price in some of the company's currencies (an invoice in such a currency cannot use it), and a price in a currency the company disabled is kept and still listed. For a surtido they are derived from its components.
object
Currency of the price (ISO 4217).
Price of one unit in that currency, before discounts and taxes, as a decimal STRING with 5 decimals (e.g. "950.00000"): the stored numeric value, not a JSON number.
How many inner units the variant holds, as a decimal STRING with 3 decimals (e.g. "12.000"); null when not set.
Unit of the inner units packSize counts; null when not set.
Codes that identify the variant elsewhere, as they were sent; null when it has none. Catalog only: the API does not add them to invoices.
object
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.
The code itself, 1–20 characters (<CodigoComercial><Codigo>).
Barcode (GTIN, EAN or UPC); null when it has none.
Whether this is the item's default variant, the one catalog lists show (at most one per item).
false when the variant is paused: the EmiteCR invoice picker and the WhatsApp agent do not offer it.
Position among the item's variants, ascending.
When the variant was created.
When the variant was last changed.
Whether the item is a surtido (combo), with its composition in surtidoComponents.
Components of ONE unit of the surtido, in the order they were sent; null for an item that is not a surtido.
object
Id of the component.
Id of the catalog item this component was taken from; absent for a component written inline.
13-digit CABYS code of the component.
Name of the component (the <DetalleSurtido> EmiteCR's invoice form writes).
Longer description of the component; absent when it has none.
Unit of measure of the component, a symbol of Hacienda's unit catalog.
The business's own unit for the component; absent when it has none.
Price of one unit of the component in each currency, ordered by currency code. The price of the surtido in a currency is the sum of quantity × price of its components.
object
Currency of the price (ISO 4217).
Price of one unit in that currency, before discounts and taxes, as a decimal STRING with 5 decimals (e.g. "950.00000"): the stored numeric value, not a JSON number.
Quantity of this component in ONE unit of the surtido, as a JSON number.
IVA tariff code of the component (e.g. 08 13%); absent when not set.
IVA rate of the component as a percentage, as a JSON number; absent when not set.
Example
{ "cabysCode": "8399000000000", "name": "Servicio de consultoría TI", "description": "Consultoría en arquitectura de software — bloque mensual de 40 horas", "defaultTaxCode": "01", "defaultTaxRateCode": "08", "defaultTaxRate": "13.00", "defaultTaxFactor": "0.3000", "secondaryTaxes": [ { "codigo": "02", "codigoTarifa": "08", "tarifa": 10, "datosEspecifico": { "cantidadUnidadMedida": 355, "porcentaje": 5, "volumenUnidadConsumo": 355, "impuestoUnidad": 18.5, "esJabonTocador": false } } ], "pharmacyRegistry": "CR-MED-2024-1234", "pharmaceuticalForm": "01", "notes": "Producto estrella — promo Q4", "status": "active", "variants": [ { "code": "IMP-350-UNI", "variantName": "Cerveza Imperial 350ml — Unidad", "unitOfMeasure": "Unid", "unitOfMeasureCommercial": "Caja x12", "prices": [ { "currency": "AED", "unitPrice": "950.00000" } ], "packSize": "12.000", "innerUnitOfMeasure": "Unid", "commercialCodes": [ { "tipo": "01", "codigo": "SKU-IMP-350" } ], "barcode": "7441001234567", "sortOrder": 0 } ], "surtidoComponents": [ { "cabysCode": "2310100000000", "name": "Arroz 1kg", "description": "Arroz blanco grano largo", "unitOfMeasure": "Unid", "unitOfMeasureCommercial": "Caja", "prices": [ { "currency": "AED", "unitPrice": "950.00000" } ], "quantity": 1, "ivaCodigoTarifa": "08", "ivaTarifa": 13 } ]}Invalid fields, a price in a currency the company has not enabled (CURRENCY_NOT_ENABLED), two prices in one currency (VARIANT_PRICE_DUPLICATE_CURRENCY), or an invalid surtido composition (SURTIDO_*).
Missing or invalid JWT / API key
Tenant boundary violation or insufficient scope.
Two variants of the request share a code (SKU), or another variant has it.
Several variants and not exactly one of them with isDefault: true.