# Unexpected non-JSON response from ZATCA API

**URL:** <https://zatca1.discourse.group/t/unexpected-non-json-response-from-zatca-api/8712>\
**Category:** Clearance and Reporting\
**Created:** [October 18, 2025, 11:37am UTC](https://zatca1.discourse.group/t/unexpected-non-json-response-from-zatca-api/8712 "2025-10-18T11:37:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnuaimi](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@mnuaimi](https://zatca1.discourse.group/u/mnuaimi)\
**Post date:** [October 18, 2025, 11:37am UTC](https://zatca1.discourse.group/t/unexpected-non-json-response-from-zatca-api/8712/1 "2025-10-18T11:37:44Z")

</div>

## Unexpected non-JSON response from ZATCA API

# Description

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.

> hLibkOnjXusDu4EMPy4AQRY5aVfy65MkPevG8XgVfOU=  
> C4eSDWKoxsJ0LsXqCOHtmMx8cwyIir7keMheaGZOZOQ=  
> 1+5cXg1t1eAeu9JXs89hsDgvEH7qxBPjpOZSdRBmh4g=  
> rZ0fUDqk2kOj9fOHyTynFOI/xUoRUk8DGssFrl5a8x0=

---

<div class="post-metadata">

**Author:** ![halrashidy](https://avatars.discourse-cdn.com/v4/letter/h/3bc359/32.png) [@halrashidy](https://zatca1.discourse.group/u/halrashidy)\
**Post date:** [October 19, 2025, 7:30am UTC](https://zatca1.discourse.group/t/unexpected-non-json-response-from-zatca-api/8712/2 "2025-10-19T07:30:57Z")

</div>

Dear @mnuaimi

Thanks for reaching out, Welcome to our community.

To provide comprehensive support as usual, can I kindly ask you to elaborate with the below:

1. What are the exact steps (In details) that you are doing during

2. Which API you are hitting

Thanks,  
.

---

<div class="post-metadata">

**Author:** ![mnuaimi](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@mnuaimi](https://zatca1.discourse.group/u/mnuaimi)\
**Post date:** [October 19, 2025, 12:19pm UTC](https://zatca1.discourse.group/t/unexpected-non-json-response-from-zatca-api/8712/3 "2025-10-19T12:19:09Z")

</div>

@halrashidy

Thank you for your response.

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.
