Skip to content

Manually archive an item (excludes from invoice line pickers)

POST
/v1/tenants/{tenantId}/items/{itemId}/archive
curl --request POST \
--url https://api.emite.cr/v1/tenants/example/items/example/archive \
--header 'Authorization: Bearer <token>'

Status transition: active → archived. Archived items are left out of the default list (?status=active) and the invoice form, but documents already created keep their lines. Idempotent: archiving an archived item returns it unchanged. Answers 201 (it is a POST) with the item.

tenantId
required
string

Tenant UUID.

itemId
required
string

Item UUID.

The item, now archived.

Media typeapplication/json
object
id
required

Id of the item — the {itemId} of the item routes.

string format: uuid
cabysCode
required

13-digit CABYS code that classifies the item (<CodigoCABYS> of its lines).

string
name
required

Name of the product or service.

string
description
required

Longer description; null when it has none.

string
nullable
defaultTaxCode
required

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.

string
nullable
defaultTaxRateCode
required

IVA rate code (<CodigoTarifaIVA>, e.g. 08 = 13%); null when not set.

string
nullable
defaultTaxRate
required

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.

string
nullable
defaultTaxFactor
required

Factor of the used-goods IVA regime (defaultTaxCode 08), as a decimal STRING with 4 decimals (e.g. "0.3000"); null when not set.

string
nullable
secondaryTaxes
required

Excise and other non-IVA taxes of the item, as they were sent (numbers stay JSON numbers here); null when it has none.

Array<object>
nullable
object
codigo
required

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

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

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.

string
tarifa
required

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

number
datosEspecifico

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

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.

number
porcentaje

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.

number
volumenUnidadConsumo

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.

number
impuestoUnidad
required

Tax per unit in colones, as the regulation of each specific tax sets it, up to 5 decimals (<ImpuestoUnidad>).

number
esJabonTocador

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.

boolean
pharmacyRegistry
required

Ministry of Health registration number of a medicine; null when not set.

string
nullable
pharmaceuticalForm
required

Pharmaceutical form code of a medicine (Anexo nota 19); null when not set.

string
nullable
notes
required

Internal notes; null when there are none.

string
nullable
status
required

active, or archived: hidden from the default list (?status=active) and from the invoice pickers, still referenced by documents already created.

string
Allowed values: active archived
createdAt
required

When the item was created.

string format: date-time
updatedAt
required

When the item itself was last changed (base fields, status or surtido composition); variant and price edits do not move it.

string format: date-time
variants
required

The item's variants that are not deleted, paused ones included, ordered by sortOrder, each with its per-currency prices.

Array<object>
object
id
required

Id of the variant — the {variantId} of the variant routes.

string format: uuid
itemId
required

Id of the item it belongs to.

string format: uuid
code
required

The variant's SKU, unique among the company's variants.

string
variantName
required

Name of this format or presentation; null when it has none.

string
nullable
unitOfMeasure
required

Unit the variant is sold in, a symbol of Hacienda's unit catalog.

string
unitOfMeasureCommercial
required

Free-text commercial name of the package; null when it has none.

string
nullable
prices
required

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.

Array<object>
object
currency
required

Currency of the price (ISO 4217).

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

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.

string
packSize
required

How many inner units the variant holds, as a decimal STRING with 3 decimals (e.g. "12.000"); null when not set.

string
nullable
innerUnitOfMeasure
required

Unit of the inner units packSize counts; null when not set.

string
nullable
commercialCodes
required

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.

Array<object>
nullable
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
barcode
required

Barcode (GTIN, EAN or UPC); null when it has none.

string
nullable
isDefault
required

Whether this is the item's default variant, the one catalog lists show (at most one per item).

boolean
isActive
required

false when the variant is paused: the EmiteCR invoice picker and the WhatsApp agent do not offer it.

boolean
sortOrder
required

Position among the item's variants, ascending.

number
createdAt
required

When the variant was created.

string format: date-time
updatedAt
required

When the variant was last changed.

string format: date-time
isSurtido
required

Whether the item is a surtido (combo), with its composition in surtidoComponents.

boolean
surtidoComponents
required

Components of ONE unit of the surtido, in the order they were sent; null for an item that is not a surtido.

Array<object>
nullable
object
id
required

Id of the component.

string format: uuid
sourceItemId

Id of the catalog item this component was taken from; absent for a component written inline.

string format: uuid
cabysCode
required

13-digit CABYS code of the component.

string
name
required

Name of the component (the <DetalleSurtido> EmiteCR's invoice form writes).

string
description

Longer description of the component; absent when it has none.

string
unitOfMeasure
required

Unit of measure of the component, a symbol of Hacienda's unit catalog.

string
unitOfMeasureCommercial

The business's own unit for the component; absent when it has none.

string
prices
required

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.

Array<object>
object
currency
required

Currency of the price (ISO 4217).

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

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.

string
quantity
required

Quantity of this component in ONE unit of the surtido, as a JSON number.

number
ivaCodigoTarifa

IVA tariff code of the component (e.g. 08 13%); absent when not set.

string
ivaTarifa

IVA rate of the component as a percentage, as a JSON number; absent when not set.

number
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
}
]
}

Missing or invalid JWT / API key

Tenant boundary violation or insufficient scope.

Item not found.