Simulation portal error for compliance

every thing was fine in developer portal but in simulation portal i got one error
The invoice hash API body does not match the (calculated) Hash of the XML.

I am using .net sdk 3.3.5
my step is

load document
Sign document
hash value

what i am missing

Morning @sayedrahman

Thanks for reaching out,

Please note that “invoiceHash” in the request body must be the same Hash in the encoded invoice you are sending, as you can compare the “invoiceHash” from the body with the first “DigestValue” in the XML, they must be the same, otherwise, you will still receive the same error.

Thanks,
Ibrahem Daoud.

1 Like
  • Create Clean Invoice
  • Load Document
  • Sign Document
  • Get RequestApi
  • Send to ZatcaServer.

I can inform you that Zatca.eInvoice.SDK .NET8 library works well for C# Application running on Windows Operating System.

It is interesting, if you use Zatca.eInvoice.SDK to sign Invoice, but you get Error as you mentioned.

Let me share my successful experience using Zatca.eInvoice.SDK to sign Invoice.

Regardless of how InvoiceXML is created, there are some things to notes in using Zatca.eInvoice.SDK to sign Invoice:

We do not need to add Signature and UBLExtension elements to Invoice XML, we only need to create clean invoice xml, the addition of UBL and Signature will be done by Zatca.eInvoice.SDK.

Make sure the Data\Rules\schematrons Folder along with the two xsl files in it are in our Project Directory. Zatca.eInvoice.SDK needs these two files in the Invoice signing process.

Make sure we use the correct Certificate, Decoded base64 CCSID binarySecurityToken for Compliance Check Invoice Api, and Decoded base64 PCSID binarySecurityToken for Clearance Api and Reporting Api.

Do not change the SignedInvoice generated by Zatca.eInvoice.SDK, we only need to create a RequestApi and send it to ZatcaServer.

In the case where we want to get QRCode, and InvoiceHash.

  • For QrCode we can take it from SignedInvoice without having to modify it.
  • And for InvoiceHash, we can get it on the RequestApi generated by Zatca.eInvoice.SDK.

I hope from this explanation you can get an idea for your project.

1 Like

Dear @eCloud
Well explanation, But at zatca signindocument said, QR tag also need to remove. Below is my xml which i am loading in the beginning. Can you tell me, Did i miss anything or add something unnecessary tag or line

<?xml version="1.0" encoding="UTF-8"?>

cbc:ProfileIDreporting:1.0</cbc:ProfileID>
cbc:IDSME00010</cbc:ID>
cbc:UUID8e6000cf-1a98-4174-b3e7-b5d5954bc10d</cbc:UUID>
cbc:IssueDate2022-08-17</cbc:IssueDate>
cbc:IssueTime17:41:08</cbc:IssueTime>
<cbc:InvoiceTypeCode name=“0200000”>388</cbc:InvoiceTypeCode>
<cbc:Note languageID=“ar”>ABC</cbc:Note>
cbc:DocumentCurrencyCodeSAR</cbc:DocumentCurrencyCode>
cbc:TaxCurrencyCodeSAR</cbc:TaxCurrencyCode>
cac:AdditionalDocumentReference
cbc:IDICV</cbc:ID>
cbc:UUID10</cbc:UUID>
</cac:AdditionalDocumentReference>
cac:AdditionalDocumentReference
cbc:IDPIH</cbc:ID>
cac:Attachment
<cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==</cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>

cac:AccountingSupplierParty
cac:Party
cac:PartyIdentification
<cbc:ID schemeID=“CRN”>1010010000</cbc:ID>
</cac:PartyIdentification>
cac:PostalAddress
cbc:StreetNameالامير سلطان | Prince Sultan</cbc:StreetName>
cbc:BuildingNumber2322</cbc:BuildingNumber>
cbc:CitySubdivisionNameالمربع | Al-Murabba</cbc:CitySubdivisionName>
cbc:CityNameالرياض | Riyadh</cbc:CityName>
cbc:PostalZone23333</cbc:PostalZone>
cac:Country
cbc:IdentificationCodeSA</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
cac:PartyTaxScheme
cbc:CompanyID399999999900003</cbc:CompanyID>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
cac:PartyLegalEntity
cbc:RegistrationNameشركة توريد التكنولوجيا بأقصى سرعة المحدودة | Maximum Speed Tech Supply LTD</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingSupplierParty>
cac:AccountingCustomerParty
cac:Party
cac:PostalAddress
cbc:StreetNameصلاح الدين | Salah Al-Din</cbc:StreetName>
cbc:BuildingNumber1111</cbc:BuildingNumber>
cbc:CitySubdivisionNameالمروج | Al-Murooj</cbc:CitySubdivisionName>
cbc:CityNameالرياض | Riyadh</cbc:CityName>
cbc:PostalZone12222</cbc:PostalZone>
cac:Country
cbc:IdentificationCodeSA</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
cac:PartyTaxScheme
cbc:CompanyID399999999800003</cbc:CompanyID>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
cac:PartyLegalEntity
cbc:RegistrationNameشركة نماذج فاتورة المحدودة | Fatoora Samples LTD</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingCustomerParty>
cac:PaymentMeans
cbc:PaymentMeansCode10</cbc:PaymentMeansCode>
</cac:PaymentMeans>
cac:AllowanceCharge
cbc:ChargeIndicatorfalse</cbc:ChargeIndicator>
cbc:AllowanceChargeReasondiscount</cbc:AllowanceChargeReason>
<cbc:Amount currencyID=“SAR”>0.00</cbc:Amount>
cac:TaxCategory
<cbc:ID schemeID=“UN/ECE 5305” schemeAgencyID=“6”>S</cbc:ID>
cbc:Percent15</cbc:Percent>
cac:TaxScheme
<cbc:ID schemeID=“UN/ECE 5153” schemeAgencyID=“6”>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
cac:TaxCategory
<cbc:ID schemeID=“UN/ECE 5305” schemeAgencyID=“6”>S</cbc:ID>
cbc:Percent15</cbc:Percent>
cac:TaxScheme
<cbc:ID schemeID=“UN/ECE 5153” schemeAgencyID=“6”>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:AllowanceCharge>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>30.15</cbc:TaxAmount>
</cac:TaxTotal>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>30.15</cbc:TaxAmount>
cac:TaxSubtotal
<cbc:TaxableAmount currencyID=“SAR”>201.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID=“SAR”>30.15</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 5153” schemeAgencyID=“6”>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
cac:LegalMonetaryTotal
<cbc:LineExtensionAmount currencyID=“SAR”>201.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID=“SAR”>201.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID=“SAR”>231.15</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID=“SAR”>0.00</cbc:AllowanceTotalAmount>
<cbc:PrepaidAmount currencyID=“SAR”>0.00</cbc:PrepaidAmount>
<cbc:PayableAmount currencyID=“SAR”>231.15</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
cac:InvoiceLine
cbc:ID1</cbc:ID>
<cbc:InvoicedQuantity unitCode=“PCE”>33.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID=“SAR”>99.00</cbc:LineExtensionAmount>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>14.85</cbc:TaxAmount>
<cbc:RoundingAmount currencyID=“SAR”>113.85</cbc:RoundingAmount>
</cac:TaxTotal>
cac:Item
cbc:Nameكتاب</cbc:Name>
cac:ClassifiedTaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15.00</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
cac:Price
<cbc:PriceAmount currencyID=“SAR”>3.00</cbc:PriceAmount>
cac:AllowanceCharge
cbc:ChargeIndicatortrue</cbc:ChargeIndicator>
cbc:AllowanceChargeReasondiscount</cbc:AllowanceChargeReason>
<cbc:Amount currencyID=“SAR”>0.00</cbc:Amount>
</cac:AllowanceCharge>
</cac:Price>
</cac:InvoiceLine>
cac:InvoiceLine
cbc:ID2</cbc:ID>
<cbc:InvoicedQuantity unitCode=“PCE”>3.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID=“SAR”>102.00</cbc:LineExtensionAmount>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>15.30</cbc:TaxAmount>
<cbc:RoundingAmount currencyID=“SAR”>117.30</cbc:RoundingAmount>
</cac:TaxTotal>
cac:Item
cbc:Nameقلم</cbc:Name>
cac:ClassifiedTaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15.00</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
cac:Price
<cbc:PriceAmount currencyID=“SAR”>34.00</cbc:PriceAmount>
cac:AllowanceCharge
cbc:ChargeIndicatortrue</cbc:ChargeIndicator>
cbc:AllowanceChargeReasondiscount</cbc:AllowanceChargeReason>
<cbc:Amount currencyID=“SAR”>0.00</cbc:Amount>
</cac:AllowanceCharge>
</cac:Price>
</cac:InvoiceLine>

Yes, if we don’t want to use Zatca.eInvoice.SDK
We have to follow the steps explained in this doc.

If we use Zatca.eInvoice.SDK library, we only need to focus on how to convert our ERP Invoice data into XML. All Signing steps described in the guide will be performed by Zatca.eInvoice.SDK

@idaoud
i checked as you said, and found it its matching, Can you tell me any other reason for that error i having??

if you use Dotnet SDK
Use this code when Load XML file or string to XmlDocument

XmlDocument doc = new XmlDocument();
doc.PreserveWhitespace = true;
doc.LoadXml(xmlInvoice);

2 Likes

@Abdulraouf
Thanks you so much for your reply, I did already,
i tried Canonicalization Also, all i have failed result. I can share my code. If you want to give some of your valuable time. I will appreciate.

@sayedrahman
I tried to fix the xml you sent,
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:ProfileID>reporting:1.0</cbc:ProfileID>
	<cbc:ID>SME00010</cbc:ID>
	<cbc:UUID>8e6000cf-1a98-4174-b3e7-b5d5954bc10d</cbc:UUID>
	<cbc:IssueDate>2022-08-17</cbc:IssueDate>
	<cbc:IssueTime>17:41:08</cbc:IssueTime>
	<cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode>
	<cbc:Note languageID="ar">ABC</cbc:Note>
	<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
	<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>
	<cac:AdditionalDocumentReference>
		<cbc:ID>ICV</cbc:ID>
		<cbc:UUID>10</cbc:UUID>
	</cac:AdditionalDocumentReference>
	<cac:AdditionalDocumentReference>
		<cbc:ID>PIH</cbc:ID>
		<cac:Attachment>
			<cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==</cbc:EmbeddedDocumentBinaryObject>
		</cac:Attachment>
	</cac:AdditionalDocumentReference>
	<cac:AccountingSupplierParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="CRN">1010010000</cbc:ID>
			</cac:PartyIdentification>
			<cac:PostalAddress>
				<cbc:StreetName>الامير سلطان | Prince Sultan</cbc:StreetName>
				<cbc:BuildingNumber>2322</cbc:BuildingNumber>
				<cbc:CitySubdivisionName>المربع | Al-Murabba</cbc:CitySubdivisionName>
				<cbc:CityName>الرياض | Riyadh</cbc:CityName>
				<cbc:PostalZone>23333</cbc:PostalZone>
				<cac:Country>
					<cbc:IdentificationCode>SA</cbc:IdentificationCode>
				</cac:Country>
			</cac:PostalAddress>
			<cac:PartyTaxScheme>
				<cbc:CompanyID>399999999900003</cbc:CompanyID>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:PartyTaxScheme>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>شركة توريد التكنولوجيا بأقصى سرعة المحدودة | Maximum Speed Tech Supply LTD</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingSupplierParty>
	<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PostalAddress>
				<cbc:StreetName>صلاح الدين | Salah Al-Din</cbc:StreetName>
				<cbc:BuildingNumber>1111</cbc:BuildingNumber>
				<cbc:CitySubdivisionName>المروج | Al-Murooj</cbc:CitySubdivisionName>
				<cbc:CityName>الرياض | Riyadh</cbc:CityName>
				<cbc:PostalZone>12222</cbc:PostalZone>
				<cac:Country>
					<cbc:IdentificationCode>SA</cbc:IdentificationCode>
				</cac:Country>
			</cac:PostalAddress>
			<cac:PartyTaxScheme>
				<cbc:CompanyID>399999999800003</cbc:CompanyID>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:PartyTaxScheme>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>شركة نماذج فاتورة المحدودة | Fatoora Samples LTD</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>10</cbc:PaymentMeansCode>
	</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 schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
			<cbc:Percent>15</cbc:Percent>
			<cac:TaxScheme>
				<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:TaxCategory>
		<cac:TaxCategory>
			<cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
			<cbc:Percent>15</cbc:Percent>
			<cac:TaxScheme>
				<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:TaxCategory>
	</cac:AllowanceCharge>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">30.15</cbc:TaxAmount>
	</cac:TaxTotal>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">30.15</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">201.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">30.15</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
				<cbc:Percent>15.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:LegalMonetaryTotal>
		<cbc:LineExtensionAmount currencyID="SAR">201.00</cbc:LineExtensionAmount>
		<cbc:TaxExclusiveAmount currencyID="SAR">201.00</cbc:TaxExclusiveAmount>
		<cbc:TaxInclusiveAmount currencyID="SAR">231.15</cbc:TaxInclusiveAmount>
		<cbc:AllowanceTotalAmount currencyID="SAR">0.00</cbc:AllowanceTotalAmount>
		<cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount>
		<cbc:PayableAmount currencyID="SAR">231.15</cbc:PayableAmount>
	</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">33.000000</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">99.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">14.85</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">113.85</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>كتاب</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">3.00</cbc:PriceAmount>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>
	<cac:InvoiceLine>
		<cbc:ID>2</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">3.000000</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">102.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">15.30</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">117.30</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>قلم</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">34.00</cbc:PriceAmount>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>
</Invoice>

check the <Invoice …> element
Make sure all the required attributes for this element are met.

and how to signing with Zatca.Invoice.SDK in C#, make sure you follow @Abdulraouf sugestion to open the xml Document.

For simulation environment, make sure use your Vat Number, Not
<cbc:CompanyID>399999999900003</cbc:CompanyID>
And use correct Simulation Certificate to signing Document.

1 Like

@eCloud @Abdulraouf @idaoud
Thanks you guys for your support and help, after 3 days of doing all the thing i know, Finally i found my error.by sharing my error and taking your ideas. Its now solve.

Morning @sayedrahman

Thanks for reaching out,

It’s great to hear that your issue resolved now.

Please do not hesitate to reach out for any further assistance.

Thanks,
Ibrahem Daoud.

Dear @idaoud
Appreciate your helping mind,
i need another inormation, If a store change csid with new otp, will icv or pih have to be start from beginning or it will continue??

Thanks in advance

Dear @sayedrahman,

Yes, each CSID should has its own sequence, so if you changed your device/solution

or even revoked it & onboarded it again, then ICV/PIH should start from the beginning as it’s considered as a new device.

thank you,

@sayedrahman Did you got the solution for “invoice hashing errors” ? Appreciating your response

i have same issue. Did you solved? @sayedrahman

@anusv @suhailkk
Yes after Discussion here i got my solution, Please answer, Are you load your xml file?? if you loading your xml file , Please before load added this line
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load(xmlFilePath);
it will tell you in where in xml body it calculating more than your hash

@sayedrahman we already doing this code but same issue exists.

@anusv

share your code sayedrahman63@gmail.com

@sayedrahman Please verify

XmlDocument xDoc = new XmlDocument();
xDoc.PreserveWhitespace = true;
xDoc.LoadXml(xmlInvoice.InnerXml);

string certificateContent = _strX509Certificate;
string privateKeyContent = _strPrivateKey;

SignResult signresult = new SignResult();
EInvoiceSigner Sign = new EInvoiceSigner();
signresult = Sign.SignDocument(xDoc, certificateContent, privateKeyContent);

HashResult resHash = new HashResult();
EInvoiceHashGenerator HashGenerator = new EInvoiceHashGenerator();
resHash = HashGenerator.GenerateEInvoiceHashing(signresult.SignedEInvoice);
string DigestValue1 = resHash.Hash;

FinalJSON Final = new FinalJSON();
Final.invoiceHash = DigestValue1;
Final.uuid = UUID;
Final.invoice = Convert.ToBase64String(Encoding.UTF8.GetBytes(signresult.SignedEInvoice.InnerXml));
var strJson = JsonConvert.SerializeObject(Final);

even this issue exist