Register

Generates a Device on our server and produces the CSID via ZATCA.

This endpoint is designed for the registration of devices within our system. It handles the generation of a unique Device ID on our server and coordinates with ZATCA to generate the CSID (Cryptographic Stamp Identifier).

Request Body

ParameterData TypeField ValidationsDescription
DeviceDetailsObjectMandatoryDevice Details Object.
Organization DetailsObjectMandatory.Organization Details Object.
OTPstringMandatoryShould be a valid OTP from fatoora protal.
EnvironmentstringEnum:
Development,
Simulation,
Production

Development : any string will be accepted as OTP,

Simulation, Production: Valid OTP has to be provided

invoiceFormatstringEnum:
Xml,
Pdf,
Model
Xml,Pdf : invoice hash should be managed before reporting the invoice,

Model: invoice hash will be managed from our service.


Device Detail Object

ParameterData TypeField ValidationsDescription
egsSerialNumberstringMandatoryunique string identifier assigned to each device.
locationstringMandatoryThe address of the branch or location where the device or solution unit is primarily located.
industrystringMandatoryIndustry or sector for which the device or solution will generate invoices.
invoiceTypestringRegEx: ^(?!0{4})[01]{2}[00]{2}$

Optional. Describes the types of tax invoices the system supports using a 4-character string "TSXY":

T: Standard Tax Invoice (1 = supported, 0 = not supported)

S: Simplified Tax Invoice (1 = supported, 0 = not supported)

X and Y: Reserved for future use (should always be set to 0 currently)

1000: Supports only Standard Tax Invoices.

0100: Supports only Simplified Tax Invoices.

1100: Supports both Standard and Simplified Tax Invoices.


Organization Details Object

ParameterData TypeField ValidationsDescription
VatString15 digits, starting and ending with 3VAT or group VAT registration number
OrganizationNameStringMandatory. Can not be emptyThe name of the organization with which the device will be registered.
OrganizationUnitNameString

Mandatory

If the VAT is not a Group VAT, use the branch name of the taxpayer.

If the VAT is a Group VAT ID, use the 10-digit TIN of the individual group member.

CountryCodeStringMandatory, Two-character country code as per ISO 3166-1 Alpha-2 standardCountry Code.

Request Example

{
  "Device": {
    "EgsSerialNumber": "SN123456789",
    "Location": "Headquarters",
    "Industry": "Retail",
    "InvoiceType": "Standard"
  },
  "Organization": {
    "Vat": "3-------------3",
    "OrganizationName": "Tech Innovations Inc.",
    "OrganizationUnitName": "Riyadh Branch 2814",
    "CountryCode": "SA"
  },
  "Environment": "Simulation",
  "OTP": "233582",
  "InvoiceFormat": "Xml"
}

Response Status Codes

HTTP Status CodeDescription
200For successful generation of CSR/DeviceId.
400For any validation issues, the errors will be listed in the errorList.
401If the user is not authenticated.

Response Body

❗️

If your device invoice type is XML or PDF, you must save the CSID, private key, and secret for this device to manage the invoice counter and invoice hash. Additionally, you can optionally save the CSR for backup.

ParameterData TypeDescription
deviceIdUUIDThe Device ID that was generated in our server.
csidStringCryptographic Stamp Identifier generated from zatca
CSRStringCertificate Signing Request used for generating the CSID.
privateKeyStringgenerated with the CSR
secretStringgenerated from zatca associated with the CSID.
invoiceTypeEnum
Simplified
Standard
Both
Simplified: Supports only Standard Tax Invoices.
Standard: Supports only Simplified Tax Invoices.
Both: Supports both Standard and Simplified Tax Invoices.
statusString

Enum:

Success, Failed

Language
Credentials
Header
Click Try It! to start a request and see the response here!