# Invoice Signing

**URL:** <https://zatca1.discourse.group/t/invoice-signing/2820>\
**Category:** SDK, web-based validator and sandbox\
**Created:** [September 5, 2024, 11:44am UTC](https://zatca1.discourse.group/t/invoice-signing/2820 "2024-09-05T11:44:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![itujar\_it](https://avatars.discourse-cdn.com/v4/letter/i/3be4f8/32.png) [@itujar\_it](https://zatca1.discourse.group/u/itujar_it)\
**Post date:** [September 5, 2024, 11:44am UTC](https://zatca1.discourse.group/t/invoice-signing/2820/1 "2024-09-05T11:44:01Z")

</div>

How to sign a invoice by providing certificate and private key seperately. What is the command to sign a invoice using a particular certificate?

---

<div class="post-metadata">

**Author:** ![lalomar](https://avatars.discourse-cdn.com/v4/letter/l/5e9695/32.png) [@lalomar](https://zatca1.discourse.group/u/lalomar)\
**Post date:** [September 5, 2024, 1:12pm UTC](https://zatca1.discourse.group/t/invoice-signing/2820/2 "2024-09-05T13:12:02Z")

</div>

Hi @itujar_it ,

Thank you for reaching out, to sign an invoice using Java SDK please use the following command _ **fatoora -sign -invoice “invoice path” -certificate “Certificate path” -privateKey “private key path”** _

---

<div class="post-metadata">

**Author:** ![itujar\_it](https://avatars.discourse-cdn.com/v4/letter/i/3be4f8/32.png) [@itujar\_it](https://zatca1.discourse.group/u/itujar_it)\
**Post date:** [September 5, 2024, 1:34pm UTC](https://zatca1.discourse.group/t/invoice-signing/2820/3 "2024-09-05T13:34:05Z")

</div>

Hi @lalomar  
Thank you for your response. Can I use amazon s3 links for the certificate path, invoice path and private key path?

---

<div class="post-metadata">

**Author:** ![itujar\_it](https://avatars.discourse-cdn.com/v4/letter/i/3be4f8/32.png) [@itujar\_it](https://zatca1.discourse.group/u/itujar_it)\
**Post date:** [September 7, 2024, 4:35am UTC](https://zatca1.discourse.group/t/invoice-signing/2820/4 "2024-09-07T04:35:27Z")

</div>

Hi @lalomar ,  
This command is not working as expected. The command by default takes the certificate stored in /Certificates/cert.pem. Using -certificate “Certificate path” is of no use.

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [September 7, 2024, 7:15am UTC](https://zatca1.discourse.group/t/invoice-signing/2820/5 "2024-09-07T07:15:44Z")

</div>

@itujar_it  
Maybe you can get idea from this discussion

> [@Error when trying to get the compliance ID for sandbox enviroment through command prompt](https://zatca1.discourse.group/t/error-when-trying-to-get-the-compliance-id-for-sandbox-enviroment-through-command-prompt/2378/2):
>
> Dear @Hadi I see you missed a lot of things in the code you provided. You forgot the OTP part, API url and it looks like your CSR is not in the recommended format. You also didn’t mention what error you are getting. You can try this code to get CCSID from Sandbox. curl -X POST ^ -H "Content-Type: application/json" ^ -H "Accept: application/json" ^ -H "Accept-Language: en" ^ -H "OTP: 12345" ^ -H "Accept-Version: V2" ^ -d "{\"csr\":\"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0NCk1JSUNkakNDQ…

You can get how to generate Csr, Privatekey, Certificate and how to Signing Document from this thread.
