Skip to main content

Onboarding

Use this API to onboard your EGS(E-Invoice Generation Solution) in the ZATCA sandbox environment.

You have to pass all the required params in the specified format at the minimum to onboard your EGS successfully. You can add additional parameters if applicable as per your preference.

# You can also use wget
curl -X POST https://t5wtfl1d2e.execute-api.ap-south-1.amazonaws.com/test/api/v1/proto/csrRequest \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'

Request Parameters

PARAMSREQUIREDDATA TYPEDESCRIPTIONEXAMPLE
csrInputsYESpipesThe csr(certificate signing request) details you need to provide for onboarding the EGS.Refer to the sample request body
otpYESstringThe OTP that you'll get from the Fatoora Portal(logged in using taxpayer credentials) after following the ZATCA onboarding process as per Antna Guidelines document.123345
commonNameYESstringA Unique Name or Asset Tracking Number of your EGS. There is no specific format, any free text will be accepted.TST-886431145-300055184400003
serialNumberYESstringUnique identification code for the EGS. Serial number should be in this "1-(.+) 2-(.+) 3-(.+)" regular expression format1-TST 2-TST 3-ed22f1d8-e6a2-1118-9b58-d9a8f11e44yt
(Refer to the sample request body for the correct format)
organizationIdentifierYESstringIt is the organization VAT number. It is a 15 digit number with starting and ending digits as '3'.300055184400003
organizationUnitNameYESstringThe branch name for Taxpayers. In case of VAT Groups , this field should contain the 10-digit TIN number of the individual group member whose EGS Unit is being onboarded. If 11th digit of Organization Identifier is not = 1 then Free text and if 11th digit of Organization Identifier = 1 then needs to be a 10 digit number.Riyadh
organizationNameYESstringName of the Taxpayer. It can be free text.Complyance Private Limited
countryNameYESstringName of the country.
2 letter code (ISO 3166 Alpha-2)
SA
invoiceTypeYESstringThe document type that the Taxpayer’s solution unit will be issuing/generating. It can be one or a combination of Standard Tax Invoice (T), Simplified Tax Invoice (S), (X), (Y). The input should be using the digits 0 & 1 and mapping those to “TSXY” where:
0 = False/Not supported
1= True/Supported
(X) and (Y) are for future use and should be set to 0 by default for the time being.
For example: 1000 would mean Solution will be generating Standard Invoices only. 0100 would mean Solution will be generating Simplified invoices (B2C) only and 1100 means Solution will be generating both Standard (B2B) and Simplified invoices (B2C).
1100
locationYESstringThe address of the Branch or location where the device or solution unit is primarily situated (could be website address for e-commerce). Preferably(not mandatory) in the Short Address format of the Saudi National Address https://splonline. com.sa/en/national- address-1/. Free text will be accepted.
Riyadh
industryYESstringIndustry or sector for which the device or solution(EGS) will generate invoices. Free text will be accepted.Petroleum

Response Parameters

PARAMSDATA TYPEDESCRIPTIONEXAMPLE
statusstringStatus of onboarding by ZATCA.

Onboarding involves multiple internal steps(API calls) with the ZATCA platform and, for API simplification the status is classified as success or failure on the whole.

The enum value is according to the respective scenarios listed below:

1) Successfully onboarded with ZATCA's Fatoora Portal - SUCCESS2) OnboardiNg failed with ZATCA's Fatoora Portal due to various errors - ERROR
This field will not be present for request level errors(field format errors)
SUCCESS
errorslistIf onboarding fails because of error from the APIs in ZATCA layer, the corresponding API error messages will be returned here. Please log this error response for RCA.[...]
codestringError status code of the failed ZATCA API.400 BAD_REQUEST
messagestringError message from the corresponding APIOTP is required field

Body parameter

{
"csrInputs": {
"otp": "123345",
"commonName": "TST-886431145-300055184400003",
"serialNumber": "1-TST|2-TST|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e44yt",
"organizationIdentifier": "300055184400003",
"organizationUnitName": "Riyadh",
"organizationName": "Complyance",
"countryName": "SA",
"invoiceType": "1100",
"location": "Riyadh",
"industry": "Civil"
}
}

Parameters

NameInTypeRequiredDescription
bodybodyobjectfalsenone

Example responses

OK

{
"status": "SUCCESS",
"errors": []
}
{
"status": "ERROR",
"errors": [
{
"code": "400 BAD_REQUEST",
"message": "OTP is required field"
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKOKInline

Response Schema

Response Headers

StatusHeaderTypeFormatDescription
200Datestringnone
200Content-Typestringnone
200Content-Lengthintegernone
200Connectionstringnone
200x-amzn-RequestIdstringnone
200x-amz-apigw-idstringnone
200X-Amzn-Trace-Idstringnone