How to create certificate

Hi,

I’ve downloaded the Fatoora .NET SDK and successfully generated a CSR using the following command:

fatooranet csr -csrConfig csr-config-example-EN.properties -pem True -sim True

This worked fine and generated the CSR and private key in .pem format. I also used:

fatooranet qr -invoice testinvoice.xml

This command also worked successfully.

However, when I try to sign the invoice using:

fatooranet sign -invoice testinvoice.xml -certificate generated-csr-20250620142703.csr -privateKey generated-private-key-20250620142703.key

I get the following error:

Operation Failed
Step: [Parse Certificate] [Failed]
Errors: [Error] Parsing EInvoice Certificate
Step: [Populate Signed Signature Properties] [Failed]
Errors: [Error] Populating Signed Signature Properties
Step: [Generate EInvoice QR] [Failed]
Errors: [Error] Generating EInvoice QR Code

Can you please guide me on what I might be doing wrong at this step?

Looking forward to your support.

Dear @chkjamil,

To sign the invoice, parsing both of the x.509 certificate and the private key is necessary, to obtain the certificate, you should send the generated CSR alongside with the OTP that should be generated from Fatoora portal to the compliance CSID API, after that your solution should perform the compliance checks, after that you will be able to obtain the production CSID.

the compliance CSID is being used to send & sign the invoices and associated notes for the compliance checks phase, while the production CSID is being used to sign and send the invoices to reporting and clearance API.

However, you need an access to fatoora portal with TIN credentials to obtain the OTP to start testing the onboarding process in simulation environment, if you don’t, then you can use the default certificate located inside the SDK folder in the following path: SDK/data/certificates, also, you can test the APIs in sandbox environment which doesn’t require a fatoora portal access.

Regards,

1 Like