What does a 401 Unauthorized error from the ZATCA API mean?
Table of Contents
A 401 Unauthorized response indicates an authentication or authorization problem. ZATCA's detailed guidelines specifically instruct taxpayers receiving a 401 response to check the authentication certificate and secret before resubmitting.
This is different from a rejected invoice caused by a business or XML validation error. In a 401 scenario, the invoice has not successfully reached the stage where ZATCA validates the invoice content. The implementation team should therefore first verify the credentials, certificate, endpoint and authentication configuration being used for the relevant environment.
Particular attention should be paid to using the correct credentials for the correct environment, such as simulation versus production, and ensuring that the authentication certificate and secret correspond to the EGS being used.
Key points
- 401 means unauthorized access.
- It generally indicates an authentication or authorization problem.
- Check the authentication certificate and secret.
- Verify that the correct environment and endpoint are being used.
- Confirm that the credentials belong to the relevant EGS.
- A 401 is different from an invoice-content validation rejection.
- Resolve the authentication issue before troubleshooting XML business rules.
Related questions
What is ZATCA e-invoicing?
ZATCA e-invoicing, also known as Fatoorah, is Saudi Arabia's electronic invoicing system introduced ...
What is the difference between ZATCA Phase 1 and Phase 2?
ZATCA e-invoicing is being implemented in two main phases. Phase 1, known as the Generation Phase, b...
What is Wave 25 of ZATCA e-invoicing and who does it cover?
Wave 25 is the latest announced wave of ZATCA's Phase 2 e-invoicing rollout. ZATCA announced the cri...