- On the invoice page in the ERP, the user would see a new Report to ZATCA button.
- When the user clicks Report to ZATCA, your implementation calls our Clear Invoice API endpoint.
- The Clear Invoice endpoint reports the invoice to ZATCA synchronously and returns the signed QR code, or returns validation errors.
- Your implementation shows a Successfully reported status to the user if reported successfully, or displays the validation errors so the user can correct the invoice. If successfully reported, save the
idreturned by the endpoint in your database. You can use thisidlater to retrieve the invoice — for example, if you need to download it or send it to the customer. - (Optional) Offer the user a button to download the invoice PDF. Your implementation would call the Invoice PDF endpoint to download the PDF.
- (Optional) Offer the user a button to send the invoice to the customer by email, using your own email delivery system with the downloaded PDF attached.
The same pattern applies to Credit Notes and Debit Notes — swap the endpoint for Clear Credit Note or Clear Debit Note accordingly.

