I am trying to connect my Netsuite sandbox account with the Fatoora simulation portal.
I have generated a private key and a CSR and I have the OTP from the simulation portal.
However, when I attempt to connect Netsuite to the portal I get this error: Cannot read property ‘trim’ of undefined.
Looking deeper into the execution logs I can see this error: app_ksa_error_manager:code body: 400-{“errorCode”:“400”,“errorCategory”:“Invalid-CSR”,“errorMessage”:“The provided Certificate Signing Request (CSR) is invalid.”}
I also see
su_ksa_getccsid: e: TypeError: Cannot read property ‘trim’ of undefined
and
errors Arrays : "undefined"undefined
So I can see that my CSR is invalid, and it looks like it is because there is an undefined value somewhere, but I can’t understand what or where or why.
I am not a coder so I am really flying blind here and just have the Netsuite documentation to go by, which doesn’t have any kind of trouble shooting like this.
Any advice on what my issues might be and where I can start looking would be really helpful.
Can you please elaborate more on the steps you have taken to generate the CSR? Also, please refer to the SDK by following this path:
(zatca-einvoicing-sdk-238-R3.3.3\Data\Input), which contains samples of the config file data that you will generate your CSR from,
oid_section = OIDs
[OIDs]
certificateTemplateName = 1.3.6.1.4.1.311.20.2
[req]
default_bits = 2048
emailAddress = XXXX.XXXX@mcsaatchi.com
req_extensions = v3_req
x509_extensions = v3_ca
prompt = no
default_md = sha 256
req_extensions = req_ext
distinguished_name = dn
[dn]
C=SA
OU=M and C Saatchi Arabia Limited Liability Company
O=M and C Saatchi Arabia Limited Liability Company
CN=Oracle NetSuite MCSaatchi EGS Unit
[v3_req]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment
[req_ext]
certificateTemplateName = ASN1:PRINTABLESTRING:ZATCA-Code-Signing
subjectAltName = dirName:alt_names
[alt_names]
SN=1-MCSaatchi|2-oracleNetsuite|3-XXXX
UID=3XXXXXXXXXXXXX3
title=1100
registeredAddress=Al Riyad, Al Zahraa, Al Ihsa, 12815
businessCategory=Media
I am using a Mac. So in the Terminal App I run the following instruction: openssl ecparam -name prime256v1 -genkey -noout -out privateKey.pem
This generates a private key file.
Then I run this instruction: openssl req -new -sha256 -key privateKey.pem -extensions v3_req -config csr_config.txt -out taxpayer.csr
This generated a CSR file.
In Terminal I run an instruction to show me the two keys, which I am then putting into the Saudi Arabia Einvoicing Configuration Page within Netsuite.
You mentioned about ‘following the path’ (zatca-einvoicing-sdk-238-R3.3.3\Data\Input). I’m not a coder so I don’t really know what these means. How can I see the examples of the config file data?
I was finally able to speak with the Netsuite product team. In case anyone else reads this in the future with the same issue, I am posting the solultion here. The issue was that I wasn’t including the:
lines that are at the start and the end of the private key or CSR, I was just putting in the actual encrypted code. So that is the answer! I don’t know whether to face palm or to be justified in that it wasn’t obvious at all they needed to be included. Anyway, now it is connecting. Thanks.