Prerequisites
Prerequisites
- The issuer’s tax data — the taxpayer issuing invoices must provide this to set up the tenant: a P12 certificate, credentials for Hacienda (Costa Rica’s tax authority), and economic activities. Without it, no document can be issued. See the details below.
- An active API key — request one from your LX CloudPos account administrator through the CRM’s “Integrations” module.
- Basic knowledge of HTTP and JSON — this API is standard REST.
- The ability to make outbound HTTPS requests from your infrastructure.
- A public HTTPS endpoint if you plan to receive webhooks (optional but recommended).
- Familiarity with how Hacienda works — at least at a general level (what an FE, a TE, an NC, and an ND are). This guide covers what you need.
Data the issuer must provide
Electronic invoicing happens on behalf of the taxpayer, using their tax identity with Hacienda. This data belongs to them, and only they can provide it — LX CloudPos cannot generate or substitute it. It is registered once, when the tenant is set up, and is a prerequisite for the first document issued.
| Data | Detail |
|---|---|
| P12 certificate | The digital signing certificate Hacienda issues in the taxpayer’s name, along with its PIN. Every document is signed with it. |
| ATV credentials | The username and password for Hacienda’s portal (ATV), which the platform uses to send documents and check their resolution. |
| Taxpayer identification | The individual or corporate ID number (cédula), and the legal name or name registered with Hacienda. |
| Economic activities | The activities the taxpayer has registered, indicating which one is primary. These determine the codigoActividad used when issuing — see Economic activities. |
| Contact details | The issuer’s email and phone number, included in the document’s XML. |
Registration happens through the POS, not through the API — none of this data travels in the requests. Once configured, it is used automatically: every document is signed and sent using the tenant’s credentials, with no action needed from you.
The certificate expires. When it does, every issuance for the tenant starts failing with an
errorstatus. The renewed certificate must be provided before expiration, and managing it with Hacienda is the issuer’s responsibility.
What is NOT required
- Sending the P12 certificate on every call — it is registered once on the tenant, and the API never receives it as a parameter.
- Implementing XAdES signing — it is applied on LX CloudPos’s side, transparently to you.
- Knowledge of XML — the API accepts and returns JSON.
- Database access — the entire operation happens via REST.
Useful tools
- cURL — for quick tests (included on macOS/Linux, easy to install on Windows).
- Postman / Insomnia — for test collections.
- httpie — a more readable alternative to cURL.
- jq — for processing JSON on the command line.
- ngrok / Cloudflare Tunnel — for exposing local webhooks during development.