CABYS and IVA rates
Sync CR fiscal reference data from one authoritative source.
Every comprobante line carries a 13-digit CABYS code (Catálogo de Bienes y
Servicios) and its IVA tax treatment. Rather than have every consumer sync
Hacienda and drift, Sello publishes the CR fiscal reference data as a read-only
/reference/* namespace you replicate from one authoritative source.
Why Sello hosts the catalog
CABYS is a national catalog owned by the Banco Central de Costa Rica (BCCR), published as a public spreadsheet (~20,000 rows) and versioned roughly annually. It does not live behind a queryable government API. Sello ingests the BCCR file into its own store (integrity-verified, effective-dated per edition) and serves it, so your issuance path has zero runtime dependency on a government API. See ADR 0001 for the full rationale.
The reference endpoints
All under the same API-key auth as /v1 (any valid key of any account may read
them — the datasets are national/global, not per-tenant). Read-only, no
idempotency, RFC 9457 errors, keyset pagination.
| Endpoint | Returns |
|---|---|
GET /reference/datasets | The registry: each dataset family's shape, current version, and generatedAt. Poll this to detect a new version to sync. |
GET /reference/cabys | The CABYS catalog — bulk (no query) or delta (?since=<version>), cursor-paginated. |
GET /reference/rates | The IVA tariff catalog and code→rate map (small, static, bulk only). |
Monetary/rate values are exact-decimal strings (never floats), consistent with the rest of the API.
Sync flow
- Poll
GET /reference/datasetsand compare each family's current version to what you last synced. - If a family changed, pull
GET /reference/cabys?since=<yourVersion>for the delta (or a full bulk pull on first sync), followingnextCursoruntil it isnull. - Pull
GET /reference/ratesfor the IVA map.
Issue-time validation
Sello validates CABYS at issue time, but the posture is deliberately layered:
- An unknown code (not in the current edition) is an advisory warning recorded on the evidence trail, not a hard reject — Hacienda re-validates CABYS at submission, and Sello's local copy may lag a brand-new BCCR edition.
- A code that never existed in any retained edition is hard-rejected as a
clear typo (
422). - Accounts may opt in to strict
422rejection of unknown codes.
Each issued document records the catalog_version that validated it, so an
auditor can reconstruct whether a code was valid in the edition active on a given
date.
Because Sello is the single source, your systems replicate one catalog instead of each syncing Hacienda independently and drifting apart.