Announcing the launch of the Saudi Zatca-2 E-Invoicing app on FrappeCloud

bench migrate and restart . looks like fields not updated .

Ok did the migrate & restart:

Still getting the error:

check you CR number is part of VAT group.

check you CR number is part of VAT group. and the same CRN entered as in the screenshot above.

I didn’t really get what you meant by this.

But I want to clarify around this point that, I’m trying to test the zatca settings with environment selected as sandbox, is it because of that, that it’s throwing such errors?

And the reason for it is because for every API call from CSR, CSID and Clearance we need to use the exact company details, customer details and the invoice details to get the success messages? And since I don’t have any of those in my erpnext the sandbox would keep throwing these errors? i.e. I need to send the exact invoice that’s in the sandbox portal to the API’s and only then it’ll send me the success message?

And the error it’s throwing to me to use the VAT that’s in the certificate is it that because for the sandbox environment it’s just hardcoded for those exact invoice, etc. details and since I’ve provided different values than in the sandbox portal it’s thowing that error?

Is my above understanding, correct?

For sandbox, use this CSR , use any CRN on company and Customer for testing. it should work.

csr.common.name=TST-886431145-399999999900003
csr.serial.number=1-TST|2-TST|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e874f
csr.organization.identifier=399999999900003
csr.organization.unit.name=399999999900003
csr.organization.name=Test Company LTD
csr.country.name=SA
csr.invoice.type=1100
csr.location.address=RIYADH
csr.industry.business.category=Testing zatca

Hello,

I am facing this issue. currently my setup is in SIMULATION.

ERPNext: v15.48.4 (version-15)
Frappe Framework: v15.52.0 (version-15)
Zatca Erpgulf: v2.0.1 (main)

This while is I do compliance check of Invoices.

{"validationResults":{"infoMessages":[{"type":"INFO","code":"XSD_ZATCA_VALID","category":"XSD validation","message":"Complied with UBL 2.1 standards in line with ZATCA specifications","status":"PASS"}],"warningMessages":[{"type":"WARNING","code":"BR-KSA-63","category":"KSA","message":"If the buyer country code (BT-55) is “SA”, then these fields are mandatory: street name (BT-50), building number (KSA-18), postal code (BT-53), city (BT-52), District (KSA-4), country code (BT-55). For more information please access this link: https://splonline.com.sa/en/national-address-1/","status":"WARNING"}],"errorMessages":[],"status":"WARNING"},"reportingStatus":null,"clearanceStatus":"CLEARED","qrSellertStatus":null,"qrBuyertStatus":null}
ERROR in clearance invoice, ZATCA validation: {"validationResults":{"infoMessages":[{"type":"INFO","code":"XSD_ZATCA_VALID","category":"XSD validation","message":"Complied with UBL 2.1 standards in line with ZATCA specifications","status":"PASS"}],"warningMessages":[{"type":"WARNING","code":"BR-KSA-63","category":"KSA","message":"If the buyer country code (BT-55) is “SA”, then these fields are mandatory: street name (BT-50), building number (KSA-18), postal code (BT-53), city (BT-52), District (KSA-4), country code (BT-55). For more information please access this link: https://splonline.com.sa/en/national-address-1/","status":"WARNING"}],"errorMessages":[],"status":"WARNING"},"reportingStatus":null,"clearanceStatus":"CLEARED","qrSellertStatus":null,"qrBuyertStatus":null}
Error in Zatca invoice call: ERROR in clearance invoice, ZATCA validation: {"validationResults":{"infoMessages":[{"type":"INFO","code":"XSD_ZATCA_VALID","category":"XSD validation","message":"Complied with UBL 2.1 standards in line with ZATCA specifications","status":"PASS"}],"warningMessages":[{"type":"WARNING","code":"BR-KSA-63","category":"KSA","message":"If the buyer country code (BT-55) is “SA”, then these fields are mandatory: street name (BT-50), building number (KSA-18), postal code (BT-53), city (BT-52), District (KSA-4), country code (BT-55). For more information please access this link: https://splonline.com.sa/en/national-address-1/","status":"WARNING"}],"errorMessages":[],"status":"WARNING"},"reportingStatus":null,"clearanceStatus":"CLEARED","qrSellertStatus":null,"qrBuyertStatus":null}

Any idea?

this issue explained in this forum already . Buyer needs proper address for standard invoices .
street name (BT-50), building number (KSA-18), postal code (BT-53), city (BT-52), District (KSA-4), country code (BT-55)

Thank you for your response. The error occurs not only for standard invoices but also for simplified invoices. I have already ensured that the address lines 1 and 2 are correctly entered as previously mentioned, but I’m still unsure where the issue lies. Do you have any screenshots that clearly indicate what needs to be entered in the mandatory fields?

Once the address for the buyer is added, it should be confirmed as the Customer’s Primary Address in the next step.

Now there is another message comes as below; does it mean I have to switch now to production to get qr-code

{"validationResults":{"infoMessages":[{"type":"INFO","code":"XSD_ZATCA_VALID","category":"XSD validation","message":"Complied with UBL 2.1 standards in line with ZATCA specifications","status":"PASS"}],"warningMessages":[],"errorMessages":[],"status":"PASS"},"reportingStatus":null,"clearanceStatus":"CLEARED","qrSellertStatus":null,"qrBuyertStatus":null}
ERROR in clearance invoice, ZATCA validation: {"validationResults":{"infoMessages":[{"type":"INFO","code":"XSD_ZATCA_VALID","category":"XSD validation","message":"Complied with UBL 2.1 standards in line with ZATCA specifications","status":"PASS"}],"warningMessages":[],"errorMessages":[],"status":"PASS"},"reportingStatus":null,"clearanceStatus":"CLEARED","qrSellertStatus":null,"qrBuyertStatus":null}
Error in Zatca invoice call: ERROR in clearance invoice, ZATCA validation: {"validationResults":{"infoMessages":[{"type":"INFO","code":"XSD_ZATCA_VALID","category":"XSD validation","message":"Complied with UBL 2.1 standards in line with ZATCA specifications","status":"PASS"}],"warningMessages":[],"errorMessages":[],"status":"PASS"},"reportingStatus":null,"clearanceStatus":"CLEARED","qrSellertStatus":null,"qrBuyertStatus":null}

Perfect. No error and no warning in this message .
“status”:“PASS”
“clearanceStatus”:“CLEARED”

thank you for the response.

I have completed the validation check for all types of invoices. Now, I am encountering the following error while generating the final CSIDs.

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

Thanks, this worked!

Can you just guide me on how you got this csr data btw ?

Missing-ComplianceSteps - means you didnt finish all compliance tests.
You need to select each one and do test .

Select one by one from above and do compliance tests. We have a video on yuotube on this . here

thank you for your response. I successfully integrated with Fatoora for my company. However, integrating for another company (same Tax ID, different CR number) on the same server is failing. I’m encountering the following error

Error: OTP is not valid. {"errors":[{"code":"Invalid-OTP","message":"The provided OTP is invalid"}]}
Error in creating CSID: Error: OTP is not valid. {"errors":[{"code":"Invalid-OTP","message":"The provided OTP is invalid"}]}

Currently i am trying to onborad on production , as i sucssfully onboarded on sandbox.
However when i reach to the invoice compliance check i get this errors :


What is the mistake here, note that the vat number is correct and CSR Configuration :

csr.common.name=TST-886431145-30///63700003
csr.serial.number=1-TST|2-TST|3-9ee27812-a2f5-a88d-58e8-3e35399c csr.organization.identifier=30///63700003
csr.organization.unit.name=30////63700003
csr.organization.name=مؤسسة ------لتجارية
csr.country.name=SA csr.invoice.type=1100
csr.location.address=حفر الباطن
csr.industry.business.category=retail

this error in production and simulation as well, Please help as it is getting urgent .

Thanks in advance

If 11th digit of VAT number is 1 , then its a group-VAT , other wise single.
** if 11th digit of above vat-id is 1 then csr.organization.unit.name should be 10 digit TIN )**

Also, if there is multiple CRN on same VAT , try to change this to OTH on invoice.

in my situation, it seems single organization becasue the 11 th digit is not 1 , however there are multiple entities under same VAT.
i have the 700 number , can i use it in Zatca - Registration Number ?

These are legal things you need to clarify with an auditor or zatca-account-manager. Here we answer technical queries only .

Thank you for your answer, But i just wanted to understand what the error message means

Error from ZATCA API: {“validationResults”:{“infoMessages”:[{“type”:“INFO”,“code”:“XSD_ZATCA_VALID”,“category”:“XSD validation”,“message”:“Complied with UBL 2.1 standards in line with ZATCA specifications”,“status”:“PASS”}],“warningMessages”:[{“type”:“WARNING”,“code”:“certificate-issuer-name”,“category”:“CERTIFICATE_ERRORS”,“message”:“X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.”,“status”:“WARNING”},{“type”:“WARNING”,“code”:“invalid-signing-certificate”,“category”:“CERTIFICATE_ERRORS”,“message”:“X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.”,“status”:“WARNING”}],“errorMessages”:[{“type”:“ERROR”,“code”:“certificate-permissions”,“category”:“CERTIFICATE_ERRORS”,“message”:“User only allowed to use the vat number that exists in the authentication certificate”,“status”:“ERROR”}],“status”:“ERROR”},“reportingStatus”:“NOT_REPORTED”,“clearanceStatus”:null,“qrSellertStatus”:null,“qrBuyertStatus”:null}

So i can explain to zatca-account manager our issue

1 Like