Hello,
I need a xml sample for advance payment invoice with invoice type 386.
If we have an item with price 1000 SAR, and customer pays 500 SAR as advance payment.
What will be the xml structure and also pdf?
Thank you.
Hello,
I need a xml sample for advance payment invoice with invoice type 386.
If we have an item with price 1000 SAR, and customer pays 500 SAR as advance payment.
What will be the xml structure and also pdf?
Thank you.
Hope you are doing well.
It will have everything for 1000SAR item.
Only difference will be taken place in three palces.
Thank you for your reply, but I think this for invoice type code 388 with extra line for advance payment amounts.
What I want is, a sample for the structure of xml of advance payment that was included as a new line in invoice.
Hello @Ankit.K.Tiwari, please support
@m.mahdi when customer pays advance of 500 SAR, you have to issue Tax Invoice with type code 386 for 500 SAR.
Later, when you issue the final invoice (type code 388) for 1000 SAR, you can adjust the 500 for which you already issued Tax Invoice and charged VAT earlier.
You would find XML structure and PDF in the samples folder inside SDK.
Please check xml file for below type code 386, is it okay:
<?xml version="1.0" encoding="UTF-8"?>cbc:ProfileIDreporting:1.0</cbc:ProfileID>
cbc:IDabc</cbc:ID>
cbc:UUIDabc</cbc:UUID>
cbc:IssueDate2025-01-01</cbc:IssueDate>
cbc:IssueTime19:57:39</cbc:IssueTime>
<cbc:InvoiceTypeCode name=“0100000”>386</cbc:InvoiceTypeCode>
cbc:DocumentCurrencyCodeSAR</cbc:DocumentCurrencyCode>
cbc:TaxCurrencyCodeSAR</cbc:TaxCurrencyCode>
cac:AdditionalDocumentReference
cbc:IDICV</cbc:ID>
cbc:UUID22607</cbc:UUID>
</cac:AdditionalDocumentReference>
cac:AdditionalDocumentReference
cbc:IDPIH</cbc:ID>
cac:Attachment
<cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>mAAjTmE3S5yWd4EWgQakqzb1BKvFi4QJFgPTYKAZdzM=</cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>
cac:AdditionalDocumentReference
cbc:IDQR</cbc:ID>
cac:Attachment
<cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>abc</cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>
cac:Signature
cbc:IDurn:oasis:names:specification:ubl:signature:Invoice</cbc:ID>
cbc:SignatureMethodurn:oasis:names:specification:ubl:dsig:enveloped:xades</cbc:SignatureMethod>
</cac:Signature>
cac:AccountingSupplierParty
cac:Party
cac:PartyIdentification
cac:Delivery
cbc:ActualDeliveryDate2025-12-02</cbc:ActualDeliveryDate>
</cac:Delivery>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>8051586.36</cbc:TaxAmount>
</cac:TaxTotal>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>8051586.36</cbc:TaxAmount>
cac:TaxSubtotal
<cbc:TaxableAmount currencyID=“SAR”>53677242.41</cbc:TaxableAmount>
<cbc:TaxAmount currencyID=“SAR”>8051586.36</cbc:TaxAmount>
cac:TaxCategory
<cbc:ID schemeID=“UN/ECE 5305” schemeAgencyID=“6”>S</cbc:ID>
cbc:Percent15.00</cbc:Percent>
cac:TaxScheme
<cbc:ID schemeID=“UN/ECE 5305” schemeAgencyID=“6”>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
cac:LegalMonetaryTotal
<cbc:LineExtensionAmount currencyID=“SAR”>53677242.41</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID=“SAR”>53677242.41</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID=“SAR”>61728828.77</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID=“SAR”>0.00</cbc:AllowanceTotalAmount>
<cbc:PrepaidAmount currencyID=“SAR”>0</cbc:PrepaidAmount>
<cbc:PayableRoundingAmount currencyID=“SAR”>0.00</cbc:PayableRoundingAmount>
<cbc:PayableAmount currencyID=“SAR”>61728828.77</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
cac:InvoiceLine
cbc:ID1</cbc:ID>
cbc:InvoicedQuantity1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID=“SAR”>53677242.41</cbc:LineExtensionAmount>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>8051586.36</cbc:TaxAmount>
<cbc:RoundingAmount currencyID=“SAR”>61728828.77</cbc:RoundingAmount>
</cac:TaxTotal>
cac:Item
cbc:Nameabc</cbc:Name>
cac:ClassifiedTaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
cac:Price
<cbc:PriceAmount currencyID=“SAR”>53677242.41</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
@Ankit.K.Tiwari, I have checked, there is no xml file with type code 386.
@m.mahdi yes because 386 invoice is exactly same as any regular invoice with only the invoice type code being 386 instead of 388. No other change compared to any regular invoice.
SDK has samples for the Final Invoice (Invoice type code 388) from which you adjust the prepaid invoice (invoice type code 386).
@Ankit.K.Tiwari, thank you, last thing, I want to make sure that the below layout is correct, is it okay?
Here the customer pays 20% as advance payment
@m.mahdi calculations are not clear, the VAT amount at line level appears to have been calculated after reducing discount of SAR 4,283,982.40. Such line level discount should be displayed at line level and not at document level.
If discount is provided only at document level, then the VAT amount at line level should be calculated accordingly.