Issue in send invoice to zatca

I have problem when I send invoice to zatca it return this error
[409]Server returned an unexpected error: {“validationResults”:{“infoMessages”:,“warningMessages”:,“errorMessages”:[{“type”:“ERROR”,“code”:“Invoice-Errors”,“category”:“Duplicate-Invoice”,“message”:“Invoice was already Reported successfully earlier.”,“status”:“ERROR”}],“status”:“ERROR”},“reportingStatus”:“NOT_REPORTED”}

I know that this mean that is Duplicate-Invoice
in my system there is no Duplicate
How can I check if this invoice is sent to zatca before?
This is very urgent because I cannot send invoices created after this invoice.

Dear @omar.moh first of all you need to de-couple the logic of generation of invoices from the status of previous invoice. You should not stop generating e-invoices even if preceding invoice is rejected by ZATCA. If I am not wrong, you might be considering “Previous Invoice Hash” only from successful submissions. This logic must be changed, PIH and Invoice Counter Value does not depend on the status of invoice (whether accepted or rejected).

Regarding the error 409, as the response suggests, the invoice is successfully reported. You must stop retrying the same payload as ZATCA has already received this invoice successfully.

Please look at this thread Understanding of PIH and ICV - #2 by Ankit.K.Tiwari