401 Unauthorized When sending Compliance Check

After sign the invoice and send it to this end point

https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance/invoices

it return a response of 401 Unauthorized

if I skiped the check the invoice reported successfully

the problem appeared after 25/8/2025 sdk 3.4.4

Dear @Mtsam

Thanks for reaching out, Welcome to our community.

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

  1. What is the date for issuing your CCSID?
  2. Did you successfully generated your PCSID?
  3. Are you sending your actual invoices to compliance/invoices API before sharing them directly to reporting/clearance APIs?

Thanks,
Ibrahem Daoud.

I am also getting 401 . after successfully generating the csid
hitting below api
https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance/invoices
or the production csids
https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/production/csids
I am getting 401
help me fix the issue. i am using laravel php

i am also facing the same issue, same stack also

1-27/8/2025

2- yes

3- yes and when i skiped the compliance ckeck , every thing works fine

Dear @asif @enkeconsulting @Mtsam

Thanks for reaching out,

Kindly be informed that after 24 of generating your CCSID, it will be revoked, The Only Use For the Compliance Check API is to ensure the compliance and you can’t use the compliance check API to validate your actual invoices after being onboarded successfully and received your PCSID

You can use ZATCA SDK to validate your invoices before sharing them through APIs.

Please find ZATCA SDK link ensure that you are installing the latest SDK version, Zatca

Thanks,
Ibrahem Daoud.

i am not able to onboard. after creating csid when i am hitting production/csids it is giving me 401. also on sandbox protal i am getting 401 after executing the api. Please check and let me know the steps to onboard successfully

Morning @asif

Thanks for reaching out,

To provide comprehensive support as usual, can I kindly ask you to mention the exact steps you followed to generate CCSID and what is the exact payload (body, header, and authorization ) when hitting /simulation/compliance/invoices API?

Thanks,
Ibrahem Daoud.

Dear Asif,

Please try to complete the compliance Checks faster after the generating CSID using first OTP
https://gw-fatoora.zatca.gov.sa/e-invoicing/core/compliance
API

We have observed that if we delay the compliance check process and consume time it returns error for last API

if you get the error please re genrate the OTP and again start complaince Check with New CSID and secret

Dear MalikRawabi986077683,

Thank you for the update and the detailed observation.
Could you please share more information on the technical reason behind this error? I’d like to understand what causes the issue when the compliance check is delayed and why regenerating the OTP and CSID resolves it.

This will help us ensure the process is optimized and prevent similar errors in the future.