Closed sudo-sand closed 1 year ago
I have pretty much the same example as you. When I run
checkInvoiceCompliance
orreportInvoice
I getRequest failed with status code 400
.
The 400 Failure with reportInvoice
is expected. ZATCA's sandbox report API is not fully ready yet. Currently they're returning a constant production cert that does not have the ability to sign Simplified Tax Invoices. Hopefully they fix that soon.
One more question, do I store PIH in a DB or how do you get it?
Yes, you will have to store the last invoice hash as a PIH somewhere whenever you create an invoice.
So, with the first phase, I have to store the xml invoices correct?
So, with the first phase, I have to store the xml invoices correct?
ZATCA's first phase does not require you to store any XMLs. But yes, for the second phase you will need to store the invoices as a custom object and then generate an XML every time. Or just store the signed XML for each invoice.
Sorry for bothering you, in the first phase, what format does the invoice take?
Sorry for bothering you, in the first phase, what format does the invoice take?
This package is intended for phase 2. Try something like @mrsool/zatca for phase 1. Also read ZATCA Specs
Thanks @wes4m for your help!
I have pretty much the same example as you. When I runcheckInvoiceCompliance
orreportInvoice
I getRequest failed with status code 400
.One more question, do I store PIH in a DB or how do you get it?