The Spanish version is the authoritative reference. View in Spanish
🇨🇷 Costa Rica
This sheet assumes you know the xPOS-Core communication protocol. Here we only document what is specific to Costa Rica.
Summary
| Aspect | Value |
|---|---|
country code | cr |
| Tax authority | Ministry of Finance (MH) |
| Pattern | A — XML with XSD |
Supported inputType | json, xml, xdoc, txt |
| Extra endpoint | – |
| Output | Signed tax XML |
XSLT mapping
| XSLT | Use |
|---|---|
input_to_dte_cr.xslt | json and xml inputs → XML <root> → Gosocket XML. |
other_to_dte_cr.xslt | txt input → Gosocket XML. Does not go through input_to_dte. |
xdoc_to_dte_cr.xslt | xdoc input → Gosocket XML. Does not go through input_to_dte. |
dte_to_fiscal_cr.xslt | Gosocket XML → MH tax DTE. |
custom_response_cr.xslt | Generates custom_response when applicable. |
Document types (typeDoc)
WebSocket example uses
typeDoc=1. The parameter is numeric:typeDoc=1andtypeDoc=01are equivalent.
typeDoc | Document |
|---|---|
| 01 | Electronic invoice |
| 02 | Electronic debit note |
| 03 | Electronic credit note |
| 04 | Electronic ticket |
| 08 | Electronic purchase invoice |
| 09 | Electronic export invoice |
| 10 | Electronic payment receipt |
Each type validates against its own schema, in version 4.4.
Costa Rica-specific response fields
Costa Rica returns the entire core + full tax echo (statusCode/Description/Message) + applicationResponse + timeGeneration + timeValidation.
countryIdentificationCode in Costa Rica corresponds to the MH numeric key (50 digits).
WebSocket example
Illustrative values. The structure is real; the data are examples.
{
"env": "sbx",
"operation": "consolidate",
"typeDoc": 1,
"country": "cr",
"inputType": "json",
"origin": "<issuer taxId>",
"document": { /* DTE Costa Rica */ }
}Particular notes
- Publishes in Inbox-Gosocket.
- Re-retrieval via
/api/v1/statuswithtransactionIdorfolio + typeDoc.
Changes in version 2.7.0
- More robust credential renewal with Hacienda: only one token renewal runs at a time —even when several submissions need it simultaneously— and the validity is read from the token itself. Fewer rejections due to expired credentials during peaks of activity.
- More resilient contingency: a connection outage with Hacienda no longer affects the document; it is queued and resent automatically once the service recovers. The final status is reflected when the authority responds.