I’m using cac:AllowanceCharge to add shipping cost but it gives me an error.
<cac:AllowanceCharge>
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
<cbc:AllowanceChargeReason>shipping</cbc:AllowanceChargeReason>
<cbc:AllowanceChargeReasonCode>SAA</cbc:AllowanceChargeReasonCode>
<cbc:Amount currencyID="SAR">3</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:AllowanceCharge>
Result:
Pass with warning:
Exception: HTTP error: 400 - {"validationResults":{"infoMessages":[],"warningMessages":[],"errorMessages":[{"type":"ERROR","code":"XSD_ZATCA_INVALID","category":"XSD validation","message":"Schema validation failed; XML does not comply with UBL 2.1 standards in line with ZATCA specifications. ERROR: org.xml.sax.SAXParseException; lineNumber: 82; columnNumber: 36; cvc-complex-type.2.4.a: Invalid content was found starting with element '{\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":AllowanceChargeReasonCode}'. One of '{\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":AllowanceChargeReason, \"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":MultiplierFactorNumeric, \"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":PrepaidIndicator, \"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":SequenceNumeric, \"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":Amount}' is expected.","status":"ERROR"}],"status":"ERROR"},"reportingStatus":null,"clearanceStatus":"NOT_CLEARED","qrSellertStatus":null,"qrBuyertStatus":null}
then i removed the tag
cbc:AllowanceChargeReasonCodeSAA</cbc:AllowanceChargeReasonCode>
the result im getting
Exception: HTTP error: 202 - {"validationResults":{"infoMessages":[{"type":"INFO","code":"XSD_ZATCA_VALID","category":"XSD validation","message":"Complied with UBL 2.1 standards in line with ZATCA specifications","status":"PASS"}],"warningMessages":[{"type":"WARNING","code":"BR-KSA-19","category":"KSA","message":"Each Document level charge (BG-21) shall have a code for the reason for document level charge (BT-105).","status":"WARNING"}],"errorMessages":[],"status":"WARNING"},"reportingStatus":null,"clearanceStatus":"CLEARED","qrSellertStatus":null,"qrBuyertStatus":null}