Issues with ZATCA E-Invoice Java SDK

Hello Developers,

I’m encountering two issues while using the ZATCA E-Invoice Java SDK. I’d appreciate any help or guidance from the community.

Issue 1:

When trying to obtain the CSID using this link:
https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance

I enter the correct OTP generated through the Fatoora platform. The OTP is valid and has not exceeded the one-hour validity period. However, I keep getting the following error:

csharp

Copy code

The provided OTP is invalid  

My question: Am I missing a step, or is there something wrong in the process or configuration?

Issue 2:

In Sandbox mode, any number seems to work as an OTP, and the process proceeds. However, when trying to send an invoice, the following error appears:

vbnet

Copy code

2024-12-04 02:24:02,168 [ERROR] InvoiceSigningService - failed to sign invoice [certificate file is not found]  
  • The certificate has been created correctly, and its path is properly set in the configuration.
  • Despite this, the error persists when attempting to send the invoice.

Questions:

  1. How can I resolve the The provided OTP is invalid error when using the simulation compliance link above?
  2. Why does the certificate file is not found error occur in Sandbox mode even though the certificate is configured properly?

Thank you in advance for any support or suggestions!

Dear @working123,

Thank you for reaching out.

1. How can I resolve the “The provided OTP is invalid” error when using the simulation compliance link?
To resolve this issue, ensure that you generate the OTP from the Fatoora Simulation Portal instead of the Fatoora Portal.

2. Why does the “certificate file is not found” error occur in Sandbox mode even though the certificate is configured properly?
The Sandbox environment is solely for testing and uses a static certificate and private key to clarify the onboarding process and validate the steps. It does not support dynamic certificate configurations or real integration with ZATCA.

For a successful integration with ZATCA, you can rather use the Simulation or Production portal environment, as these environments allow for the proper use of certificates and private keys for invoice signing.

If you require further clarification, please feel free to reach out to us.

Best regards,
Lina

1 Like