# FAQ

#### When Can an Invoice Be Considered Accepted?

You can check if an invoice is accepted by using `stackcueHelper->isZatcaAccepted` in the response. Additionally, you can consider the `stackcueHelper->zatcaResponseCode`. If the response code is `200` or `202`, it indicates that ZATCA has accepted the invoice.

**How invoiceCounterValue  works while managing multiple devices?**\
The `invoiceCounterValue` starts at 0 with a new `stackcueProductionIdentifier`. Each machine, upon receiving its `stackcueProductionIdentifier`, will independently increment its `invoiceCounterValue` with every new document (invoice, credit note, debit note) issued. Therefore, if two machines each receive a `stackcueProductionIdentifier`, their `invoiceCounterValue` will each start at 1

{% hint style="warning" %}
If ZATCA rejected invoice/documents, still you need to increment the **invoiceCounterValue** for next invoice or associated notes submission
{% endhint %}

**If an item returned after purchase should i make a debit note in our system against the supplier credit note?**\
When returning an item after purchase, your supplier should issue a credit note and submit it to ZATCA if they are based within the kingdom. You should only create credit or debit notes agains your invoice.

**Is PIHvalue in invoice maintains unique across all devices?**\
The PIHvalue is determined by the `stackcueProductionIdentifier`, not devices. Whenever a new document is issued through a `stackcueProductionIdentifier`, you must record the its hash. This hash will be used as PIHvalue in next document payload (for same `stackcueProductionIdentifier`)

{% hint style="warning" %}
If ZATCA rejected invoice/documents, still you need to keep the **hash** value of rejected document to use as PIH value in next submission with same **stackcueProductionIdentifier**
{% endhint %}


---

# 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://zatca-api-documentation.stackcue.com/additional-informations/faq.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.
