We are facing an issue where the ZATCA API sometimes returns a non-JSON response (HTML or XML) instead of the expected JSON format.
This causes an exception while parsing the response:
Unexpected character encountered while parsing value: <. Path ‘’, line 0, position 0
.
Because of this, our system cannot determine the invoice status — invoices are marked as neither “Cleared” nor “Rejected”.
We log every transaction and store a unique hash for each tax invoice that faced this issue.
We will attach a list of these hashes below and kindly ask you to verify whether these invoices were actually cleared on ZATCA’s side.
This issue occurs during the standard invoice clearance process, using the official Invoice Clearance API endpoint.
We would like to clarify that nothing has changed on our side — we are performing the same clearance steps as usual.
This is the first time we encounter such behavior.
Because the failure was unexpected, we are concerned that some of these invoices might have been cleared on ZATCA’s side, while our system marked them as not cleared due to the parsing error.
We are therefore attaching a sample of the affected invoice hashes and kindly request your team to verify whether these invoices were successfully cleared on your system.
Thank you for your assistance and continued support.