Skip to content

Get the IVA option suggested for a CAByS code

GET
/v1/cabys/{codigo}/suggested-iva
curl --request GET \
--url https://api.emite.cr/v1/cabys/8399000000000/suggested-iva \
--header 'Authorization: Bearer <token>'

Reads the IVA rate Hacienda publishes for the code (as GET /:codigo does, cached for one hour) and maps it to an option of GET /v1/catalogs/iva-tariffs. Only the rates 13, 4, 2, 1 and 0.5 map to an option: any other rate, 0% included, returns suggested: null, and the client picks the tariff itself.

codigo
required
string
Example
8399000000000

13-digit CAByS code

Media typeapplication/json
object
cabysCode
required

The 13-digit CAByS code looked up.

string
cabysDescription
required

Description of the code in the CAByS catalog, as Hacienda returns it (Spanish).

string
rate
required

IVA rate (%) Hacienda publishes for the code (its impuesto), read live from Hacienda and cached for up to one hour.

number
suggested
required

The IVA option that matches rate, ready to copy into an item or an invoice line. null when rate is not 13, 4, 2, 1 or 0.5, which includes a 0% rate: the client then picks the tariff itself (for example from GET /v1/catalogs/iva-tariffs).

object
optionId
required

Stable id of the matching option in GET /v1/catalogs/iva-tariffs (its id), for a client that renders that catalog as a picker.

string
taxCode
required

Tax code (CodigoImpuestoType, Hacienda Nota 8). Always 01 (IVA) in a suggestion. It is the value for an item's defaultTaxCode and for taxes[].codigo of an invoice line (<Impuesto><Codigo> in the XML).

string
nullable
codigoTarifa
required

IVA rate code (CodigoTarifaIVAType): the value for an item's defaultTaxRateCode and for taxes[].codigoTarifa of an invoice line (<CodigoTarifaIVA> in the XML). This endpoint resolves five rates only: 08 (13%), 04 (4%), 03 (2%), 02 (1%) and 09 (0.5%).

string
nullable
tarifa
required

IVA rate as a percentage (13 = 13%): the value for an item's defaultTaxRate and for taxes[].tarifa of an invoice line (<Tarifa> in the XML).

number
nullable
label
required

Label of the option, in Spanish, as the EmiteCR app shows it.

string
description

Spanish note on when the option applies, suitable as helper text in a form.

string
Example
{
"cabysCode": "8399000000000",
"cabysDescription": "Servicios de consultoría en gestión empresarial",
"rate": 13,
"suggested": {
"optionId": "iva-13",
"taxCode": "01",
"codigoTarifa": "08",
"tarifa": 13,
"label": "IVA general 13%",
"description": "Tarifa estándar — la mayoría de bienes y servicios."
}
}

Code is not 13 digits.

Code unknown in Hacienda's catalog.

Hacienda's CAByS service answered an error.

Hacienda's CAByS service could not be reached.