post
https://apistaging.taxizer.com/v1/Invoices/GenerateInvoice
Create a valid Standard E-Invoice with a JSON payload and report it to ZATCA in real-time.
For detailed specifications of the data models used in the request.
****
This endpoint is specifically used for Standard e-invoices only (B2B) invoices,
This endpoint is specifically used for standard E-invoices (B2B) only. According to ZATCA regulations, all standard e-invoices must be reported to ZATCA immediately.
Request Example
{
"deviceId": "{DeviceId:UUID}",
"eInvoiceDTO": {
"invoiceNumber": "PSI25-00020",
"uuid": "3444073b-e697-4811-a5fa-f83e7f248af8",
"invoiceTypeCode": "0100000",
"invoiceTypeValue": "388",
"issuedDateTime": "2024-06-23T17:58:26.115Z",
"documentCurrencyCode": "SAR",
"taxCurrencyCode": "SAR",
"actualDeliveryDate": "2024-06-23T17:58:26.116Z",
"latestDeliveryDate": "2024-06-23T17:58:26.116Z",
"supplierInfo": {
"vat": "3***********3",
"registrationName": "{CompanyName}",
"crn": "3***********3",
"partyPostalAddress": {
"streetName": "Riyadh",
"buildingNumber": "8022",
"plotIdentification": "",
"citySubdivisionName": "الرياض",
"cityName": "الرياض",
"postalZone": "11543",
"countrySubentity": "SA",
"country": "SA"
}
},
"customerInfo": {
"vat": "*************",
"registrationName": "نقداً",
"nat": "123455678",
"partyPostalAddress": {
"streetName": "",
"buildingNumber": "",
"plotIdentification": "",
"citySubdivisionName": "Riyadh",
"cityName": "Riyadh",
"postalZone": "",
"countrySubentity": "SA",
"country": "SA"
}
},
"paymentMeans": [
{
"code": 10
}
],
"taxTotals": [
{
"taxAmount": {
"currencyCode": "SAR",
"amount": 2.94
},
"roundingAmount": {
"currencyCode": "SAR",
"amount": 22.50
}
},
{
"taxAmount": {
"currencyCode": "SAR",
"amount": 2.94
},
"roundingAmount": {
"currencyCode": "SAR",
"amount": 22.50
},
"taxSubtotals": [
{
"taxAmount": {
"currencyCode": "SAR",
"amount": 2.94
},
"taxableAmount": {
"currencyCode": "SAR",
"amount": 19.56
},
"taxCategory": {
"id": 0,
"percent": 15,
"taxSchemeId": "VAT"
}
}
]
}
],
"legalMonetaryTotal": {
"lineExtensionAmount": {
"currencyCode": "SAR",
"amount": 19.56
},
"taxExclusiveAmount": {
"currencyCode": "SAR",
"amount": 19.56
},
"taxInclusiveAmount": {
"currencyCode": "SAR",
"amount": 22.50
},
"allowanceTotalAmount": {
"currencyCode": "SAR",
"amount": 0.00
},
"prepaidAmount": {
"currencyCode": "SAR",
"amount": 0.00
},
"payableAmount": {
"currencyCode": "SAR",
"amount": 22.50
}
},
"invoiceLines": [
{
"id": "10000",
"itemName": {
"en": "Item 1",
"ar": "عنصر 1"
},
"invoicedQuantity": 1,
"lineExtensionAmount": {
"currencyCode": "SAR",
"amount": 6.52
},
"taxAmount": {
"currencyCode": "SAR",
"amount": 0.98
},
"roundingAmount": {
"currencyCode": "SAR",
"amount": 7.50
},
"taxCategory": {
"percent": 15,
"id": 0,
"taxSchemeId": "VAT"
},
"priceAmount": {
"currencyCode": "SAR",
"amount": 6.52174
},
"allowanceCharge": {
"chargeIndicator": false,
"allowanceChargeReason": "discount",
"amount": {
"currencyCode": "SAR",
"amount": 7.50
}
}
},
{
"id": "20000",
"itemName": {
"en": "Item 2",
"ar": "عنصر 2"
},
"invoicedQuantity": 1,
"lineExtensionAmount": {
"currencyCode": "SAR",
"amount": 13.04
},
"taxAmount": {
"currencyCode": "SAR",
"amount": 1.96
},
"roundingAmount": {
"currencyCode": "SAR",
"amount": 15.00
},
"taxCategory": {
"percent": 15,
"id": 0,
"taxSchemeId": "VAT"
},
"priceAmount": {
"currencyCode": "SAR",
"amount": 13.04348
}
}
]
}
}
Response Example
{
"status": "completed",
"warningMessages": [],
"errorMessages": [],
"qrCode": "{qrCode}",
"signedInvoice": "",
"invoiceHash": "",
"invoiceCounter": 2
}
Response Params
****
| Parameter | Data Type | Description |
|---|---|---|
| status | string | status of the invoice reporting process. either "failed" or "completed" |
| warningMessages | list of warningMessage | when the invoice receives an "Accepted with Warnings" status from ZATCA, a list of warnings will be provided detailing the issues identified |
| errorMessages | list of errorMessage. | when the invoice status "failed" you will get list of errorMessages. |
| qrCode | string. | base64 string encoded. |
| signedInvoice | string. | signed XML invoice submitted to ZATCA (XML encoded string). |
| invoiceHash | string. | unique hash that indicates the specific sequence of that invoice within the device's transaction log |
| invoiceCounter | integer. | the place/index of the invoice in the device queue |
warningMessage and ErrorMessage Object
| Parameter | Data Type | Description |
|---|---|---|
| type | string | The type of issue encountered |
| code | string | A code identifying the specific issue |
| category | string | The general category of the issue |
| message | string | A brief explanation of the issue |
| status | string | The current status of the issue |
Response Status Code
| HTTP Status Code | Description |
|---|---|
| 200 | invoice is reported successfully |
| 400 | invalid combination of Invoice Type Code and Invoice Type Value was detected, or a validation error occurred. - detailed in the errorMessages list |