Validador de e-facturas MyInvois (LHDN) de Keyless Malaysia: XSD oficial de UBL 2.1, listas de códigos, cálculo de totales, verificación de firma XAdES. Enviar XML o JSON, obtener un informe JSON codificado por reglas. Sin cuenta LHDN
{
"status": "ok"
}
curl --location --request GET 'https://zylalabs.com/api/13423/malaysia+myinvois+e-invoice+validator+api/29078/health+check' --header 'Authorization: Bearer YOUR_API_KEY'
{
"valid": true,
"wellFormed": true,
"inputFormat": "xml",
"documentType": "01",
"version": "1.1",
"errorCount": 0,
"warningCount": 4,
"findings": [
{
"level": "info",
"ruleId": "MY-STRUCT-XSD",
"text": "Document is valid against the official UBL 2.1 Invoice XSD.",
"location": null,
"occurrences": 1
},
{
"level": "warning",
"ruleId": "MY-MATH-TAX-INCLUSIVE",
"text": "TaxInclusiveAmount (1436.50) != TaxExclusiveAmount + total TaxAmount (1524.13).",
"location": "cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount",
"occurrences": 1
},
{
"level": "info",
"ruleId": "MY-SIG-CERT",
"text": "Embedded signing certificate: subject '1.2.840.113549.1.9.1=#1616616e61732e6140666776686f6c64696e67732e636f6d,2.5.4.5=#1309443132333435363738,CN=Dummy,OU=Test Unit eInvoice,2.5.4.97=#130c433239373032363335303630,O=Dummy,C=MY', issuer 'CN=Trial LHDNM Sub CA V1,OU=Terms of use at http://www.posdigicert.com.my,O=LHDNM,C=MY'.",
"location": "ds:X509Certificate",
"occurrences": 1
},
{
"level": "info",
"ruleId": "MY-SIG-EKU",
"text": "Certificate carries the Document Signing EKU (1.3.6.1.4.1.311.10.3.12).",
"location": "ds:X509Certificate",
"occurrences": 1
},
{
"level": "warning",
"ruleId": "MY-SIG-CERT-VALIDITY",
"text": "Signing certificate is outside its validity window (Thu Jun 06 02:52:36 UTC 2024 .. Fri Sep 06 02:52:36 UTC 2024): CertificateExpiredException.",
"location": "ds:X509Certificate",
"occurrences": 1
},
{
"level": "info",
"ruleId": "MY-SIG-CERTDIGEST",
"text": "XAdES SigningCertificate/CertDigest matches SHA-256 of the embedded certificate.",
"location": "xades:SigningCertificate",
"occurrences": 1
},
{
"level": "info",
"ruleId": "MY-SIG-ISSUERSERIAL",
"text": "XAdES IssuerSerial serial number matches the embedded certificate.",
"location": "xades:IssuerSerial",
"occurrences": 1
},
{
"level": "info",
"ruleId": "MY-SIG-DOC-DIGEST",
"text": "Document digest VERIFIES: recomputed SHA-256 over the minified document (UBLExtensions and cac:Signature removed, inclusive Canonical XML) matches the signed DigestValue.",
"location": "ds:Reference[@URI='']",
"occurrences": 1
},
{
"level": "warning",
"ruleId": "MY-SIG-PROPS-DIGEST",
"text": "SignedProperties digest MISMATCH: signed DigestValue Tc9oNX8EuNQohWVDZeaPOHmeBU5tuwVdwIRyfltnTPw= does not match the recomputed SHA-256 (exclusive b0VXjdpRrf5OQt96gzaFM1e8I9/+1qC5uFfI8eK8zjY= / inclusive vjjXqMNokPtL5qvfFj4irmcxCjxyVuirMVVe3KCKXBw=).",
"location": "ds:Reference[@URI='#id-xades-signed-props']",
"occurrences": 1
},
{
"level": "warning",
"ruleId": "MY-SIG-VALUE",
"text": "SignatureValue does NOT verify: RSA-SHA256 over the canonicalized SignedInfo does not match the embedded certificate's public key.",
"location": "ds:SignatureValue",
"occurrences": 1
},
{
"level": "info",
"ruleId": "MY-SIG-TRUST",
"text": "Trust chain to a Malaysian (LHDN/Pos Digicert) CA is NOT verified here; this requires the LHDNM CA/root list and, for full assurance, an online LHDN check. Structure and the embedded-certificate crypto are checked offline.",
"location": null,
"occurrences": 1
}
]
}
curl --location --request POST 'https://zylalabs.com/api/13423/malaysia+myinvois+e-invoice+validator+api/29079/validate+e-invoice' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '
urn:oasis:names:specification:ubl:dsig:enveloped:xades
urn:oasis:names:specification:ubl:signature:1
urn:oasis:names:specification:ubl:signature:Invoice
not(//ancestor-or-self::ext:UBLExtensions)
not(//ancestor-or-self::cac:Signature)
fRaWJINS9sB9aSl/MhCjMsdVMFpLwnxstpPhJ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MvXwKTXuwVI2iUqmJSzJbUY+w3OeG7fvrhUfMJPM9XZBOp7CEI1QHfHrtyjlKNhYzG3IgHcfAZUURO16gFmWgzAZLkJSmCIxaIty/EmvG5N3ZePolBOa7lNEH/eSBMGAQteH+Twtiu0Y2xSwmmsxnfJyw==
2024-07-23T16:31:06Z
KKBSTyiPKGkGl1AFqcPziKCEIDYGtnYUTQN4ukO7G40=
CN=Trial LHDNM Sub CA V1, OU=Terms of use at http://www.posdigicert.com.my, O=LHDNM, C=MY
162880276254639189035871514749820882117
XML-INV12345
2024-07-23
00:40:00Z
01
MYR
MYR
2024-07-01
2024-07-31
Monthly
151891-1981
L1
CustomsImportForm
FTA
FreeTradeAgreement
Sample Description
L1
K2
L1
urn:oasis:names:specification:ubl:signature:Invoice
urn:oasis:names:specification:ubl:dsig:enveloped:xades
CPT-CCN-W-211111-KL-000002
46510
Supplier's TIN
Supplier's BRN
NA
NA
Kuala Lumpur
50480
14
Lot 66
Bangunan Merdeka
Persiaran Jaya
MYS
Supplier's Name
+60123456789
[email protected]
Buyer's TIN
Buyer's BRN
NA
NA
Kuala Lumpur
50480
14
Lot 66
Bangunan Merdeka
Persiaran Jaya
MYS
Buyer's Name
+60123456780
[email protected]
Recipient's TIN
Recipient's BRN
Kuala Lumpur
50480
14
Lot 66
Bangunan Merdeka
Persiaran Jaya
MYS
Recipient's Name
1234
true
Service charge
100
01
1234567890
Payment method is cash
E12345678912
1.00
2024-07-23
00:30:00Z
false
Sample Description
100
true
Service charge
100
87.63
87.63
87.63
01
OTH
1436.50
1436.50
1436.50
1436.50
1436.50
0.30
1436.50
1234
1
1436.50
false
Sample Description
0.15
100
true
Sample Description
0.10
100
0
1460.50
0
6.00
E
Exempt New Means of Transport
OTH
Laptop Peripherals
MYS
9800.00.0010
003
17
100
'
Después de registrarte, a cada desarrollador se le asigna una clave de acceso a la API personal, una combinación única de letras y dígitos proporcionada para acceder a nuestro endpoint de la API. Para autenticarte con el Validador de Factura Electrónica MyInvois de Malasia API simplemente incluye tu token de portador en el encabezado de Autorización.
| Encabezado | Descripción |
|---|---|
Autorización
|
Requerido
Debería ser Bearer access_key. Consulta "Tu Clave de Acceso a la API" arriba cuando estés suscrito.
|
Sin compromiso a largo plazo. Mejora, reduce o cancela en cualquier momento. La Prueba Gratuita incluye hasta 50 solicitudes.
(Ahorra 2 meses pagando anualmente 🎉)
Validador de e-facturas MyInvois (LHDN) sin llave de Malasia: XSD oficial de UBL 2.1, listas de códigos, matemáticas de totales, verificación de firma XAdES. Envía XML o JSON y recibe un informe en JSON con código de regla. Sin cuenta LHDN
El endpoint de verificación de salud GET devuelve un objeto JSON simple que indica el estado del servicio mientras que el endpoint POST Validar e-factura devuelve un informe de validación JSON detallado que incluye campos como "válido" "bien formado" "tipo de documento" "conteo de errores" y "hallazgos" con mensajes codificados por reglas específicas
Los campos clave en la respuesta POST Validar la factura electrónica incluyen "válido" (booleano), "bienFormado" (booleano), "tipoDeDocumento" (cadena), "conteoDeErrores" (entero), "conteoDeAdvertencias" (entero) y "hallazgos" (arreglo de resultados de validación detallados)
Los datos devueltos están en formato JSON La estructura incluye un objeto de nivel superior con campos para el estado de validación, recuentos de errores y advertencias, y un arreglo de hallazgos, cada uno conteniendo detalles como "nivel", "reglaId", "texto" y "ubicación"
La verificación de salud GET proporciona el estado del servicio mientras que el POST Validar factura electrónica ofrece resultados de validación exhaustivos que incluyen el cumplimiento con UBL 2.1 XSD campos obligatorios listas de códigos LHDN y verificaciones de firma XAdES
La API admite tanto formatos XML (application/xml) como JSON (application/json) para el endpoint POST Validar e-factura El formato se detecta automáticamente según el cuerpo de la solicitud
Los datos de respuesta están organizados en un objeto JSON con pares clave-valor El campo "hallazgos" contiene un array de objetos cada uno detallando problemas de validación específicos categorizados por severidad (info advertencia error) y IDs de reglas asociadas
Los casos de uso típicos incluyen validar las facturas electrónicas para cumplir con las regulaciones malasias, garantizar el formato y la estructura adecuados y verificar la exactitud matemática en los totales y cálculos de impuestos
Los usuarios pueden analizar los campos "valid" y "wellFormed" para determinar el cumplimiento de la factura La matriz "findings" proporciona insights accionables para corregir problemas mientras que "errorCount" y "warningCount" ayudan a priorizar los ajustes necesarios
No El validador no tiene llaves no hay cuenta LHDN no hay certificado digital no hay token Envías la factura obtienes un informe JSON Nada se envía a LHDN
UBL 2.1 XML (Tipo de contenido: application/xml) y MyInvois JSON (application/json) El formato se detecta automáticamente y se aplican las mismas reglas de LHDN a ambos