Simplified invoices rejected in compliance check

Dear ZATCA Support Team,

I’m trying to send simplified invoices for compliance check, but i receive these errors:

{
“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-98”,
“category”: “KSA”,
“message”: “[BR-KSA-98] - The simplified invoice should be submitted within 24 hours of issuing the invoice.”,
“status”: “WARNING”
}
],
“errorMessages”: [
{
“type”: “ERROR”,
“code”: “QRCODE_INVALID”,
“category”: “QRCODE_VALIDATION”,
“message”: “Failed to validate QR code”,
“status”: “ERROR”
},
{
“type”: “ERROR”,
“code”: “invalid-certificate”,
“category”: “CERTIFICATE_ERRORS”,
“message”: “Production CSID is not valid”,
“status”: “ERROR”
},
{
“type”: “ERROR”,
“code”: “invalid-certificate”,
“category”: “CERTIFICATE_ERRORS”,
“message”: “Production CSID format is not valid”,
“status”: “ERROR”
}
],
“status”: “ERROR”
},
“reportingStatus”: “NOT_REPORTED”,
“clearanceStatus”: null,
“qrSellertStatus”: null,
“qrBuyertStatus”: null
}

**i send the standard invoices correctly, but this issue appear in simplified invoices only

here is what i do:
**
first i generate csr:
var generateCsrResult = CsrService.TryGenerateCsr(jwtClaims, Production);
this is the function:

public static (bool IsValid, string? ErrorMessage, CsrResult? csrResult) TryGenerateCsr(JwtClaims jwtClaims, bool production)
{
var generateRes = GetCsrGenerateData(jwtClaims);
if(generateRes.ResultType != enResultType.Ok)
{
return (false, generateRes.ErrorMessage, null);
}

CsrGenerationDto dto = new CsrGenerationDto(
    $"yusrsys-{Guid.NewGuid().ToString()}-{generateRes.Result.VatNumber}",
    $"1-yusrsys|2-1.0.0|3-{Guid.NewGuid().ToString()}",
    generateRes.Result.VatNumber,
    generateRes.Result.BranchName,
    generateRes.Result.CompanyName,
    "SA",
    "1100", // 1100 = Standard + Simplified, 1000 = Standard only, 0100 = Simplified only
    generateRes.Result.CompanyAddress,
    generateRes.Result.CompanyBusinessCategory
);
CsrGenerator gen = new CsrGenerator();
CsrResult csrResult = gen.GenerateCsr(dto, production? EnvironmentType.Production : EnvironmentType.Simulation, false);

if (!csrResult.IsValid)
{
    return (false, csrResult.ErrorMessages[0] ?? string.Empty, null);
}

SqlResult<bool> storeResult = StoreCsr(jwtClaims, csrResult);

if (storeResult.ResultType != enResultType.Ok)
{
    return (false, storeResult.ErrorMessage, null);
}

return (true, null, csrResult);

}

  1. then i try to generate compliance csid:
    complianceCsidResult = await CsidService.TryRequestComplianceCsidAsync(OTP, generateCsrResult.csrResult!, Production);
private static readonly HttpClient httpClient = new HttpClient
{
    BaseAddress = new Uri("https://gw-fatoora.zatca.gov.sa/e-invoicing/"),
    Timeout = TimeSpan.FromSeconds(30)
};

public static async Task<(bool IsValid, string? ErrorMessage, CsidRespone? CsidResponse)> TryRequestComplianceCsidAsync(string otp, CsrResult csrResult, bool Production)
{
string endpoint = Production
? “core/compliance”
: “simulation/compliance”;

using var request = new HttpRequestMessage(HttpMethod.Post, endpoint);
request.Headers.Add("OTP", otp);
request.Headers.Add("Accept-Version", "V2");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

var payload = new { csr = csrResult.Csr };
var json = JsonSerializer.Serialize(payload, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
request.Content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await httpClient.SendAsync(request);
var resultJson = await response.Content.ReadAsStringAsync();

if (!response.IsSuccessStatusCode)
{
    return (IsValid: false, ErrorMessage: $"ZATCA Error: {response.StatusCode} - {resultJson}", CsidResponse: null);
}

CsidRespone? result = JsonSerializer.Deserialize<CsidRespone>(resultJson, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });

if (result == null)
{
    return (IsValid: false, ErrorMessage: "Failed To Parse Json Respone", CsidResponse: null);
}

return (IsValid: true, ErrorMessage: null, CsidResponse: result);

}

What should I do? Can anyone explain why I got this result please? @Ankit.K.Tiwari @Aturkistani @idaoud

any help please? i can’t solve these issues