Skip to main content

QR Code (Simplified Invoice)

Use this API to generate cryptographically signed base64 encoded QR code your EGS(E-Invoice Generation Solution) generated B2C documents(Simplified Tax Invoice or Simplified Tax Invoice Credit Note or Simplified Tax Invoice Debit Note )to the ZATCA's sandbox environment.

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

info

Use this base64 encoded QR code to generate scannable QR image.

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

Request Parameters

PARAMSREQUIREDDATA TYPEDESCRIPTIONEXAMPLE
invoiceDataYESjsonThe data of the B2C document{...}\
documentTypeYESstringFor the following documents types, use the corresponding enums:

1) Simplified Tax Invoice - SIMPLIFIED_TAX_INVOICE
2) Simplified Tax Invoice Credit Note - SIMPLIFIED_TAX_INVOICE_CREDIT_NOTE3) Simplified Tax Invoice Debit Note - SIMPLIFIED_TAX_INVOICE_DEBIT_NOTE
SIMPLIFIED_TAX_INVOICE
referenceIdCONDITIONALstringID of the original document(reference document) for which this document is generated.

Applicable only for document types:

1) Simplified Tax Invoice Credit Note2) Simplified Tax Invoice Debit Note
Example:
If the document type is Simplified Credit Note, the reference id should be Invoice number for which this credit note is being created.
2022100627
documentIssueDateTimeYESstringDocument Issue Date and Time in "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" format.2022-10-21T12:53:13.000Z
documentDueDateTimeNOstringDocument Due Date and Time in "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" format.2022-10-21T12:53:13.000Z
sellerNameYESstringName of the sellerCompany Name
sellerAddressYESjsonAddress of the seller with the below mentioned fields.{
"addrLine1": "Makkah",
"addrLine2": "Al Alam Street",
"additionalNo": "1234", "buildingNumber": "1234"
"city": "Riyadh",
"state": "Riyadh",
"zipCode": "24211",
"district": "Riyadh",
"country": "SA"
}\
buyerNameCONDITIONALstringBuyer Name is mandatory to be filled as per the transactions mentioned in article 53 (7) and for private education and private healthcare to citizens.Vignesh K
buyerAddressNOjsonBuyer address{
"addrLine1": "Makkah",
"addrLine2": "Al Alam Street",
"additionalNo": "1234", "buildingNumber": "1234"
"city": "Riyadh",
"state": "Riyadh",
"zipCode": "24211",
"district": "Riyadh",
"country": "SA"
}\
addrLine1YESstringAddress Line 1Makkah
addrLine2YESstringAddress Line 2Al Alam Street
buildingNumberYESstringBuilding Number2021
additionalNoYESstringAdditional Number(4 digits)2134
cityYESstringCity
Riyadh
stateYESstringStateRiyadh
districtYES`stringdistrictRiyadh
countryYESstringCountry code.
2 letter code (ISO 3166 Alpha-2)
SA
zipCodeYESstringPostal Code(5 digits)24211
documentLineItemsYESarrayLine items list[...]
lineItemDescYESstringLine item descriptionBall point pen
lineItemPriceYESnumberLine item price10.00
lineItemQtyYESnumberLine item quantity10.00
lineItemTaxableAmountYESnumberLine item taxable amount

lineItemTaxableAmount = (lineItemPrice * lineItemQty) - discountOnLineItem
100.00
discountOnlineItemYESnumberDiscount in amount applied on the line item0.00
vatRateOnLineItemYESnumberVat Rate applied to the line item15.00
lineItemVatAmountYESnumberVat amount of the line item

lineItemVatAmount = (lineItemTaxableAmount * vatRateOnLineItem)/100
15.00
lineItemSubTotalYESnumberTotal of the Line Item

lineItemSubTotal = lineItemTaxableAmount + lineItemVatAmount
115.00
totalExcludingVatYESnumbertotalExcludingVat = documentTotal - totalVat100.00
totalTaxableAmountExcludingVatYESnumbertotalTaxableAmountExcludingVat = sum of all lineItemTaxableAmount of line items - discountOnDocumentTotal(if applied)100.00
vatTotalYESnumbervatTotal = sum of all lineItemVatAmount of line items15.00
documentTotalYESnumberdocumentTotal = totalTaxableAmountExcludingVat + vatTotal115.00
discountOnDocumentTotalNOnumberDiscount applied on document total0.00
isSpecialBillingAgreementYESbooleanIf transaction for the following conditions:

1) Self-billed invoice
2) Third party billed invoice on behalf of the supplier
false
isTransactionTypeYESbooleanIf transaction is any of the following(not mutually exclusive):

1) Nominal Supply
2) Export
3) Summary
false
isSelfBilledYESbooleanIf isSpecialBillingAgreement is true and self - billed conditionfalse
isThirdPartyYESbooleanIf isSpecialBillingAgreement is true and Third party conditiontrue
isNominalSupplyYESbooleanIf isTransactionType is true and nominal supply conditionfalse
isExportYESbooleanIf isTransactionType is true and export conditionfalse
isSummaryYESbooleanIf isTransactionType is true and summary invoice conditionfalse
supplyDateYESstringGoods/Service supply Date and Time in "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" format.
sellerVatRegistrationNumberYESstringSeller Vat registration number300055184400003
additionalSellerIdTypeYESstringFor the following Seller ID types, use the corresponding enums in bold:

1) Commercial registration number with "CRN" as schemeID
2) Momra license with "MOM" as schemeID -
3) MLSD license with "MLS" as schemeID
4) Sagia license with "SAG" as schemeID
5) Other OD with "OTH" as schemeID
In case multiple IDs exist then one of the above must be entered following the sequence specified above
CRN
additionalSellerIdNumberYESstringAdditional seller ID number of the ID type chosen1112233344
sellerGroupVatRegistrationNumberCONDITIONALstringGroup Vat registration number of the seller300244974200003
additionalBuyerIdTypeCONDITIONALstringRequired only for private education or private healthcare supplies to Citizens. This field should contain the National ID only for invoices pertaining to private education and private healthcare to citizens. National ID is mandatory to be filled for private education and private healthcare to citizens.

Other Buyer ID enum must be one of the following list:

1) Tax Identification Number "TIN" as schemeID
2) Commercial registration number with "CRN" as schemeID
3) Momra license with "MOM" as schemeID
4) MLSD license with "MLS" as schemeID
5) 700 Number with "_700" as schemeID
6) Sagia license with "SAG" as schemeID
7) National ID with "NAT" as schemeID
8) GCC ID with "GCC" as schemeID
9) Iqama Number with "IQA" as schemeID
10) Passport ID with "PAS" as schemeID
11) Other ID with "OTH" as schemeID
In case multiple IDs exist then one of the above must be entered following the sequence specified above
NATIONAL_ID
additionalBuyerIdNumberCONDITIONALstringBuyer's NATIONAL ID number112233445566
specialTaxTreatmentCONDITIONALstringWhere Tax is not charged at the standard rate, this field should have a narration “Tax treatment applied to the supply” as per Article 53 of the VAT Implementing Regulation.

Narration to be entered if Tax is not charged at basic rate.
0
vatCurrencyCONDITIONALstringIf document currency is not "SAR", please provide vatCurrency. 'vatTotal' will be always accounted in 'SAR' even when the document currency is not in 'SAR'SAR
noteIssuanceReasonCONDITIONALstringReason for issuing credit/debit note.
Reasons for issuance of credit / debit note as per Article 40 (paragraph 1) and Article 54 (3) of KSA VAT regulations, a Credit and Debit Note is issued for these 5 instances:
1) Cancellation or suspension of the supplies after its occurrence either wholly or partially
2) In case of essential change or amendment in the supply, which leads to the change of the VAT due;
3) Amendment of the supply value which is pre-agreed upon between the supplier and consumer;
4) In case of goods or services refund.
5)In case of change in Seller's or Buyer's information
Cancellation or suspension of the supplies after its occurrence either wholly or partially
currencyYESstringTransaction Currency of the documentSAR
documentIdYESnumberA unique identification of the Invoice - Invoice Reference number(IRN)2022100627

Response Parameters

PARAMSDATA TYPEDESCRIPTIONEXAMPLE
encodedQrCodeDatastringBase64 encoded QR code string.
Use this string to create QR image to be used on the printed B2C document.

Use it only on B2C documents.
AQxDb21wYW55IE5hbWUCDzMwMDA1NTE4NDQwMDAwMwMUMjAyMi0xMC0yMVQwMDo1MzoxM1oEBjExNS4wMAUFMTUuMDAGLE9QUVJpUjRlVVpnL01QbXE1eStqMlVKTlZlOGxZbGF5ZkFiZ3pnTkFpdTQ9B2BNRVlDSVFDYzFJdlM3RVVGbXVGK0NHaDlCT0x5TUQ2UkF6elFvS043ckpmOXdZaXZjUUloQU9wdFkrbGx2bXd2TXZVaThvZjFWUFZCa1d0c1NjSXprSUZkSU1HOFR1emkIWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABA/8G9pYQbwSAvAp52b6LqOjs0cpsplPTVkYSMmjIRkRAQhGQeBAFawbldsV4sWOKgWH/XXXq85FvQ8HaNyJR4I=

Body parameter

\
"invoiceData": {
"documentType": "SIMPLIFIED_TAX_INVOICE",
"referenceId": "",
"documentIssueDateTime": "2022-12-30T09:58:24.000Z",
"documentDueDateTime": "2022-12-30T09:58:24.000Z",
"sellerName": "ahmad abdurrahman",
"sellerAddress": {
"addrLine1": "12, Masjid Street",
"addrLine2": "Amjad Building",
"additionalNo": "1234",
"buildingNumber": "1234",
"city": "Dammam",
"state": "Riyadh",
"zipCode": "12313",
"district": "Riyadh",
"country": "SA"
},
"buyerName": "Zahid Gani",
"documentLineItems": [
{
"lineItemDesc": "HP Laptop/Hp Laptop",
"lineItemPrice": 578,
"lineItemQty": 1,
"lineItemTaxableAmount": 573,
"discountOnLineItem": 5,
"vatRateOnLineItem": 15,
"lineItemVatAmount": 85.95,
"lineItemSubTotal": 658.95
},
{
"lineItemDesc": "HP Laptop/Hp Laptop",
"lineItemPrice": 578,
"lineItemQty": 1,
"lineItemTaxableAmount": 573,
"discountOnLineItem": 5,
"vatRateOnLineItem": 15,
"lineItemVatAmount": 85.95,
"lineItemSubTotal": 658.95
}
],
"totalExcludingVat": 1112,
"totalTaxableAmountExcludingVat": 1146,
"vatTotal": 166.8,
"documentTotal": 1278.8,
"discountOnDocumentTotal": 34,
"isSpecialBillingAgreement": "false",
"isTransactionType": "false",
"isSelfBilled": "false",
"isThirdParty": "false",
"isNominalSupply": "false",
"isExport": "false",
"isSummary": "false",
"supplyDate": "2022-12-30T09:58:24.000Z",
"sellerVatRegistrationNumber": "300055184400003",
"sellerGroupVatRegistrationNumber": "",
"additionalSellerIdType": "CRN",
"additionalSellerIdNumber": "1112233344",
"specialTaxTreatment": "0",
"currency": "SAR",
"documentId": "001"
}
}

Parameters

NameInTypeRequiredDescription
bodybodyobjectfalsenone

Example responses

200 Response

{
"encodedQrCodeData": "AQxDb21wYW55IE5hbWUCDzMwMDA1NTE4NDQwMDAwMwMUMjAyMi0xMC0yMVQwMDo1MzoxM1oEBjExNS4wMAUFMTUuMDAGLE9QUVJpUjRlVVpnL01QbXE1eStqMlVKTlZlOGxZbGF5ZkFiZ3pnTkFpdTQ9B2BNRVlDSVFDYzFJdlM3RVVGbXVGK0NHaDlCT0x5TUQ2UkF6elFvS043ckpmOXdZaXZjUUloQU9wdFkrbGx2bXd2TXZVaThvZjFWUFZCa1d0c1NjSXprSUZkSU1HOFR1emkIWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABA/8G9pYQbwSAvAp52b6LqOjs0cpsplPTVkYSMmjIRkRAQhGQeBAFawbldsV4sWOKgWH/XXXq85FvQ8HaNyJR4I="
}

Responses

StatusMeaningDescriptionSchema
200OKOKInline

Response Schema

Response Headers

StatusHeaderTypeFormatDescription
200Datestringnone
200Content-Typestringnone
200Content-Lengthintegernone
200Connectionstringnone
200x-amzn-RequestIdstringnone
200Access-Control-Allow-Originstringnone
200Access-Control-Allow-Headersstringnone
200x-amz-apigw-idstringnone
200Access-Control-Allow-Methodsstringnone
200Access-Control-Expose-Headersstringnone
200X-Amzn-Trace-Idstringnone

To perform this operation, you must be authenticated by means of one of the following methods: oauth2Auth