I generated a CSR what now?

Dear @charbelsarkis123

Thank you for reaching out, and welcome to our community.

Our recommendation is:

  1. Access Fatoora portal and log in using your tin number.
  2. Use Simulation Enviromint before production, from simulation portal start using the APIs as their order.
  3. Generate the OTP from simulation portal.
  4. Use the CSR in the body of the request using the below endpoint to send the request for generating the CCSID (Use the OTP in the Headers of the request):
    For the simulation environment use this API URL: https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance
  5. 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.
  6. You need to start the compliance check, 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.
  7. For standard invoices:
    1.use fatooranet generatehash -invoice “invoicebath” command to generate the hash
    2.generate the JSON file for the invoice using fatooranet invoiceRequest -invoice “invoicebath” command
  8. For simplified invoices:
    1.make sure to change the SDK\Data\Certificates\cert.pem with the decoded CCSID
    2.sign the invoice using fatooranet sign -invoice “invoicebath” command
    3.generate the JSON file for the signed invoice using fatooranet invoiceRequest -invoice “invoicebath” command
  9. After you prepared your invoices, you need to send the encoded invoices (JSON file) to the the following API:
    For compliance checks in the Simulation Environment, use this API URL https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance/invoices
  10. In order to generate the PCSID, take the “Request ID” you got from the CCSID response (on step 5 above)and replace it in the body of the request.
  11. Make sure to send an invoice, credit note, and debit note to the compliance check, to avoid “Missing Compliance Steps”
  12. Now you need to generate the PCSID using the following API in the body use the request_ID and in authentications use the BinarySecurityToken as user name, secret as password:
    For Simulation Environment: https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/production/csids
  13. For standard invoice https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/invoices/clearance/single and in the Auth make sure to use the BinarySecurityToken and secret as password from step 12, in the body you will send the UUID and the Invoice Hash and the Encoded invoice body (JSON file) that we generated using the command fatooranet invoiceRequest -invoice invoicename.xml
  14. For simplified invoice https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/invoices/reporting/single In the Auth make sure to use the BinarySecurityToken and secret as password from step 12, in the body you will send the UUID and the Invoice Hash and the Encoded signed invoice body (JSON file) that we generated using the command fatooranet invoiceRequest -invoice singedinvoicename.xml

If you have any concerns regarding the onboarding process, please don’t hesitate to reach out with our support team via email:

SP email: sp_support@zatca.gov.sa

Thanks,

3 Likes