Technical Guidelines
We can consider the ID in the XML and JSON input as primary key (cbc:ID in XML and invoice_id in JSON). eg if an invoice is passed with id "1" then we sign and submit the invoice. If the reporting status is successful then we update our database and archive the invoice. If another invoice is passed with id "1" again. Then we return the reponse of the earlier API and do not report the invoice again to ZATCA.
Taking the above scenario further, if invoice id "1" is rejected by ZATCA. Then the API caller can fix the errors and pass the invoice with the same id again. In this scenario we resubmit the invoice to ZATCA with a new counter and QR code. This process can repeated until the invoice is succesfully reported to ZATCA.
Documents when sent to the API get added to a processing queue this processing queue pick up documents in batches, modifies the documents with the necessary entries and then send the invoice to ZATCA. Post send the invoice is archived within our system and if the callback is registered for sender VAT then you will be receiving a response
Incase there are any failures during worker processing flow the document process will restarted from the last point of failure. Doc restarts happen every 30 minutes, so please keep in mind in certain scenarios you would be receving documents at least 30 minutes later
Our best case processing time is around 2 seconds
Einvoice once generated is either send to the callback URL which would be registered for a given taxpayer (details of the response can be found here) or they can be periodically queried by the taxpayer via the Get Invoice Process Status API.
Last updated