Case
Case
This cli is a Java based tool that utilizes ZATCA’s SDK jar to perform several tasks. Basically, you
can use it to validate different e-invoice documents including Standard Invoice, Standard Debit
Note, Standard Credit Note, Simplified Invoice, Simplified Debit Note, and Simplified Credit
Note. Once validation has run, the tool will display the validation results. This can be a PASS if all
validations have passed, otherwise a NOT PASS message is displayed along with a list of errors
indicating what has happened. Moreover, this tool allows signing invoices, generating invoice
hash, generating api requests, generating certificate signing requests (CSR), and generating QR
code .
2 [-pem] A flag used to generate csr and private key in pem format.
11 [-apiRequest fileName] The name of the invoice json request output file
13 [-generateHash] A flag used to generate new hash for the provided invoice.
14 [-nonprod] A flag pointing to use the csr and private key on a non
production server.
/Data/Input/csr-config-template.properties/csr-config-example.properties
Once done you can generate a csr using the config properties file by providing it as an
option to the -csrConfig argument. Please see Arguments and Options below.
Arguments and Options:
Notes:
1. If the user does not provide [-privateKey] argument then the private key file will be
generated in the path of a running command prompt with file convention name
pattern generated-private-key-yyyyMMddhhmmss.key
2. If the user does not provide [-generatedCsr] argument then the csr file will be
generated in the path of a running command prompt with file convention name
pattern generated-csr-yyyyMMddhhmmss.csr
3. If the user does not provide [-pem] argument then the csr file will be generated
encoded base64 and private key file will be generated without header "-----BEGIN EC
PRIVATE KEY-----" and footer "-----END EC PRIVATE KEY-----"
● Signing and Generating Invoice Hash:
Prerequisite:
Please refer back to the prerequisites section of generating a CSR above.
Notes:
1. If the user does not provide [-signedInvoice] argument then the signed invoice file
will be generated in the path of a running command prompt with file convention
name pattern <same input file name>_signed.xml
● Generating JSON API Request:
Prerequisite:
None
Notes:
1. If the user does not provide [-apiRequest] argument then the invoice request file will
be generated in the path of a running command prompt with file convention name
pattern generated-json-request-yyyyMMddhhmmss.json
● Generating QR Code:
Prerequisite:
None.
3. Once done, now you can sign your xml invoice using your private key and matching
it on validation with the zatca certificate.
● Technical FAQs: