{
"status": "ok"
}
curl --location --request GET 'https://zylalabs.com/api/13427/costa+rica+e-invoice+validator+api+-+hacienda/29087/health+check' --header 'Authorization: Bearer YOUR_API_KEY'
{
"valid": true,
"wellFormed": true,
"inputFormat": "xml",
"documentType": "FacturaElectronica",
"version": "4.4",
"signatureValid": true,
"errorCount": 0,
"warningCount": 0,
"findings": [
{
"level": "info",
"ruleId": "CR-STRUCT-VERSION",
"text": "Namespace declares Hacienda comprobante schema v4.4 (https://cdn.comprobanteselectronicos.go.cr/xml-schemas/v4.4/facturaElectronica).",
"location": null,
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-STRUCT-XSD",
"text": "Document is valid against the Hacienda v4.4 FacturaElectronica structural XSD.",
"location": null,
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-SYSID-OK",
"text": "System Identification node <ProveedorSistemas> present (v4.4 requirement).",
"location": "ProveedorSistemas",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-CLAVE-CONSECUTIVO",
"text": "Clave consecutivo segment matches <NumeroConsecutivo>.",
"location": "Clave",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-CLAVE-TIPO",
"text": "Tipo de comprobante '01' matches the root <FacturaElectronica>.",
"location": "NumeroConsecutivo",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-MATH-COMPROBANTE",
"text": "ResumenFactura totals reconcile to TotalComprobante.",
"location": "ResumenFactura/TotalComprobante",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-SIG-CERT",
"text": "Embedded signing certificate: subject 'C=CR,O=Persona Juridica,CN=EMPRESA EJEMPLO SA', issuer 'C=CR,O=Persona Juridica,CN=EMPRESA EJEMPLO SA'.",
"location": "ds:X509Certificate",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-SIG-CERTDIGEST",
"text": "XAdES SigningCertificate/CertDigest matches SHA-256 of the embedded certificate.",
"location": "xades:SigningCertificate",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-SIG-EPES-POLICY",
"text": "XAdES-EPES SignaturePolicyIdentifier present (explicit signature policy referenced).",
"location": "xades:SignaturePolicyIdentifier",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-SIG-DOC-DIGEST",
"text": "Document digest VERIFIES: recomputed SHA-256 over the enveloped document (ds:Signature removed, inclusive Canonical XML) matches the signed DigestValue.",
"location": "ds:Reference[@URI='']",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-SIG-PROPS-DIGEST",
"text": "SignedProperties digest VERIFIES: recomputed SHA-256 over the canonicalized xades:SignedProperties matches the signed DigestValue.",
"location": "ds:Reference[@URI='#signed-props']",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-SIG-VALUE",
"text": "SignatureValue VERIFIES: RSA-SHA256 over the canonicalized SignedInfo checks out against the embedded certificate's public key.",
"location": "ds:SignatureValue",
"occurrences": 1
},
{
"level": "info",
"ruleId": "CR-SIG-TRUST",
"text": "Trust chain to a Costa-Rica CA (the 'Sistema Nacional de Certificacion Digital' / MICITT root and its policy CAs) is NOT verified here; that requires the SINPE/MICITT CA list and, for full assurance, an online Hacienda check. Structure and the embedded-certificate crypto are checked offline.",
"location": null,
"occurrences": 1
}
]
}
curl --location --request POST 'https://zylalabs.com/api/13427/costa+rica+e-invoice+validator+api+-+hacienda/29088/validate+e-invoice' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '
50615092500310112345600100001010000000001112345678
3101123456
620100
00100001010000000001
2025-09-15T10:00:00-06:00
Empresa Ejemplo Sociedad Anonima
02
3101123456
1
01
01
Direccion de ejemplo, edificio central
[email protected]
Cliente Ejemplo
01
0102030405
01
1
8511000000000
1.000
Unid
Servicio de ejemplo para prueba
10000.00000
10000.00000
10000.00000
10000.00000
01
08
13.00
1300.00000
0.00000
1300.00000
11300.00000
CRC
1.00000
10000.00000
10000.00000
10000.00000
0.00000
10000.00000
1300.00000
11300.00000
bAhSYwtm5VWtis0RL+Nc7RZ/ZgDpx2VBSPKtVGeGRnQ= 34a+NpJTP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sAwDQYJKoZIhvcNAQELBQADggEBALLN1ekF/A6vVYktftYGbTCB3+GE/7ES0939UqBp+ZxRIn3kvi1diPzn0+MFNwjsexTj7xOg7M6TzJnK8ew91rSDGD6evfllcn8oAo8kxcEisAK/Zx/pAB5Ni9kcnnSVVWOnEGUMtrmv5eVvUFFGS7tDDpCcIEiQLRoQEIIeFw35d1R5pLC+zT872NnoO3jPk7DDGP8vYII5BZCW6JUkJymvrRLM/jLc/1owHXICSAVY7UUX/5ptKYf1A2R4yq79x/M5Yq9LETwy3mWAZ4hrMx2/2R0V3dU4vo3CAG/VWIxORJlFgv7jaVULtkb/CRZigBkUurgy75iUN+bmDZUNSi0= 2025-09-15T10:00:05-06:00 /qdHl5jxomu5xM4OC2BQt69+SgFUXVv4Ib8uEr8Qvo4= C=CR,O=Persona Juridica,CN=EMPRESA EJEMPLO SA 1785236750205 https://tribunet.hacienda.go.cr/docs/esquemas/2016/v4.4/Resolucion_General_MH-DGT-RES-0027-2024.pdf KN6/2eZEAduZ3t0sn4aWMv8nmpGdaIcSso99Bp9QT04= '
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 哥斯达黎加电子发票验证API - 财政部 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
(年度计费可节省 2 个月 🎉)
GET健康检查端点返回一个简单的JSON对象,指示服务状态,而POST验证电子发票端点返回一个详细的JSON验证报告,包含有效性、文件类型、版本、签名有效性、错误计数和与Hacienda v4.4标准合规性相关的结果等字段
POST验证电子发票响应中的关键字段包括“有效”、“格式良好”、“文档类型”、“版本”、“签名有效”、“错误计数”、“警告计数”和“发现”,它们提供了关于验证状态和特定合规问题的见解
响应数据以JSON格式结构化。主要验证状态在顶层呈现,随后是按级别(信息、警告、错误)分类的详细发现,描述特定的合规检查及其结果
GET健康检查提供服务状态,而POST验证电子发票提供电子发票的全面验证细节,包括文档类型、版本、签名检查和基于官方XSD的合规性发现
POST验证电子发票端点接受Comprobante Electronico的原始XML作为请求体 不需要额外的参数,因为文档类型是从XML内容自动检测的
数据的准确性通过遵守哥斯达黎加财政部制定的官方XSD模式和验证规则得以保持 API会检查这些标准的合规性确保验证结果符合当前的监管要求
典型的使用案例包括验证电子发票是否符合哥斯达黎加税收法规 确保文件格式正确以及在提交给财政局之前验证电子发票中数字签名的完整性
用户可以通过解释验证报告来利用返回的数据,以识别合规问题,处理任何错误或警告,并确保他们的电子发票符合哥斯达黎加财政部接受的必要标准