Error: Invoice Hash API Body Does Not Match the Calculated Hash of the XML

We’re receiving the following error when submitting a compliance invoice:

The invoice hash API body does not match the (calculated) Hash of the XML

Below is an example of the invoice we’re hashing:

<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
 <cbc:UBLVersionID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2.1</cbc:UBLVersionID>
 <cbc:ProfileID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">reporting:1.0</cbc:ProfileID>
 <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">sep004558521</cbc:ID>
 <cbc:UUID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">3d8b3851-91a6-4da0-84ff-80db2cbd1a99</cbc:UUID>
 <cbc:IssueDate xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2023-09-02</cbc:IssueDate>
 <cbc:IssueTime xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">00:00:00</cbc:IssueTime>
 <cbc:DueDate xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2023-09-02</cbc:DueDate>
 <cbc:InvoiceTypeCode xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" name="0200000">388</cbc:InvoiceTypeCode>
 <cbc:Note xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">english description</cbc:Note>
 <cbc:DocumentCurrencyCode xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">SAR</cbc:DocumentCurrencyCode>
 <cbc:TaxCurrencyCode xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">SAR</cbc:TaxCurrencyCode>
 <cac:AdditionalDocumentReference xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ICV</cbc:ID>
  <cbc:UUID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">62</cbc:UUID>
 </cac:AdditionalDocumentReference>
 <cac:AdditionalDocumentReference xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">PIH</cbc:ID>
  <cac:Attachment>
   <cbc:EmbeddedDocumentBinaryObject xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" filename="Previous_Invoice_Hash" mimeCode="text/plain">IcbGN45aIoH5CbHIiWlY7JZJGX3NWlP/chOF1t9/6IQ=</cbc:EmbeddedDocumentBinaryObject>
  </cac:Attachment>
 </cac:AdditionalDocumentReference>
 <cac:AccountingSupplierParty xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cac:Party>
   <cac:PartyIdentification>
    <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" schemeID="CRN">312312312332313</cbc:ID>
   </cac:PartyIdentification>
   <cac:PartyName>
    <cbc:Name xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">شركة شبكة عهد لتقنية المعلومات المحدودة</cbc:Name>
   </cac:PartyName>
   <cac:PostalAddress>
    <cbc:StreetName xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">35 Omar Ebn-ElKhattab –30 ST, 1 Al Zorkani, Sidi Beshr Bahrisssss</cbc:StreetName>
    <cbc:BuildingNumber xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">3203</cbc:BuildingNumber>
    <cbc:CitySubdivisionName xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Alrawdah</cbc:CitySubdivisionName>
    <cbc:CityName xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">27100</cbc:CityName>
    <cbc:PostalZone xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">21614</cbc:PostalZone>
    <cac:Country>
     <cbc:IdentificationCode xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">SA</cbc:IdentificationCode>
    </cac:Country>
   </cac:PostalAddress>
   <cac:PartyTaxScheme>
    <cbc:RegistrationName xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">شركة شبكة عهد لتقنية المعلومات المحدودة</cbc:RegistrationName>
    <cbc:CompanyID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">312312312332313</cbc:CompanyID>
    <cac:TaxScheme>
     <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">VAT</cbc:ID>
    </cac:TaxScheme>
   </cac:PartyTaxScheme>
   <cac:PartyLegalEntity>
    <cbc:RegistrationName xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">شركة شبكة عهد لتقنية المعلومات المحدودة</cbc:RegistrationName>
   </cac:PartyLegalEntity>
  </cac:Party>
 </cac:AccountingSupplierParty>
 <cac:AccountingCustomerParty xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cac:Party>
   <cac:PartyName>
    <cbc:Name xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Antwon Waters</cbc:Name>
   </cac:PartyName>
   <cac:PartyTaxScheme>
    <cbc:RegistrationName xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Antwon Waters</cbc:RegistrationName>
    <cac:TaxScheme>
     <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">VAT</cbc:ID>
    </cac:TaxScheme>
   </cac:PartyTaxScheme>
   <cac:PartyLegalEntity>
    <cbc:RegistrationName xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Antwon Waters</cbc:RegistrationName>
   </cac:PartyLegalEntity>
  </cac:Party>
 </cac:AccountingCustomerParty>
 <cac:Delivery xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:ActualDeliveryDate xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2023-09-02</cbc:ActualDeliveryDate>
 </cac:Delivery>
 <cac:PaymentMeans xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:PaymentMeansCode xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" listID="UN/ECE 4461" listName="Payment Means" listURI="http://docs.oasis-open.org/ubl/os-UBL-2.0-update/cl/gc/default/PaymentMeansCode-2.0.gc">42</cbc:PaymentMeansCode>
  <cbc:PaymentDueDate xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2023-09-02</cbc:PaymentDueDate>
 </cac:PaymentMeans>
 <cac:AllowanceCharge xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:ChargeIndicator xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">false</cbc:ChargeIndicator>
  <cbc:AllowanceChargeReason xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">discount</cbc:AllowanceChargeReason>
  <cbc:Amount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">0.00</cbc:Amount>
  <cac:TaxCategory>
   <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" schemeAgencyID="6" schemeID="UN/ECE 5153">S</cbc:ID>
   <cbc:Percent xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">15.00</cbc:Percent>
   <cac:TaxScheme>
    <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">VAT</cbc:ID>
   </cac:TaxScheme>
  </cac:TaxCategory>
 </cac:AllowanceCharge>
 <cac:TaxTotal xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:TaxAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">300.00</cbc:TaxAmount>
  <cbc:RoundingAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2300.00</cbc:RoundingAmount>
 </cac:TaxTotal>
 <cac:TaxTotal xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:TaxAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">300.00</cbc:TaxAmount>
  <cbc:RoundingAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2300.00</cbc:RoundingAmount>
  <cac:TaxSubtotal>
   <cbc:TaxableAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2000.00</cbc:TaxableAmount>
   <cbc:TaxAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">300.00</cbc:TaxAmount>
   <cbc:Percent xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">15</cbc:Percent>
   <cac:TaxCategory>
    <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" schemeAgencyID="6" schemeID="UN/ECE 5153">S</cbc:ID>
    <cbc:Percent xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">15.00</cbc:Percent>
    <cac:TaxScheme>
     <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">VAT</cbc:ID>
    </cac:TaxScheme>
   </cac:TaxCategory>
  </cac:TaxSubtotal>
 </cac:TaxTotal>
 <cac:LegalMonetaryTotal xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:LineExtensionAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2000.00</cbc:LineExtensionAmount>
  <cbc:TaxExclusiveAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2000.00</cbc:TaxExclusiveAmount>
  <cbc:TaxInclusiveAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2300.00</cbc:TaxInclusiveAmount>
  <cbc:AllowanceTotalAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">0.00</cbc:AllowanceTotalAmount>
  <cbc:PayableAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2300.00</cbc:PayableAmount>
 </cac:LegalMonetaryTotal>
 <cac:InvoiceLine xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
  <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">8950</cbc:ID>
  <cbc:InvoicedQuantity xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" unitCode="PCE">1.00</cbc:InvoicedQuantity>
  <cbc:LineExtensionAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2000.00</cbc:LineExtensionAmount>
  <cac:TaxTotal>
   <cbc:TaxAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">300.00</cbc:TaxAmount>
   <cbc:RoundingAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2300.00</cbc:RoundingAmount>
  </cac:TaxTotal>
  <cac:Item>
   <cbc:Description xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">invoice item 1 test description</cbc:Description>
   <cbc:Name xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">NO PRODUCT</cbc:Name>
   <cac:ClassifiedTaxCategory>
    <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" schemeAgencyID="6" schemeID="UN/ECE 5153">S</cbc:ID>
    <cbc:Percent xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">15.00</cbc:Percent>
    <cac:TaxScheme>
     <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">VAT</cbc:ID>
    </cac:TaxScheme>
   </cac:ClassifiedTaxCategory>
  </cac:Item>
  <cac:Price>
   <cbc:PriceAmount xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" currencyID="SAR">2000.00</cbc:PriceAmount>
   <cbc:BaseQuantity xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" unitCode="PCE">1.00</cbc:BaseQuantity>
  </cac:Price>
 </cac:InvoiceLine>
</Invoice>

The hash we’re using:

SHA-256 Hash: 8a8df39f96cb7eb8ae2ede0776212b8a5cba29348bd55730633192205a87ea0c
Base64 Encoded: io3zn5bLfriuLt4HdiErily6KTSL1VcwYzGSIFqH6gw=

And here’s the request we’re sending:

[POST] https://gw-apic-gov.gazt.gov.sa/e-invoicing/developer-portal/compliance/invoices

Body:
{
    uuid: 3d8b3851-91a6-4da0-84ff-80db2cbd1a99,
    invoiceHash: io3zn5bLfriuLt4HdiErily6KTSL1VcwYzGSIFqH6gw=,
    invoice: <base64-encoded XML of the invoice>
}

Despite the above, we consistently receive the error. Has anyone encountered this issue before, or could provide insights into what might be wrong with our hash calculation or the invoice structure?

Dear @m.ibrahim

Thanks for reaching out,

Can I kindly ask you to send the full request and response and the XML to SP email to ensure comprehensive support as usual.

SP email: sp_support@zatca.gov.sa
E-invoicing@zatca.gov.sa

Thank you.

@m.ibrahim

your xml should look like this

<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
	<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
	<cbc:ProfileID>reporting:1.0</cbc:ProfileID>
	<cbc:ID>sep004558521</cbc:ID>
	<cbc:UUID>3d8b3851-91a6-4da0-84ff-80db2cbd1a99</cbc:UUID>
	<cbc:IssueDate>2023-09-02</cbc:IssueDate>
	<cbc:IssueTime>00:00:00</cbc:IssueTime>
	<cbc:DueDate>2023-09-02</cbc:DueDate>
	<cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode>
	<cbc:Note>english description</cbc:Note>
	<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
	<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>
	<cac:AdditionalDocumentReference>
		<cbc:ID>ICV</cbc:ID>
		<cbc:UUID>62</cbc:UUID>
	</cac:AdditionalDocumentReference>
	<cac:AdditionalDocumentReference>
		<cbc:ID>PIH</cbc:ID>
		<cac:Attachment>
			<cbc:EmbeddedDocumentBinaryObject filename="Previous_Invoice_Hash" mimeCode="text/plain">IcbGN45aIoH5CbHIiWlY7JZJGX3NWlP/chOF1t9/6IQ=</cbc:EmbeddedDocumentBinaryObject>
		</cac:Attachment>
	</cac:AdditionalDocumentReference>
	<cac:AccountingSupplierParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="CRN">312312312332313</cbc:ID>
			</cac:PartyIdentification>
			<cac:PartyName>
				<cbc:Name>شركة شبكة عهد لتقنية المعلومات المحدودة</cbc:Name>
			</cac:PartyName>
			<cac:PostalAddress>
				<cbc:StreetName>35 Omar Ebn-ElKhattab –30 ST, 1 Al Zorkani, Sidi Beshr Bahrisssss</cbc:StreetName>
				<cbc:BuildingNumber>3203</cbc:BuildingNumber>
				<cbc:CitySubdivisionName>Alrawdah</cbc:CitySubdivisionName>
				<cbc:CityName>27100</cbc:CityName>
				<cbc:PostalZone>21614</cbc:PostalZone>
				<cac:Country>
					<cbc:IdentificationCode>SA</cbc:IdentificationCode>
				</cac:Country>
			</cac:PostalAddress>
			<cac:PartyTaxScheme>
				<cbc:RegistrationName>شركة شبكة عهد لتقنية المعلومات المحدودة</cbc:RegistrationName>
				<cbc:CompanyID>312312312332313</cbc:CompanyID>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:PartyTaxScheme>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>شركة شبكة عهد لتقنية المعلومات المحدودة</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingSupplierParty>
	<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PartyName>
				<cbc:Name>Antwon Waters</cbc:Name>
			</cac:PartyName>
			<cac:PartyTaxScheme>
				<cbc:RegistrationName>Antwon Waters</cbc:RegistrationName>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:PartyTaxScheme>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>Antwon Waters</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
	<cac:Delivery>
		<cbc:ActualDeliveryDate>2023-09-02</cbc:ActualDeliveryDate>
	</cac:Delivery>
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>42</cbc:PaymentMeansCode>
		<cbc:PaymentDueDate>2023-09-02</cbc:PaymentDueDate>
	</cac:PaymentMeans>
	<cac:AllowanceCharge>
		<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
		<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
		<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
		<cac:TaxCategory>
			<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">S</cbc:ID>
			<cbc:Percent>15.00</cbc:Percent>
			<cac:TaxScheme>
				<cbc:ID>VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:TaxCategory>
	</cac:AllowanceCharge>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">300.00</cbc:TaxAmount>
		<cbc:RoundingAmount currencyID="SAR">2300.00</cbc:RoundingAmount>
	</cac:TaxTotal>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">300.00</cbc:TaxAmount>
		<cbc:RoundingAmount currencyID="SAR">2300.00</cbc:RoundingAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">2000.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">300.00</cbc:TaxAmount>
			<cbc:Percent>15</cbc:Percent>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">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:LegalMonetaryTotal>
		<cbc:LineExtensionAmount currencyID="SAR">2000.00</cbc:LineExtensionAmount>
		<cbc:TaxExclusiveAmount currencyID="SAR">2000.00</cbc:TaxExclusiveAmount>
		<cbc:TaxInclusiveAmount currencyID="SAR">2300.00</cbc:TaxInclusiveAmount>
		<cbc:AllowanceTotalAmount currencyID="SAR">0.00</cbc:AllowanceTotalAmount>
		<cbc:PayableAmount currencyID="SAR">2300.00</cbc:PayableAmount>
	</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>8950</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">1.00</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">2000.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">300.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">2300.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Description>invoice item 1 test description</cbc:Description>
			<cbc:Name>NO PRODUCT</cbc:Name>
			<cac:ClassifiedTaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">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">2000.00</cbc:PriceAmount>
			<cbc:BaseQuantity unitCode="PCE">1.00</cbc:BaseQuantity>
		</cac:Price>
	</cac:InvoiceLine>
</Invoice>

You can get more sample xml inside Zatca eInvoice SDK. And you can test your xml from CLI command like this

2 Likes

Thank you @eCloud , for your prompt response and the provided XML changes.

After applying the modifications, I encountered the same issue. Upon further investigation, I suspect that the problem may be related to the Base64-encoded XML of the invoice. Specifically, it seems that the hash we generated might need to be incorporated into the XML to resolve the issue.

Could you please confirm if this step is necessary, or if there are any additional considerations we should take into account when handling the Base64-encoded XML?

I would appreciate your insights and any further guidance on this matter.

Thank you for your time and support.

@m.ibrahim
You can see how I use .NET8 Zatca eInvoice SDK library in my project here.
Its Done in Non Production Environment, you can test it on Simulation Environment by using the data you have.

Validation is not possible for now, there is no solution regarding validation issue in .Net Library.

2 Likes