I hope you’re well. I’m developing a MERN-based e-invoicing application and have followed the UBL 2.1 + XAdES-EPES guidelines from your documentation. My generated XML matches your simplified sample, but when I test it at the sandbox endpoint, I receive the following errors:
- Errors from TestXML endpoint
- Simulation API (“/invoices/report”) response :
{
“error”: “ZATCA 400 {"validationResults":{” +
“"infoMessages":[{” +
“"type":"INFO",” +
“"code":"XSD_ZATCA_VALID",” +
“"category":"XSD validation",” +
“"message":"Complied with UBL 2.1 standards in line with ZATCA specifications",” +
“"status":"PASS"}],” +
“"warningMessages":,” +
“"errorMessages":[{” +
“"type":"ERROR",” +
“"code":"invalid-invoice-hash",” +
“"category":"INVOICE_HASHING_ERRORS",” +
“"message":"The invoice hash API body does not match the (calculated) Hash of the XML",” +
“"status":"ERROR"},{” +
“"type":"ERROR",” +
“"code":"certificate-hashing",” +
“"category":"CERTIFICATE_ERRORS",” +
“"message":"Invalid certificate hashing",” +
“"status":"ERROR"},{” +
“"type":"ERROR",” +
“"code":"signed-properties-hashing",” +
“"category":"CERTIFICATE_ERRORS",” +
“"message":"Invalid signed properties hashing, SignedProperties with id=‘xadesSignedProperties’",” +
“"status":"ERROR"}],” +
“"status":"ERROR"},” +
“"reportingStatus":"NOT_REPORTED"}”
}
Could you please help identify the root cause of these signature and hashing mismatches and advise on how to correct them? Any reference code or detailed steps—particularly around XML canonicalization, digest calculations, certificate fields, and QR hash generation in Node.js—would be extremely helpful.
Thank you for your support.