Invoices created through the API remain in a Balanced status but fail when released with an error similar to:
Error: Inserting 'GL Transaction' record raised at least one error. Please review the errors. Error: 'Subaccount' cannot be empty
Although the error references the subaccount, the subaccount values are typically valid.
Cause
This issue can occur when an API integration supplies header-level tax data ("Tax Details") that does not match the tax calculated from the invoice lines.
When there is a discrepancy between the header tax values provided by the integration and the line-level tax calculations performed by the tax engine, the invoice can become inconsistent. This may result in release errors, including misleading errors such as 'Subaccount' cannot be empty.
Resolution
The recommended approach is to allow the system to calculate tax automatically rather than supplying header-level tax values through the API.
If your integration currently sends Tax Details, ensure that:
-
The header-level tax amounts exactly match the line-level tax calculations.
-
Header tax overrides are only used when absolutely necessary.
Removing the header-level Tax Details from the API payload and allowing the tax engine to calculate the tax significantly reduces the risk of release errors.
Existing invoices
For invoices that have already been created with inconsistent tax data, the tax must be recalculated before the invoice can be released.
One way to force a recalculation is to:
-
Open the Invoice on AR301000
-
On the Details tab, temporarily change the Tax Category.
-
Save the invoice.
-
Change the Tax Category back to the correct value.
-
Save the invoice again and attempt to release it.
This refreshes the tax calculation and can resolve the inconsistency for existing invoices.