Skip to main content
A company can’t post VAT until its VAT setup is complete. Through the Public API, you can do that setup without opening the app. The steps, in order, are:
  1. Create a nexus for the country, with the company’s tax agency and tax accounts.
  2. Import the standard VAT rates.
  3. Create any custom VAT rates you need, such as a non-deductible or reverse charge rate.
  4. Set the company’s VAT registration numbers.
  5. Turn on the transaction currencies the company invoices or pays in.
When you finish, the company has a nexus with its tax accounts, the VAT rates it uses, its VAT registration numbers, and its transaction currencies, and it’s ready for invoices, bills, and journal entries with VAT through the API. The nexus, VAT rate, and currency endpoints are available on V2 and V3-alpha. The company update endpoint is also available on V1. For how VAT is calculated and posted in the app, see Non-US Taxes.

Prerequisites

Before you start the VAT setup through the API, confirm the following:
  • API key: Your requests send your organization’s API key in the X-API-KEY header. See authenticating your requests.
  • Permissions: The API key’s roles grant the permissions listed in Permissions.
  • Tax agency: A vendor with vendor_type tax_agency exists for the country’s tax authority, for example HM Revenue & Customs for the UK.
  • Tax accounts: The company has a tax liability account (type other_current_liability or long_term_liability) and a tax asset account (type other_current_asset or other_asset). Output VAT posts to the liability account, and reclaimable input VAT posts to the asset account.
  • Company ID: You have the id of the company. List companies with GET /public/v2/companies/ to find it.

Create a nexus for a company

A nexus is a country, or a country and a region, where your organization owes tax. Each nexus holds a list of company settings: one item for each company that owes tax there, with the company’s tax agency and tax accounts. The following request creates a UK nexus for company 1:
The API returns 201 with the nexus. Each company setting gets its own id:
The request body fields are listed below. Each country and region can have one nexus. To add a second company to a country that already has a nexus, update the nexus instead of creating another one.

Update a nexus

Update a nexus with PATCH to change its description or its company settings. You can’t change country or region. A field you omit or send as null keeps its stored value. When you send company_settings, the list replaces every company setting of the nexus. A company that isn’t in the list loses its setting, and an empty list removes all of them. To add a company, read the nexus first and send back the existing items with the new one. The following request adds company 2 to the UK nexus and keeps company 1:
The nexus endpoints are listed below. The API has no endpoint to archive a nexus. Archive it in the app under Configuration → Tax Setup → Nexuses.

Import the standard VAT rates

DualEntry keeps a standard set of VAT rates for each VAT country: the standard and reduced rates, plus zero-rated, exempt, reverse charge, and out-of-scope rates. Importing adds these rates to your organization, the same as Import VAT Rates in the app. The request has no body:
The API returns 200 with a success response:
The import adds each rate your organization doesn’t have yet, with is_system and is_active set to true. It covers every VAT country at once, not one country. Your existing rates and custom rates stay as they are, and a second import adds nothing, so it’s safe to call again. The response doesn’t include the imported rates. To get their IDs, list the VAT rates for the country:
Use a rate’s id as vat_rate_id on invoice, bill, and journal entry lines. Filter the list with country_code (repeatable), rate_type, tax_type, and is_active. For how DualEntry applies the rate on a record, see How to Calculate Tax Before Creating an Invoice or Bill.

Create a custom VAT rate

Create a custom VAT rate when the imported set doesn’t have the rate you need. A custom rate has is_system set to false and starts active. Write rate and deductible as a fraction from 0 to 1, with up to four decimal places, so 0.2 is 20%.

Create a non-deductible VAT rate

A non-deductible rate records VAT you were charged but can’t reclaim, such as VAT on business entertaining in the UK. Set is_non_deductible to true and send deductible, the part of the VAT you can reclaim. To post the part you can’t reclaim to a specific account, also send non_deductible_cost_account_id, an expense, other_expense, or cost_of_goods_sold account. The following request creates a 20% UK rate with no reclaimable VAT:
A zero-rated, exempt, or out-of-scope rate can’t be non-deductible. When is_non_deductible is false, DualEntry ignores deductible and non_deductible_cost_account_id.

Create a reverse charge VAT rate

A reverse charge rate makes the buyer account for the VAT instead of the supplier. Set tax_type to REVERSE_CHARGE:
Both requests return 201 with the rate, including its id.

VAT rate fields

The VAT rate create fields are listed below. The API returns 400 if a value breaks these rules, or if a rate with the same country_code, name, rate, and valid_from already exists. A rate with no account overrides posts to the tax accounts on the company’s nexus.

Update or deactivate a VAT rate

Update a VAT rate with PATCH /public/v2/vat-rates/{vat_rate_id}/, sending only the fields you want to change. A field you omit keeps its stored value. The following request ends a custom rate on 12/31/2026:
The update rules are:
  • Locked fields: You can’t change country_code, name, rate, rate_type, tax_type, or valid_from. The update ignores them if you send them. To change one, create a new rate and set is_active to false on the old one.
  • Clearing a field: Send null to clear valid_to, tax_asset_account_id, tax_liability_account_id, deductible, non_deductible_cost_account_id, or vatex_code. A null on description, is_active, or is_non_deductible changes nothing.
  • System rates: On an imported rate (is_system is true), you can change is_active, valid_to, the tax accounts, and the non-deductible fields. A change to description or vatex_code returns 400.
  • Accounts: Each account you send must be active. An account you omit can stay inactive.
The VAT rate API has no delete endpoint. To stop using a rate, set is_active to false.

Set a company’s VAT registration numbers

A company’s VAT registration numbers are part of the company record. Each number has a country, which is the country the company is registered in for VAT, and a registration_number. Set them with PUT /public/v2/companies/{company_id}/.
The company PUT is a full update, the same as saving the company form in the app. A field you leave out takes its default value: an omitted address is cleared, and an omitted fiscal_year_end_month resets to 12. Read the company first and send back every field you want to keep.
First, read the company:
Then send the company back with the VAT registration numbers. The required fields are name, currency_iso_4217_code, is_active, and parent_company_id. Also send the fields you read that you want to keep, such as address, tin, tin_type, short_code, brand_color, fiscal_year_end_month, and the default account IDs:
The vat_registration_numbers list works as follows:
  • List sent: The list replaces every VAT registration number of the company. Include the numbers you want to keep.
  • Empty list: Every VAT registration number is removed.
  • Field omitted: The stored numbers stay as they are.
The country is an ISO 3166-1 alpha-2 code, and an unknown code returns 400. The response is the updated company, with each number’s id. gst_registration_numbers works the same way for GST. If your organization’s approved record edit policy doesn’t allow the change, the API returns 422.

Turn on a transaction currency

A transaction currency is a currency other than the company’s base currency that records can use. The setting covers the whole organization, not one company. The currency endpoint is a toggle: each call turns the currency on if it’s off, or off if it’s on. Check the current state first:
The response lists each matching currency and whether it’s on:
If is_active is false, toggle the currency to turn it on. The request has no body:
The API returns 200 with a success response, not the new state. List the currencies again to confirm it. Because the call flips the state, don’t retry it blindly after a timeout: list the currency first. You can’t turn a currency off while it’s the base currency of a company, while a record that isn’t archived uses it, while an active account uses it, or while an item has a price in it. The API then returns 422 with a message that names each reason. The list endpoint takes the is_active, codes (repeatable), search, limit, and offset filters. For how transaction currencies work in the app, see Multi-Currency Setup.

Permissions

Each endpoint needs a permission on the API key’s role. These are the same permissions the app checks for the matching screens. A key without the permission gets 403. A key limited to some companies can update only the companies it can read. For any other company, the company PUT returns 404. If a call returns 403, add a role with the missing permission to the key, or create a new key with the right roles. See How to Give an Integration Access to DualEntry.

Errors

The VAT setup endpoints return the standard error response. The status codes below are the ones specific to these endpoints. For the error response format, see Errors. For the Idempotency-Key header that the create and update endpoints accept, see Idempotency and Write Validation.
Last modified on November 23, 2026