QRCODE_VALIDATION warning in B2C

When reporting B2C Invoice the invoice is accepting with warning and we use latest sdk this issue only in B2c

“type”: “ERROR”,
“code”: “invoiceTimeStamp_QRCODE_INVALID”,
“category”: “QRCODE_VALIDATION”,
“message”: “Invoice issued timestamp does not match the one on the qr code”,
“status”: “ERROR”

1 Like

The time in QR Code should match the Invoice Issue Time (KSA-25), and If the time in XML in UTC (with Suffix Z), the time in QR should be in local time format after adding +3 hours (and without adding the suffix Z). this is already implemented in the SDK.

This error is related to B2C only as in B2B invoices, you don’t need to sign and add a QR code before submitting it.

Hi @Sherif.Abaza

In B2B how can I submit to zatca if sign don’t need. In the request it’s required invoice hashing

You can generate hash for the invoice using ZATCA SDK with the command:
fatoora -generateHash -invoice [invoicename.xml]

The hash will be computed using the following method:

  1. Remove the ext:UBLExtensions/ block.
  2. Remove the cac:AdditionalDocumentReference/ block where cbc:ID/ = QR.
  3. Remove the cac:Signature/ block .
  4. Canonicalize the Invoice using the C14N11 standard.
  5. Hash the resulting string using SHA256 to a binary object.
  6. Base64 encode the binary object to generate the digest value.