- Create a nexus for the country, with the company’s tax agency and tax accounts.
- Import the standard VAT rates.
- Create any custom VAT rates you need, such as a non-deductible or reverse charge rate.
- Set the company’s VAT registration numbers.
- Turn on the transaction currencies the company invoices or pays in.
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-KEYheader. See authenticating your requests. - Permissions: The API key’s roles grant the permissions listed in Permissions.
- Tax agency: A vendor with
vendor_typetax_agencyexists 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_liabilityorlong_term_liability) and a tax asset account (typeother_current_assetorother_asset). Output VAT posts to the liability account, and reclaimable input VAT posts to the asset account. - Company ID: You have the
idof the company. List companies withGET /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:201 with the nexus. Each company setting gets its own id:
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 withPATCH 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 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:200 with a success response:
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:
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 hasis_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. Setis_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:
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. Settax_type to REVERSE_CHARGE:
201 with the rate, including its id.
VAT rate fields
The VAT rate create fields are listed below. The API returns400 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 withPATCH /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:
- Locked fields: You can’t change
country_code,name,rate,rate_type,tax_type, orvalid_from. The update ignores them if you send them. To change one, create a new rate and setis_activetofalseon the old one. - Clearing a field: Send
nullto clearvalid_to,tax_asset_account_id,tax_liability_account_id,deductible,non_deductible_cost_account_id, orvatex_code. Anullondescription,is_active, oris_non_deductiblechanges nothing. - System rates: On an imported rate (
is_systemistrue), you can changeis_active,valid_to, the tax accounts, and the non-deductible fields. A change todescriptionorvatex_codereturns400. - Accounts: Each account you send must be active. An account you omit can stay inactive.
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 acountry, which is the country the company is registered in for VAT, and a registration_number. Set them with PUT /public/v2/companies/{company_id}/.
First, read the company:
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:
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.
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:is_active is false, toggle the currency to turn it on. The request has no body:
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.
Related pages
- Non-US Taxes: how VAT rates, reverse charge, and non-reclaimable VAT work in the app
- How to Calculate Tax Before Creating an Invoice or Bill: use the VAT rates on records
- Pagination:
limitandoffseton list endpoints