Update a tax configuration

Operation ID: updateTaxConfiguration

Group: Accounting › Tax Configurations

Open in the interactive reference

PATCH /accounting/tax-configurations/{id}

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Updates a tax configuration with the fields you send. A field you leave out keeps its current value.

A lines list you send replaces the whole set of tax codes, so include every tax code you want to keep. A line with an id updates that tax code, and a line without one creates a tax code. An existing tax code that isn't in the list is deleted with its accounts.

The response is empty. Read the updated configuration with GET accounting/tax-configurations/:id.

Parameters

Name In Type Required Description
Api-Version header string · v1 yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.
id path string yes The unique identifier of the tax configuration you want to update. Example: "3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45".

Request body

Required, application/json: updateTaxConfigurationInput.

Field Type Required Description
status any no The new status. Omit to leave it unchanged. One of: "Active", "Inactive". Example: "Inactive".
taxRegime any no The new tax regime. Omit to leave it unchanged. One of: "EU_VAT", "India_GST", "Canada_GST", "Ghana_VAT", "SingleRate_GST", "Mexico_IVA".
lines array<object> no The replacement set of tax codes. Omit to leave every existing tax code unchanged. When supplied it replaces the whole set: a line with an id updates that tax code, a line without one creates a tax code, and any existing line not in the array is deleted with its accounts. Must not be empty when supplied.
lines[].id string no The unique identifier for an existing tax code line to update. Omit to create a new line. An id that does not belong to this configuration fails with LINE_NOT_FOUND.
lines[].taxCode string no The business tax code as printed on source documents, for example 'V19EUG' or 'U00EU'.
lines[].title string yes The display title of the tax code. Must be unique within the configuration.
lines[].comment string no A free-form note on when to use this tax code.
lines[].vatDeclarationField string no The box or boxes on the VAT return that this code feeds, taken verbatim from the tax authority form, for example '66' or '46+47+67'. Stored as free text and not evaluated.
lines[].percentage decimal yes The tax rate, as a decimal fraction. For example, 0.19 is 19%. Send 0 for a zero-rated or exempt code.
lines[].rateType any yes The legal rate classification of the tax code. One of: "Standard", "Reduced", "SuperReduced", "Zero", "Exempt".
lines[].scope any yes The territorial scope of the transaction. One of: "Domestic", "IntraEU_B2B", "IntraEU_B2C", "ExtraEU_Goods", "ExtraEU_Services".
lines[].direction any yes Which side the tax sits on. 'Input' is tax paid on purchases, 'Output' is tax charged on sales. One of: "Input", "Output".
lines[].isReverseCharge boolean yes Whether the recipient rather than the supplier accounts for the tax. When true, every account on the line must set reverseChargeCreditAccountId.
lines[].cashBasis boolean no Cash basis: the tax becomes creditable only when the bill is paid. It posts to the uncollected account and moves to the collected account on payment. Input tax only. Requires components whose accounts all set collectedAccountId.
lines[].isActive boolean yes Whether the tax code is offered for selection on new documents.
lines[].accounts array<object> yes The general ledger accounts this tax code books to, usually one entry for each chart of accounts the entity books in. Must not be empty, including for exempt and zero-rated codes, which book a tax line at zero.
lines[].accounts[].chartOfAccountsId string yes The chart of accounts this mapping applies to. See id on GET accounting/chart-of-accounts/:id.
lines[].accounts[].accountId string yes The account the tax amount is booked to. See id on GET accounting/accounts/:id.
lines[].accounts[].reverseChargeCreditAccountId string no The account credited with the offsetting tax amount. Required on reverse-charge lines, ignored otherwise. See id on GET accounting/accounts/:id.
lines[].components array<object> no The tax components of this code, for example a federal and a state part. Required when cashBasis is true. The components' percentages must add up to the line's percentage.
lines[].components[].taxComponentCode string yes The tax component code, for example 'VAT'.
lines[].components[].percentage decimal yes The component's rate as a decimal fraction, for example 0.16 for 16%.
lines[].components[].isRecoverable boolean yes Whether the tax can be reclaimed. Every component of a cash-basis code must set true.
lines[].components[].accounts array<object> yes The GL accounts for this component, one entry per chart of accounts the entity books in. Must not be empty.
lines[].components[].accounts[].chartOfAccountsId string yes The chart of accounts this mapping applies to. See id on GET accounting/chart-of-accounts/:id.
lines[].components[].accounts[].accountId string yes The account the tax amount is booked to. On a cash-basis code this is the uncollected account. See id on GET accounting/accounts/:id.
lines[].components[].accounts[].reverseChargeCreditAccountId string no The account credited with the offsetting tax amount on a reverse-charge code. See id on GET accounting/accounts/:id.
lines[].components[].accounts[].collectedAccountId string no Cash basis only. The account the tax moves to once the bill is paid. Required on every account of a cash-basis component, and must differ from accountId. See id on GET accounting/accounts/:id.
{
  "status": "Inactive",
  "taxRegime": "EU_VAT",
  "lines": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "taxCode": "<taxCode>",
      "title": "<title>",
      "comment": "<comment>",
      "vatDeclarationField": "<vatDeclarationField>",
      "percentage": "19.99",
      "rateType": "Standard",
      "scope": "Domestic",
      "direction": "Input",
      "isReverseCharge": true,
      "cashBasis": true,
      "isActive": true,
      "accounts": [
        {
          "chartOfAccountsId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "reverseChargeCreditAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
        }
      ],
      "components": [
        {
          "taxComponentCode": "<taxComponentCode>",
          "percentage": "19.99",
          "isRecoverable": true,
          "accounts": [
            {
              "chartOfAccountsId": null,
              "accountId": null,
              "reverseChargeCreditAccountId": null,
              "collectedAccountId": null
            }
          ]
        }
      ]
    }
  ]
}

Response

200 Success

{
  "data": {},
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}

Response headers

Errors

Code Status
NOT_FOUND 400
NO_LINES 400
LINE_NOT_FOUND 400
DUPLICATE_LINE_TITLE 400
DUPLICATE_TAX_CODE 400
LINE_WITHOUT_ACCOUNTS 400
MISSING_REVERSE_CHARGE_ACCOUNT 400
CHART_OF_ACCOUNTS_NOT_FOUND 400
ACCOUNT_NOT_FOUND 400
REVERSE_CHARGE_ACCOUNT_NOT_FOUND 400
COLLECTED_ACCOUNT_NOT_FOUND 400
COMPONENT_WITHOUT_ACCOUNTS 400
COMPONENT_PERCENTAGE_MISMATCH 400
CASH_BASIS_INVALID 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses