> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dualentry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Anrok Integration: Setup and Sync

> Connect Anrok to DualEntry to calculate US sales tax on sales transactions and record posted invoices, cash sales, and credits in Anrok.

Connect [Anrok](https://www.anrok.com/) to DualEntry so Anrok calculates US sales tax on your sales transactions and keeps a record of every posted document for filing. DualEntry calls Anrok when you enter an invoice, sales order, cash sale, or customer credit, then records posted invoices, cash sales, and customer credits in Anrok so your Anrok returns match your ledger. Nexus monitoring, registrations, exemption certificates, and return filing stay in Anrok.

The integration covers US sales tax only. It does not calculate VAT or GST.

## Prerequisites

Confirm the following before you connect Anrok:

* Each DualEntry company you want to connect has an active Anrok seller account and its own Anrok seller API key. To create a key, follow Anrok's guide to [manage your API keys](https://help-center.anrok.com/hc/en-us/articles/23865490784147-Manage-your-API-keys).
* Product tax categories are enabled in Anrok for the products you sell. If you connect more than one Anrok account, each category is enabled in every account.
* Each DualEntry company you connect has a US address.
* DualEntry has a nexus for every state where you collect tax, under **Configuration > Tax Setup > Nexuses**. DualEntry checks its own nexuses before it calls Anrok and does not import nexuses from Anrok, so set them up in both places. See [US sales tax](https://docs.dualentry.com/accountants/core-financials/tax-management/us-taxes.md) for how nexuses work in DualEntry.
* Each customer you tax has a complete ship-to address, and taxable customers have a **Tax Status** of **Non-Exempt**.
* You have the `integration:edit` permission to connect and sync the integration, and the `product_tax_code:create` permission to add product tax codes. See [User roles and permissions](https://docs.dualentry.com/accountants/platform-configuration/user-roles-and-permissions.md).

> [!NOTE]
>
> DualEntry uses one tax provider at a time for a company. If Avalara AvaTax is connected anywhere in your organization, DualEntry uses Avalara for tax calculation and never calls Anrok. Disconnect Avalara before you rely on Anrok.

## Step 1: Connect Anrok

Connect each DualEntry company to its own Anrok seller account. Each company can have one Anrok connection, so an organization with several companies can connect several Anrok accounts.

1. Navigate to **Configuration > Company > Integrations** and find the **Anrok** tile.
2. Choose **Connect**. The **Connect Anrok** dialog opens.
3. Optionally enter an **Integration Name**. It defaults to **Anrok**.
4. In **Company**, choose the DualEntry company this Anrok account belongs to.
5. Paste the seller key into **API Key**.
6. Choose **Connect**.

DualEntry checks the key with Anrok before it saves the connection and stores the key encrypted. If Anrok rejects the key, DualEntry shows **Failed to connect to Anrok** and saves nothing. When the connection succeeds, DualEntry shows **Anrok connected successfully** and opens your connected integrations.

To connect another company, return to the **Anrok** tile and choose **Connect more**.

## Step 2: Review the connection settings

Review the connection settings before you post anything, because the cut-off date decides which documents DualEntry records in Anrok. Open the Anrok integration page and choose **Settings** to open the **Anrok Settings** drawer.

The table below lists the settings and the defaults DualEntry sets when you first connect:

| Setting | Default | What it controls |
| - | - | - |
| **Initial Cut Off Date** | The date you connected | Documents dated before this date are never recorded in Anrok. Anrok still calculates tax on them. |
| **Allow push data** | On | Records posted documents in Anrok, and exports unmatched customers and items to Anrok during a sync. |
| **Allow pull data** | On | Pulls Anrok products and customers into DualEntry during a sync. Exports also need this setting, because DualEntry exports only after it pulls. |

Set **Initial Cut Off Date** to your go-live date if you don't want earlier documents recorded in Anrok, then choose **Save changes**.

The **Danger Zone** at the bottom of the drawer has **Pause** and **Disconnect**. If you disconnect and connect again, DualEntry creates a new connection with default settings, a new cut-off date, and no mappings.

## Step 3: Create Anrok product tax codes

Anrok product tax codes tell Anrok how to tax each item. Create one in DualEntry for each Anrok product tax category you use, then assign it to your items.

1. Navigate to **Configuration > Tax Setup > Product Tax Codes** and choose **New tax code**.
2. In the **Create Product Tax Code** drawer, set **Source** to **Anrok**.
3. In **Code**, search for an Anrok product tax category by code or name, and pick it. The list shows only categories that every connected Anrok account has. **Description** fills in from the category name.
4. Choose **Create**. DualEntry checks the code with Anrok before it saves it.
5. On each item you sell, set **Product Tax Code** to the matching Anrok code.

An item needs an Anrok product tax code before DualEntry can export it to Anrok in the next step. For how product tax codes work in DualEntry, see [US sales tax](https://docs.dualentry.com/accountants/core-financials/tax-management/us-taxes.md).

## Step 4: Sync and map products and customers

Anrok calculates tax on a document only when every item and the customer on it are mapped to Anrok records. A sync pulls your Anrok products and customers, matches them to DualEntry items and customers, and exports anything unmatched.

On the Anrok integration page, choose **Initial sync**. Later, the same button reads **Sync** or **Resync**. When the sync finishes, the page shows the **Products mapping** and **Customers mapping** tabs next to **Data Sync**.

### Map products to items

The sync matches each Anrok product to a DualEntry item in this order:

1. The DualEntry item ID that DualEntry stored on the Anrok product when it exported the item.
2. An item whose SKU equals the Anrok product's external ID.
3. An active item with exactly the same name.

When nothing matches, the product stays unmapped with the message `No item has this product SKU or name. Map the product manually.` When several items or Anrok products share a name, both stay unmapped. The sync never creates items in DualEntry.

With **Allow push data** on, the sync exports each active item that has an Anrok product tax code and no Anrok product, and maps it. Archived, draft, and inactive items are never exported. Map anything left over on the **Products mapping** tab.

### Map customers

The sync matches each Anrok customer to an active customer of the connected company, first by ID and then by exact name. With **Allow push data** on, it exports unmatched active customers of that company to Anrok, with their name and email, and maps them. Archived, draft, and inactive customers are never exported.

Map remaining customers on the **Customers mapping** tab. The customer list shows only customers available to the connected company, and each customer can map to only one Anrok customer. Anrok applies its own exemption certificates to the mapped Anrok customer, so map every customer that has an exemption.

Check both tabs after you add new items or customers. An unmapped item or customer does not cause an error: DualEntry calculates tax with its native engine instead.

## When DualEntry uses Anrok to calculate tax

DualEntry calls Anrok on invoices, sales orders, cash sales, and customer credits for a company connected to Anrok. It also calls Anrok when you choose **Calculate tax** on a quote. Lines Anrok prices carry the **Anrok** tax code.

DualEntry calls Anrok only when every input is in place. The table below shows what happens in each case:

| Condition | Result |
| - | - |
| US ship-to and ship-from, a DualEntry nexus for the ship-to state, and every item and the customer mapped | Anrok calculates tax. |
| Ship-to or ship-from outside the US | DualEntry's native engine calculates tax. Nothing is sent to Anrok. |
| Any item or the customer not mapped | DualEntry's native engine calculates tax for the whole document. |
| No DualEntry nexus for the ship-to state | No sales tax. |
| Customer **Tax Status** is **Exempt** and the customer has no **Tax Exemption Code** | No sales tax. |
| Missing transaction date, currency, or ship-to address | No tax calculation. |
| Anrok returns an error for a taxable customer | The calculation fails with an error. DualEntry does not fall back to its native engine. |

When you save a document, its Anrok tax estimate appears on the **Tax Calculation Logs** page as **Anrok Tax Estimate**, and each record and void appears as **Anrok Commit (Create/Update)** or **Anrok Void**. To open it from the integration page, choose **More actions > Tax Calculation Logs**. The page lists entries from every tax provider in your organization, not only Anrok.

## What DualEntry records in Anrok

DualEntry records posted invoices, cash sales, and customer credits in Anrok so your Anrok filings match your ledger. It records a document only when it has at least one line with the **Anrok** tax code, is dated on or after the cut-off date, and **Allow push data** is on.

The table below shows what Anrok receives as you change a document in DualEntry:

| You do this in DualEntry | Anrok receives |
| - | - |
| Post an invoice, cash sale, or customer credit | The transaction is recorded. |
| Edit and save a posted document | The same transaction is updated. |
| Archive a posted document | The transaction is voided. |
| Recover an archived document | The transaction is recorded again, if it still qualifies. |
| Edit a posted document so no **Anrok** line remains, or move its date before the cut-off | The recorded transaction is voided. |
| Post a customer credit | The transaction is recorded with negative amounts. |

DualEntry never sends drafts. Sales orders get Anrok tax but are not recorded in Anrok; the invoice you create from a sales order is. If you turn **Allow push data** off, DualEntry stops recording new documents but still voids recorded documents that you archive or that stop qualifying.

## Current limitations

Keep these limits in mind before you rely on the integration:

* **US sales tax only**: DualEntry never sends a transaction with a non-US ship-to or ship-from address to Anrok, even if your Anrok account has VAT set up. For VAT and GST, use DualEntry's [native tax rates](../../core-financials/tax-management/index).
* **Sales transactions only**: Bills and other purchase transactions are not taxed or recorded through Anrok.
* **No nexus import**: Nexuses and registrations live in Anrok. DualEntry keeps its own nexuses, which you maintain separately.
* **One provider at a time**: If Avalara AvaTax is connected anywhere in your organization, DualEntry uses Avalara instead of Anrok.
* **Mapping is required**: One unmapped item or an unmapped customer sends the whole document to DualEntry's native engine, without an error.
* **No item creation from Anrok**: The sync matches Anrok products to existing items. It never creates items.
* **Edits after filing**: Once Anrok locks a transaction for filing, later edits to the document in DualEntry don't reach Anrok.
* **Pause and disconnect**: While the connection is paused or disconnected, DualEntry calculates tax with its native engine and doesn't void documents you archive in Anrok.
* **Rate limits**: Anrok limits how fast DualEntry can send requests. A large first sync can stop exporting partway with a rate limit error. Choose **Resync** to export the rest.

## Troubleshoot the Anrok integration

The table below lists common problems and how to fix them:

| What you see | Likely cause | What to do |
| - | - | - |
| **Failed to connect to Anrok** with `Anrok rejected the API key. Check the seller key and try again.` | Anrok rejected the API key. | Copy a valid seller API key from Anrok and connect again. |
| **Failed to connect to Anrok** with a message that the company already has an Anrok connection | The company is already connected to Anrok. | Use the existing connection, or disconnect it first. |
| Tax on a document doesn't carry the **Anrok** tax code | An item or the customer is not mapped, or an address is outside the US. | Map the item and customer, then recalculate tax. Non-US addresses always use DualEntry's native engine. |
| A document gets no sales tax at all | DualEntry has no nexus for the ship-to state. | Add the nexus under **Configuration > Tax Setup > Nexuses**. |
| A customer's exemption isn't applied | The customer is not mapped to its Anrok customer. | Map the customer on the **Customers mapping** tab and recalculate tax. |
| A product stays unmapped after a sync | No item has that SKU or name, or several items or products share the name. | Map it on the **Products mapping** tab. |
| Saving a product tax code fails with `Not every connected Anrok account has a product tax category with this code. Pick a category from the Anrok list.` | The category is missing from one of your connected Anrok accounts. | Enable the category in every connected Anrok account. |
| Saving a product tax code fails with `Connect Anrok before you add or change an Anrok product tax code.` | No Anrok connection is active. | Connect Anrok, then save the code again. |
| A sync step fails with `Items not exported to Anrok` or `Customers not exported to Anrok` | Anrok refused a record or limited the request rate. | Fix any record named in the error, then choose **Resync**. |
| A document never appears in Anrok | The document is a draft, is dated before the cut-off date, has no **Anrok** line, or **Allow push data** is off. | Check the cut-off date and **Allow push data** in the **Anrok Settings** drawer. |
| A document shows `The customer has no Anrok customer. Map the customer to an Anrok customer, then save the document again.` | The customer was unmapped when the document was recorded. | Map the customer, then edit and save the document. |

## Result

After you complete these steps, Anrok calculates US sales tax on invoices, sales orders, cash sales, and customer credits for each connected company, and every posted invoice, cash sale, and customer credit is recorded in Anrok for filing. To compare tax providers, return to the [Tax integrations overview](./index). To set up DualEntry's native tax rates and nexuses, see [Tax Management](../../core-financials/tax-management/index).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.