Query about Advance Payments and XML Structure for ZATCA

In our ERP system, we do not issue separate invoices for prepayments. Instead, customers make advance payments, and we record the prepayment amount directly during invoice generation in the frontend. The prepayment is subtracted from the total amount to calculate the net payable amount.

For example, consider the calculation shown below:

  1. Invoice Details:
    • Description: “Laptop”
    • Quantity: 2
    • Unit Price: 500
    • Amount (Excl. VAT): 1000
    • VAT @ 15%: 150
    • Amount (Incl. VAT): 1150
  2. Prepayment Handling:
    • Total Amount: 1000.00
    • Discount: 50.00
    • Total Before VAT: 950.00
    • VAT Amount: 142.50
    • Amount with VAT: 1092.50
    • Advance Amount: 100.00
    • Net Amount Payable: 992.50

My Understanding and Approach:

From my research, it seems I need to structure the XML as follows for the prepayment:

Invoice Line for Prepaid Amount:

<cac:InvoiceLine>
    <cbc:ID>2</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">0.000000</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">0.00</cbc:LineExtensionAmount>
    <cac:DocumentReference>
        <cbc:ID>46531</cbc:ID>
        <cbc:UUID>a79760f7-2f48-4da9-85a5-40459a147c80</cbc:UUID>
        <cbc:IssueDate>2022-08-15</cbc:IssueDate>
        <cbc:IssueTime>12:28:17</cbc:IssueTime>
        <cbc:DocumentTypeCode>386</cbc:DocumentTypeCode>
    </cac:DocumentReference>
    <cac:TaxTotal>
        <cbc:TaxAmount currencyID="SAR">0</cbc:TaxAmount>
        <cbc:RoundingAmount currencyID="SAR">0</cbc:RoundingAmount>
        <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="SAR">1000</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="SAR">150</cbc:TaxAmount>
            <cac:TaxCategory>
                <cbc:ID>S</cbc:ID>
                <cbc:Percent>15.00</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:TaxCategory>
        </cac:TaxSubtotal>
    </cac:TaxTotal>
    <cac:Item>
        <cbc:Name>Laptop | حاسوب محمول</cbc:Name>
        <cac:ClassifiedTaxCategory>
            <cbc:ID>S</cbc:ID>
            <cbc:Percent>15.00</cbc:Percent>
            <cac:TaxScheme>
                <cbc:ID>VAT</cbc:ID>
            </cac:TaxScheme>
        </cac:ClassifiedTaxCategory>
    </cac:Item>
    <cac:Price>
        <cbc:PriceAmount currencyID="SAR">0.00</cbc:PriceAmount>
    </cac:Price>
</cac:InvoiceLine>

Prepaid Amount in LegalMonetaryTotal:

<cac:LegalMonetaryTotal>
    <cbc:LineExtensionAmount currencyID="SAR">2000</cbc:LineExtensionAmount>
    <cbc:TaxExclusiveAmount currencyID="SAR">1900</cbc:TaxExclusiveAmount>
    <cbc:TaxInclusiveAmount currencyID="SAR">2185</cbc:TaxInclusiveAmount>
    <cbc:AllowanceTotalAmount currencyID="SAR">100</cbc:AllowanceTotalAmount>
    <cbc:PrepaidAmount currencyID="SAR">1150</cbc:PrepaidAmount>
    <cbc:PayableAmount currencyID="SAR">1035</cbc:PayableAmount>
</cac:LegalMonetaryTotal>

My Question:

Since we do not generate separate prepayment invoices, we simply deduct the advance amount during the invoice generation. In this scenario, how should the XML structure look to comply with ZATCA regulations?

Could you confirm if the above XML structure is correct for such cases? If not, how should we handle the advance payment in the XML to ensure compliance?

@arjun_tech24 it is incorrect to adjust an amount towards advance payment without actually issuing a separate invoice (and accounting for VAT liability at the time of receiving advance).

If you do not issue a separate invoice at the time of receiving advance (it is a violation of Article 53), then you cannot make any adjustment for the same in invoice. The way you have described the process, it hints towards under-reporting of VAT.

2 Likes

@Ankit_Tiwari
Thank you for the detailed explanation and for highlighting the consequences. I will ensure to correct this process and issue an invoice at the time of receiving the advance payment.

@Ankit_Tiwari
When an invoice is issued for an advance payment, what is the VAT to be calculated? The advance has not yet been assigned to any item. The item that it will be assigned to - in the future - may or may not be subject to VAT.

@Ankit_Tiwari

For an item (laptop) with an amount of 1000, where the customer paid 500 as an advance, do I need to submit this to the ZATCA API by only changing the DocumentTypeCode to 386, while keeping all other tags the same as a normal tax invoice? After submitting it to ZATCA, in the original sales invoice, I need to add the details of the connected prepayment invoice as a separate invoice line and adjust the prepayment amount. Am I right? Is this the correct flow?

@arjun_tech24 yes your understanding is correct.

1 Like

@malar your question about assigning VAT rate to advance payment is a tax policy related question and cannot be discussed on this forum. You may consider applying for a Tax Ruling https://zatca.gov.sa/en/eServices/Pages/eServices_023.aspx

Dear @Ankit_Tiwari
As amounts mentioned in the above case .

What should be the “cbc:TaxAmount” in the advance payment xml and in its sub-sequent invoice xml?

Dear @mohdzeeshan5c0 “cbc:TaxAmount” will be 75 (15% of 500). Final invoice will show 1 line item for 1000 and 150 VAT on it.
Another line will be added towards adjustment of advance for 500 and 75 VAT on it. On the human readable form this advance adjustment can be displayed at document level totals to arrive at net amount due for payment.

Calculations steps for advance payment adjustment are explained in Section 8 of the the detailed guideline (https://zatca.gov.sa/en/E-Invoicing/Introduction/Guidelines/Documents/E-Invoicing_Detailed__Guideline.pdf).