X509Certificate used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number

we are currently working on the simulation, and we were able to clear simplified invoices for compliancy (without any warnings or errors) and then proceeded to generate a CSID to used for testing.

For the signing procedure we are using the SDK to sign:
var invoiceSigner = new EInvoiceSigner();
var xmlSigned = invoiceSigner.SignDocument(xmlDocInvoice, certificateContent, privateKeyContent);

when we report the using the CSID we got for testing we get the following warning:
“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.”.

we are using the sdk release 3.3.2

you need to replace the ccsid with the pcsid before signing the invoice for reporting

Dear royaouad,

please make sure that you are using the production CSID and not the compliance CSID for signing invoices.

In the onboarding process, 2 CSIDs (X509 certificates) will be returned.

First one: after requesting the compliance CSID API, (which is the first step to do in onboarding process), we use this certifecate to sign invoices for the compliance checks step (compliance Invoice API), so we only use this certificate to sign invoices for the testing purposes in the compliance checks phase, as invoices in compliane checks are not being sent to ZATCA.

Second one: after requesting the production CSID API, we use this certificate to sign real invoices that are being sent to ZATCA by reporting API for simplified invoices or clearance API for standard invoices, however signing standard invoices is optional & not mandatory.

so what suggested is to make sure that you are using the PCSID X5509 certificate to sign your invoices,and check again.

thank you,

hi @royaouad
am getting same warning error when doing Compliance Check:
X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.

did you get any solution for this? thanks

hi,

hi @royaouad
am getting same warning error when doing Compliance Check:
X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.

everything is fine after generating the CSID and signing the invoice.
upon Compliance Check, this warning error message shows.
I have done onboarding before, everything went fine.

Appreciate your help. Thanks

Dear @amarcp

Thanks for reaching out,

Can I kindly ask you to elaborate more with you concerns and provide the steps that you are doing from the beginning?
and what is the version of the SDK that you are using?

Thanks,
Ibrahem Daoud.

hi @idaoud

I uploaded signed Simplified Tax Invoice xml file.
Upon Compliance Check, am getting warning message:

X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.

Steps taken:

  1. Submit Certificate Signing Request (CSR) via the Compliance Request CSID API and received a BinaryToken and a secret.
  2. Decode the BinaryToken using a base64 decoder. The decoded value will be the x.509 certificate.
  3. Replace the contents of the cert.pem and ec-secp256k1-priv-key.pem in SDK Data\Certificates with the new cert.pem obtained from the decoded binary token and the newly generated ec-secp256k1-priv-key.pem.
  4. Sign the invoice using the Compliance CSID

I am using SDK zatca-einvoicing-sdk-238-R3.3.3.

Did i miss something?

Does this something to do with the sequence of issuer name in CSR vs Signed invoice

Dear @amarcp

Thanks for reaching out,

Kindly note that the error you are getting is related to the Vat in the CSR, ensure that you are using the same Vat in the invoice.XML tag companyID to be the same vat.

Additionally, please note that there are new version of the SDK it’s 3.3.5, our recommendation is to download it.

Thanks,
Ibrahem Daoud.

@idaoud

cbc:CompanyIDsame vat number here in the CSR</cbc:CompanyID>

@idaoud

-----BEGIN CERTIFICATE-----
MIICQjCCAeigAwIBAgIGAZItaR91MAoGCCqGSM49BAMCMBUxEzARBgNVBAMMCmVJ
bnZvaWNpbmcwHhcNMjQwOTI2MDgxODMyWhcNMjkwOTI1MjEwMDAwWjB6MQswCQYD
VQQGEwJTQTEYMBYGA1UECgwPMzEwOTYxODA2NTAwMDAzMRMwEQYDVQQLDAozMTA5
NjE4MDY1MTwwOgYDVQQDDDNBTUFSLS42MVpUMzkzLkNOSVZDMDAwOTgxNTE2LjA2
V1hKVC0zMTA5NjE4MDY1MDAwMDMwVjAQBgcqhkjOPQIBBgUrgQQACgNCAATnXYaV
kKJ3lLda0cPJm9XR4CJkVDFE3cLIqQ3GhqWmCGfCS9jp6RscDXRn3IL6HX3m1UVx
92dJ2NHX2Ih+mKVto4HBMIG+MAwGA1UdEwEB/wQCMAAwga0GA1UdEQSBpTCBoqSB
nzCBnDE9MDsGA1UEBAw0MS1BTUFSfDItQU1BUnwzLTRjNGM0NTQ0LTAwMzEtNWEx
MC04MDU0LWI2YzA0ZjMzMzkzMzEfMB0GCgmSJomT8ixkAQEMDzMxMDk2MTgwNjUw
MDAwMzENMAsGA1UEDAwEMTEwMDEZMBcGA1UEGgwQQWwgQmFsYWQsIEplZGRhaDEQ
MA4GA1UEDwwHSkVXRUxSWTAKBggqhkjOPQQDAgNIADBFAiEA8ZCtfi7Lgd+BfJvD
Tdz2IJ8vL9Td01QTftM4BvbKg1MCIE0uHryhWHNtip3iRpksaXCFDyUP9J+yNFGt
eFkn/Qxp
-----END CERTIFICATE-----

hi @idaoud
i tried, using latest SDK version. same error
please note im using Same Vat Number in the Company ID and CSR

Dear @amarcp

Kindly if you are still facing an issue provide all of the details to ensure a comprehensive support.

Please Share via
sp_support@zatca.gov.sa
E-invoicing@zatca.gov.sa

Thank you.

hi,

I’m still facing same issue.
I sent an email to ZATCA (sp_support@zatca.gov.sa) regarding this issue with the error details and attachments for their reference and received response from them after few days.(TKT-0001357090)

"Kindly note that the warning X509Certificate (CCSID / PCSID) used for signing is not a valid certificate (CCSID / PCSID) for this VAT Registration Number appears if: 1- The VAT number that associated with the certificate is not the vat number of your invoice 2- You are using different certificate ( even with same VAT) for signing and reporting. Please ensure you use the same certificate for signing as well as reporting. please make sure that you are using the production CSID and not the compliance CSID for signing invoices. There is an enhancement soon to allow taxpayers to sign and submit using two different PCSIDs but with the same VAT number without raising that warning. till then you can disregard this warning and your invoice is already accepted. "

Since the invoice is accepted, I disregard the warning message and proceed.

@Ankit.K.Tiwari ,
We have implemented our in-house solution instead of using the SDK, following the metadata, XML, and security implementation rules provided by ZATCA. However, we are still receiving warning messages in the API response for B2C invoices. Can you please advise

@amarcp
Do you have VAT Group?

Hi,
What are the messages you are receiving and also sample XML you had signed. thanks

i have create xml in though my application what are the next step i use this
openssl dgst -sha256 320.xml"
openssl ecparam -name secp256k1 -genkey -noout -out PrivateKey.pem

openssl ec -in PrivateKey.pem -pubout -conv_form compressed -out PublicKey.pem

openssl base64 -d -in PublicKey.pem -out PublicKey.bin

openssl dgst -verify PublicKey.pem -signature PublicKey.bin 320.xml but i got Error varifying data .
320.xml i check Zatca o error showig