We are encountering an Internal-Error while reporting a specific invoice using ZATCA e-invoicing APIs. This issue is observed in both Simulation and Production environments.
The error being received is as below:
{
“Message”: “System failed to process your request”,
“Code”: “Internal-Error”,
“Reason”: “Handler dispatch failed: java.lang.OutOfMemoryError: Java heap space”
}
Details:
The issue occurs only for a specific invoice.
Other invoices are processed successfully using the same integration and flow.
The failing invoice:
Passes schema and local validations.
Has a payload size well below 1 MB.
Consistently fails with the same error on retries.
The error is a JVM heap space exception, returned directly from the ZATCA backend, with no business or validation error details.
Since the issue occurs in Production, this blocks reporting of a valid invoice and cannot be mitigated via retries. There is no actionable feedback to correct or adjust the invoice from the client side.
Clarification Requested:
Are there invoice-structure-specific constraints (other than payload size) that could trigger this error like Invoice line count, length of individual text fields, tax or allowance/charge structures?
Is this a known issue affecting certain invoice patterns?
Is there any recommended way to pre-validate or detect unsupported invoice structures before submission?
How should such failures be handled from a compliance perspective when they occur in Production?
Any guidance on resolution or escalation would be appreciated, as this directly affects production reporting.
We have shared the requested details and sample XMLs with the SP team via email for further investigation.
We have reached out from the following email address: anandmohan@mastersindia.co
The mail header is : Simulation API OutOfMemoryError for a Specific Invoice (Payload < 1 MB)
Please let us know if any additional information is required from our side.
We shared all the requested details and sample XMLs with the SP team via sp_support@zatca.gov.sa as advised.
The communication was sent from anandmohan@mastersindia.co with the subject:
“Simulation API OutOfMemoryError for a Specific Invoice (Payload < 1 MB)”
At this point, we have not yet received an acknowledgement or response from the SP team.
Since this issue also impacts Production reporting and blocks submission of a valid invoice, we would appreciate any update on the investigation status or confirmation that the case is being reviewed.
Please let us know if any additional inputs are required from our side.