Environments
One base URL, an environment per emisor, and the Sello-Version header that picks the contract.
One base URL
Each Sello deployment has one base URL, and the base URL you call is the one
for your deployment. https://api.sello.cr is Sello's production host:
https://api.sello.crThe examples in these docs use it; if you were given a different base URL, use that one instead. There is no separate sandbox host. Whether a document goes to Hacienda's sandbox (pruebas) or to Hacienda production is decided by the emisor it is issued for, not by the URL you call.
The environment belongs to the emisor
Every emisor has an environment:
| Emisor environment | Files to | How it gets there |
|---|---|---|
| Sandbox | Hacienda pruebas | Every new emisor starts here. |
| Production | Hacienda production | Step 5 of onboarding (Verificación y puesta en producción) promotes it. |
A sandbox emisor stays in sandbox until onboarding promotes it. Use one while you build and test your integration.
Which key may act on which emisor
An API key is live or test (see the key format).
The rule is:
- A
testkey may act on a sandbox emisor only. On a production emisor it is refused, because the document would be a binding comprobante signed with the real certificate. - A
livekey may act on either.
const sello = new SelloClient({
apiKey: process.env.SELLO_API_KEY,
baseUrl: 'https://api.sello.cr',
});The client is the same while you develop and once you go live. What changes is the emisor, and the key you use with it.
A live key on a promoted emisor files for real. The document goes to
Hacienda production, is legally binding, and spends a real consecutivo. Use a
test key while you develop: it cannot reach a production emisor by mistake.
The API version
Sello is date-based versioned. The stable major is the /v1 path
segment. The dated minor is the Sello-Version header: the request header
picks the contract, and the response header names the date the request was
served under. Today the server serves one contract, 2026-06-15.
When you omit the header, the server uses your account's pinned version: the
deployment's global default (2026-06-15) when the account was created, never
moved by a later change of that default. When you send a supported date, it
serves that date. A value that is not a YYYY-MM-DD calendar date is 400
invalid-version, and a valid date the server does not serve is 400
unsupported-version (see Changelog / Versions).
Send it explicitly to pin a contract. A header you send always wins over the
account's pinned version. With the SDK, pass apiVersion once and it is sent on
every request (the convenience wrappers can't bypass it):
const sello = new SelloClient({
apiKey: process.env.SELLO_API_KEY,
apiVersion: '2026-06-15', // the dated minor; /v1 is the stable major
});With raw HTTP:
Sello-Version: 2026-06-15/reference ignores the request header, so sending it there is allowed and
changes nothing. There are no Deprecation / Sunset headers and no
retirement schedule yet (ADR 0003); see Changelog / Versions.