Skip to content

Tax code mismatch

HTTP 422tax_code_mismatch

When the API answers 422 tax_code_mismatch, and how to fix it.

Version v1.1, updated

The type field of every tax_code_mismatch response links to this page.

On this page

With the VAT exemption reason of the invoice, a line would fall under another tax code than the one you sent. errors[].field names the line.

At a glance

  • Status: 422 Unprocessable Content

  • Code: tax_code_mismatch

  • Retry: No. Fix the cause first: the same request gets the same answer.

Causes and fixes

Likely cause

How to fix it

A zero-rate line for an export, an intra-community supply or a reverse charge has no matching vat_exemption_reason.

Set vat_exemption_reason on the invoice to the reason that applies, such as export.

The reason is set, but the line uses a code that does not fit it.

Use the code that fits the reason, from GET /v1/tax-codes.

Example

422 tax_code_mismatchJSON
{
  "code": "tax_code_mismatch",
  "detail": "With this rate and the VAT exemption reason of the invoice, the line would be recorded under another tax code.",
  "errors": [
    {
      "field": "lines[1].tax_code",
      "message": "would be recorded under another tax code; set vat_exemption_reason to match the code"
    }
  ],
  "instance": "/v1/invoices",
  "request_id": "a1b2c3d4-0000-4000-8000-0000000000ee",
  "status": 422,
  "title": "Tax code mismatch",
  "type": "https://birp.io/developers/errors/tax_code_mismatch"
}
  • invoices
  • invoices-resource
  • no-rule-for-date