# 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 %}
