efrisapi.com

Error codes / 1345

EFRIS error 1345 — summary.grossAmount double-counts excise duty

summary.grossAmount must be the sum of every taxDetails gross amount except tax category "05". Excise is already embedded in the standard-rate gross, so including its own line counts it twice.

This is one half of a pair that pulls in opposite directions: taxAmount must include excise (see 1344) while grossAmount must exclude it. Fixing one by symmetry breaks the other.

What it actually means

An excisable sale produces two taxDetails groups: the standard-rate group whose gross already contains the excise, and a separate category "05" group recording the excise itself. Summing all of them therefore counts the excise twice, and URA — which recomputes the summary — rejects the difference.

The fix

Sum gross amounts across every tax category except "05". Derive netAmount from the result so gross = net + tax still holds.

def build_summary(tax_details, goods_details):
    def category(td):
        return str(td.get("taxCategoryCode", ""))

    # taxAmount INCLUDES excise (1344)
    tax = sum(float(td["taxAmount"]) for td in tax_details)

    # grossAmount EXCLUDES category "05" (1345)
    gross = sum(float(td["grossAmount"])
                for td in tax_details if category(td) != "05")

    net = gross - tax                       # keeps 1343 satisfied
    return {
        "netAmount":   f"{net:.2f}",
        "taxAmount":   f"{tax:.2f}",
        "grossAmount": f"{gross:.2f}",
    }

Why this happens

The rule follows from where excise sits in the price. Excise is levied before VAT and is part of the amount VAT is charged on, so the standard-rate gross already contains it. The category "05" line exists to report the excise, not to add it again.

Related


The EFRIS API Kit handles this case already — it is one of the rejections the library was calibrated against. This page stays free either way.