mrsool / zatca

An unofficial Ruby library for generating ZATCA e-invoices, QR Codes, and submitting e-invoices to ZATCA's servers.
MIT License
36 stars 12 forks source link

Guidance to check the compliance of invoices - Phase 2 #20

Closed davidfrothin closed 7 months ago

davidfrothin commented 7 months ago

We have the documentation here https://github.com/mrsool/zatca/wiki/Checking-the-Compliance-of-an-Invoice

Please guide me on the optimal solution to pass compliance for invoices. I understand the system needs to send total 6 including standard & simplified. I have managed to generate simulation mode but need help on how to proceed. Any template invoices or samples where i can just change VAT numbers or test information to have this processed.

obahareth commented 7 months ago

Hey @davidfrothin,

I think you're talking about the onboarding process, correct?

The number of cases you need to pass is based on the certificate type you have asked for, if you asked for Simplified only you would need a Simplified invoice, alongside simplified debit and credit notes.

If you generate a certificate for both standard and simplified, you will also need accompanying debit/credit notes for both types. The issue production CSID endpoint should give you exactly what you need and tell you what documents you still need to submit.

You could use the simplified invoice and standard invoice guids as a starting point and tweak it as you need.

I'll see about adding samples for debit and credit notes as well.

davidfrothin commented 7 months ago

@obahareth thanks for your reply.

I have this error so far

{
  "code": "Missing-ComplianceSteps",
  "message": "The compliance certificate is not done with the following compliance steps yet [standard-compliant,standard-credit-note-compliant,standard-debit-note-compliant,simplified-compliant,simplified-credit-note-compliant,simplified-debit-note-compliant]"
}

can you please point me to how i can get all these 6 to pass? Are there templates that I can use? I just need to pass the onboarding to then get to the next step. If there was any file I could run by just setting my binarySecurityToken and secret to then get the onboarding complete so I can generate a production CSID.

obahareth commented 7 months ago

@davidfrothin Try to follow the guide for constructing simplified and standard invoices, then submit them to the compliance endpoint. Let me know if you face any issues.

If all is ok, you should be down to 4 cases left (simplified debit and credit, then standard debit and credit)

There aren't any full samples for debit or credit yet, I will add those. For now you can check ZATCA's own samples to get an idea of what's different about them. There's also a very small guide in the wiki that I will work on expanding.