You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`$data = CSRRequest::make()
->setUID($params['organization_identifier'])
->setSerialNumber('POS Name', 'G4', '18c46ddc-f8b6-4047-bab5-e3993471fd98')
->setCommonName($params['common_name'])
->setCountryName($params['country'])
->setOrganizationName($params['organization_name'])
->setOrganizationalUnitName($params['organization_unit_name'])
->setRegisteredAddress($params['location'])
->setInvoiceType(true, true) //invoice types , the default is true, true
->setCurrentZatcaEnv(CSRRequest::SANDBOX) //support all modes ['sandbox','simulation','core']
->setBusinessCategory($params['industry']);
$CSR = GenerateCSR::fromRequest($data)->initialize()->generate();
// writing the private_key to file
openssl_pkey_export_to_file($CSR->getPrivateKey(), $storageDir.'/zatca_key.pem');`
I have generate CSR from this code but the compliance API is not accepting it.
CURL request below
`curl --location 'https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance' \
`$data = CSRRequest::make()
->setUID($params['organization_identifier'])
->setSerialNumber('POS Name', 'G4', '18c46ddc-f8b6-4047-bab5-e3993471fd98')
->setCommonName($params['common_name'])
->setCountryName($params['country'])
->setOrganizationName($params['organization_name'])
->setOrganizationalUnitName($params['organization_unit_name'])
->setRegisteredAddress($params['location'])
->setInvoiceType(true, true) //invoice types , the default is true, true
->setCurrentZatcaEnv(CSRRequest::SANDBOX) //support all modes ['sandbox','simulation','core']
->setBusinessCategory($params['industry']);
--header 'Accept-Version: V2'
--header 'OTP: 123345'
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--header 'Cookie: TS0106293e=0132a679c0786d22f5f3e29fbd2531cc0b8621318f36543d54ee886ca0a95a7f1736364eab655e2f6f987560358d2a2e5e74b3b4df'
--data '{
"csr": "MIIBBDCBrAIBADBNMQswCQYDVQQGEwJTQTEWMBQGA1UECwwNSmVkZGFoIEJyYW5jaDESMBAGA1UECgwJTXlDb21wYW55MRIwEAYDVQQDDAkxMjcuMC4wLjEwVjAQBgcqhkjOPQIBBgUrgQQACgNCAAQhByhJZ4MQsAPLjbSKTzZ9YNLUpPomdCFxrzVHxh3RmgAn5ndpUXvzDRwQFAMO0XLn0kQ7ZRjrjITRH6iDuyNuoAAwCgYIKoZIzj0EAwIDRwAwRAIgLLjoBYCmSeowe0x7ByDzmNUIwKDu25JCUqOeseRvcgYCIG/pIvidpdSDKy24naoSnfRsMOIWu6/YE041EU3YQcuC"
}'`
The output show Invalid Request with status 400.
Kindly guide me what i am doing wrong
Thanks in advance.
The text was updated successfully, but these errors were encountered: