PIH Handling for First Invoices Across Multiple Devices
Message
PIH of the first invoice to be sent should be “ZERO value encoded to base64”, this sequence is associated with each device/PCISID onboarded, so in this scenario where there are 2 registered devices with 2 unique PCSIDs, each device should maintain it’s own unique sequence of the unique identifiers such as ICV, PIH. so the invoice 3 (which is the first invoice to be sent from the new device) will be counted as an invoice(1), and its first invoice’s PIH should be “ZERO” decoded to base64.
Solution:
The Previous Invoice Hash (PIH) is a critical component for managing unique identifiers and maintaining the sequence of invoices generated by devices registered under different unique PCISIDs. It forms a secure chain by linking each invoice to the previous one, ensuring continuity and preventing unauthorized changes or tampering in the invoice sequence.
PIH not only helps in maintaining integrity but also plays a vital role in verifying the authenticity of invoice data. By referencing the previous invoice, it creates a robust system for tracking and validation. This is particularly important in environments that require strict compliance with regulatory frameworks.
For the first invoice generated by any device, there is no previous invoice to reference. In this scenario, the PIH must be set to a default zero value, representing an empty hash. To meet ZATCA's system requirements, this zero value must be encoded to Base64 format, as the system only accepts PIH values in Base64 encoding. This ensures smooth processing and compliance with invoicing regulations.