Completed Compliance Invoice But Getting On Production CSID

i am using sandbox account of zatca and using API Integration Sandbox, I have completed Compliance invoice API , but when i am using production Reporting API i am getting error , Please check if i am following the correct steps for production onboarding.

  1. I used ’ Production CSID ( Onboarding ) API. Click Here to see image

  2. I used ‘Reporting API’ : click here to see error i am getting


NOTE : I skipped the step ‘PRODUCTION CSID ( REVEWAL API )’

Dear @UnitedDev

Thanks for reaching out,

Kindly not that the sandbox has a static certificate and you can not successfully integrate with ZATCA using it, please find the below detailed onboarding process using our SDK tool JAVA, our recommendation is to start in simulation environment after reviewing carefully the detailed technical docs shared on ZATCA site, to ensure full understanding for all ZATCA regulations before starting with integration.

The following links are some documentation that might help you.

  1. XML Standard and 1. Data Dictionary: Technical requirements & Specifications
  2. API Integration Sandbox: Zatca
  3. Web based validator: Zatca
  4. Developer Community: https://zatca1.discourse.group/
  5. E-invoicing Detailed Technical Guidelines: https://zatca.gov.sa/en/E-Invoicing/Introduction/Guidelines/Documents/E-invoicing-Detailed-Technical-Guideline.pdf

You can find below the steps for the onboarding process using Java SDK:

  1. Prepare your config file with the required info

  2. Use “fatoora -CSR -csrConfig –[config file path]” command to generate CSR file

  3. A CSR file will be generated

  4. Generate the OTP from Fatoora portal or simulation portal based on the purpose of either testing or production.

  5. Use the CSR in the body of the request using one of the below endpoints to send the request for generating the CCSID (Use the OTP in the Headers of the request):

    a. For the simulation environment use this API URL: 
    https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance
    b. For the production environment, use this API URL: 
    https://gw-fatoora.zatca.gov.sa/e-invoicing/core/compliance
    
  6. The response will include the BinarySecurityToken and Secret, you will use those as Authentication in the compliance checks. Moreover, the response will include request_ID which will be used in the body for generating PCSID API in a later step.

  7. You need to start the compliance check.

  8. In order to complete the compliance check you need to prepare your invoices. Please note that this is based on the invoice type in your configuration file if it’s 0100 that’s mean you will only send a simplified invoice, if it’s 1000 only for standard invoices and if it is 1100 you will send both standard and simplified.

  9. For standard invoices

    a. use “fatoora -generateHash -invoice [invoice path]” command to generate the hash
    b. replace the generated hash in the “Digestvalue” tag in the XML
    c. generate the JSON file for the invoice using “fatoora -invoiceRequest -invoice [invoice path]” command
    
  10. For simplified invoices

    a. make sure to change the SDK\Data\Certificates\cert.pem with the decoded CCSID
    b. sign the invoice using “fatoora -sign -invoce [invoice path] command
    c. generate the JSON file for the signed invoice using “fatoora -invoiceRequest -invoice [invoice path]”
    
  11. After you prepared your invoices, you need to send the encoded invoices (JSON file) to one of the following APIs:

    a. For compliance checks in the Production Environment, use this API URL. https://gw-fatoora.zatca.gov.sa/e-invoicing/core/compliance/invoices
    b. For compliance checks in the Simulation Environment, use this API URL https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance/invoices
    
  12. In order to generate the PCSID, take the “Request ID” you got from the CCSID response (on step 6 above)and replace it in the body of the request.

  13. Make sure to send an invoice, credit note, and debit note to the compliance check, to avoid “Missing Compliance Steps”

  14. Now you need to generate the PCSID using one of the following APIs in the body use the request_ID and in authentications use the BinarySecurityToken as user name, secret as password:

    a. For Simulation Environment: https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/production/csids
    b. For Production Environment: https://gw-fatoora.zatca.gov.sa/e-invoicing/core/production/csids
    

Additionally, note that the only different if you are using .Net will be in the command, the main functionality will stay the same, for any further concerns do not hesitate to reach out your RM to reach with our support team via below mail.

SP mail: sp_support@zatca.gov.sa

Thanks,
Ibrahem Daoud.

Hi,
Please check this video to having understanding of different instances and their end points,

thank you for reply , i am using PHP so java SDK is not my field , i will check the documents and i will find more details about it

For Sandbox Environment, make sure you use default Vat Number 399999999900003 for Generating CSR and Invoice Xml inside Tag <cac: AccountingSupplyerParty>.

1 Like