# 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.
* Both XSL and XSD validation are done for the invoice prior to sending the request to ZATCA
* Standard Documents if onboarded, will be processed in real time (as mandated by ZATCA)
* Simplified Documents will be signed and returned back to the caller. Within 24hr window a sync job will be triggered to report the invoice to ZATCA
* Invoices which are rejected from ZATCA will be visible in the utility dashboard and will be available to user to modify and update
* We keep the records of invoices which have been reported successfully for **7** days. Post that any invoices with an id which was used earlier will be treated as a new invoice again. Our cloud service will return the saved response for the ID. This is done to save space within the device the utility is installed in


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://masters-india-1.gitbook.io/ksa-apis-offline/generate-einvoice-api/technical-guidelines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
