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

# Anrok

Anrok is a tax engine. When a Zenskar invoice line is set to use Anrok, Zenskar
gets its tax from Anrok and, on approval, records the invoice in Anrok as a
transaction it can file from.

## Concepts

### What Zenskar and Anrok each own

| Zenskar sends | Anrok owns |
| :- | :- |
| Line amounts, ship-from and ship-to addresses, a tax category per line, currency, and any customer tax ID | The rates, the jurisdiction boundaries, and which jurisdictions you are registered to collect in (**nexus**) |

Nexus and the tax-category catalog live in your Anrok account. Zenskar does not
manage them.

> [!WARNING]
>
> If you are not registered to collect in a jurisdiction in Anrok, lines in that
> jurisdiction come back **untaxed, marked "not collecting"** rather than as an
> error. This is the most common reason tax "came back as zero." Register the
> jurisdictions where you collect tax in Anrok before relying on the integration.

> [!NOTE]
>
> As of this version, the **Anrok** card under Integrations is enabled only for
> organizations Zenskar has turned it on for. Otherwise the card is still shown,
> but disabled and marked "coming soon." Ask Zenskar to turn Anrok on for your
> organization if you need it.

### Anrok tax categories

Anrok classifies what a line is selling by **tax category**, picked from a
list rather than typed, drawn from your connected Anrok account's own
catalog rather than a Zenskar one you set up in advance. The list is fetched
live every time the dropdown opens. The category is set on a **Tax** feature
on a plan, contract, or product (see [Assign an Anrok tax
category](#assign-an-anrok-tax-category)); there's no separate mapping step.

A line also needs to resolve to a single product Anrok can identify in its own
catalog: a line-level tax inherits the line's product, and a whole-invoice tax
(with no product of its own) is registered under a stable synthetic reference
so it still resolves. A tax feature with no product it can attach to (for
example, applied to a bundle) is refused when the plan or contract is
published.

### When Zenskar calls Anrok

| Moment | What happens | Stored in Anrok |
| :- | :- | :- |
| Invoice draft or preview | Anrok calculates the tax so the amount is visible before approval | No |
| Invoice approval | The invoice is recorded as a transaction that counts toward your reporting and filing | Yes |
| Credit note issued | A refund is reported against the original transaction | Yes |

Recording is idempotent: Zenskar keys the Anrok transaction on the invoice ID
(`zenskar:<invoice id>`), so retrying or re-approving an invoice updates the
same Anrok transaction instead of creating a duplicate. There is no separate
commit step.

The tax engine for a line is whatever **Tax Type** its feature has, baked
into the plan or contract's published workflow when you publish or
re-publish it. If an already-generated invoice's engine is no longer
connected for that entity, Zenskar blocks invoice generation, naming the
fix: connect the missing engine again, or regenerate the invoice with a tax
engine that's connected. Regenerating alone replays the same published
workflow, so to actually switch engines, change the feature's **Tax Type**
and re-publish the plan or contract first, then regenerate.

```mermaid theme={null}
sequenceDiagram
    participant Z as Zenskar
    participant A as Anrok

    Note over Z,A: Invoice draft or preview
    Z->>A: Estimate (line amounts, addresses, tax categories, customer tax ID)
    A-->>Z: Tax per jurisdiction, and a reason for any untaxed line
    Note right of Z: Shown on the invoice as an estimate.<br/>Nothing stored in Anrok.

    Note over Z,A: Invoice approval
    Z->>A: createOrUpdate transaction, keyed zenskar:<invoice id>
    A-->>Z: Recorded transaction
    Note right of Z: Anrok ID appears on the invoice Integrations tab.

    Note over Z,A: Credit note
    Z->>A: Negation (full) or pro-rated negative lines (partial)
    A-->>Z: Refund transaction recorded
```

> [!NOTE]
>
> Anrok authenticates with a single **API key** per seller account, and each
> connection binds **one Zenskar business entity** to it. If you
> connect more than one Anrok account, the **Tax Category** picker used
> everywhere in the product and price UI reads categories from only the first
> connection created, so a second connection isn't usable for that yet.

> [!WARNING]
>
> A business entity can have only one third-party tax engine connected at a
> time. If Avalara is already connected to this entity, Zenskar rejects the
> Anrok connection until Avalara is disconnected. See [When Zenskar calls
> Anrok](#when-zenskar-calls-anrok) for what happens to a plan or contract
> already relying on Anrok if it's later disconnected.

### Integration scope boundary

| In scope | Detail |
| :- | :- |
| Tax calculation on draft and preview | Anrok calculates the tax so the amount is visible before approval. |
| Tax calculation and recording on approval | The invoice is recorded as a transaction in Anrok. |
| Refunds on credit notes | A refund is reported against the original transaction. |

| Out of scope | Detail |
| :- | :- |
| Filing or remitting returns | Anrok records transactions; filing and remittance are configured and monitored in Anrok, not Zenskar. |
| Exemption-certificate management | Zenskar passes the customer's tax ID; certificates are managed in Anrok. |
| Nexus and tax-category catalog management | Both are configured in your Anrok account. |
| Reading Anrok records into Zenskar | Only the calculation result and a transaction reference are kept. |
| Line descriptions | Anrok has no line-description field, so descriptions are not sent. |
| Purchase-side or use tax, and nexus registration | Not handled by the integration. |

### How Zenskar tells tax engines apart

A tax feature's **Tax Type** is the only thing that routes a line to
**Anrok**, **Avalara**, or **Manual**. Nothing else on the plan, contract,
or product decides it.

> [card] [Tax engine comparison](https://zenskar.com/docs/20240301/third-party-integrations/tax-automation/tax-engine-comparison.md)
>
> Compares **Manual**, **Avalara**, and **Anrok** on rate source, address
> handling, exemptions, and credit notes.

***

## How-to guides

### Connect an Anrok account

Do this once per Anrok account you bill from.

#### Prerequisites

* An Anrok account with an
  [**API key**](https://apidocs.anrok.com/tutorials/#create-an-api-key).
* A Zenskar business entity to assign the connection to.
* Anrok enabled for your organization (see the [Concepts](#concepts) note).

#### Steps

1. In the Zenskar sidebar, open **More > Integrations**. On the
   **Integrations** page, choose the **Sales Tax** category and click
   **CONNECT** on the **Anrok** card.

   ![Sales Tax category on the Integrations page, Anrok card](https://assets.zenskar.com/20240301/sales-tax-anrok-integrations-card.png)

2. On the Anrok connector page, click **CONNECT TO ANROK**. (Once a
   connection exists, this button reads **NEW CONNECTION**.)

   ![The Anrok connector page](https://assets.zenskar.com/20240301/sales-tax-anrok-connector-overview.png)

3. Paste your Anrok **API key**, then click **Connect**.

   ![The Anrok connection form](https://assets.zenskar.com/20240301/sales-tax-anrok-connect-form.png)

   Zenskar validates the key against Anrok before saving the connection.

4. Zenskar creates the connection and opens **Anrok Setup**. Pick the entity
   this Anrok account bills for from **Select Zenskar Entity**, then click
   **SAVE & CONTINUE**.

   ![The Anrok Setup screen, with Select Zenskar Entity](https://assets.zenskar.com/20240301/sales-tax-anrok-setup-connect-step.png)

   Zenskar finishes the setup and returns you to the **Connections** tab,
   where the connection now shows **Configured**. See [Behavior on an
   unresolvable address](#behavior-on-an-unresolvable-address) for how
   Zenskar handles an address Anrok can't resolve; it isn't set here.

   ![A configured Anrok connection](https://assets.zenskar.com/20240301/sales-tax-anrok-connection-configured.png)

> [!NOTE]
>
> If you leave Anrok Setup without picking a business entity, the connection
> stays **Pending Configuration** on the **Connections** tab, showing the banner
> *Business Entity is not configured for this connection. Configure now to
> enable adding new connections.* Click **Select Business Entity** there to
> return to Anrok Setup. You cannot add another Anrok connection until every
> existing connection has an entity.
>
> ![A connection pending configuration on the Connections tab](https://assets.zenskar.com/20240301/sales-tax-anrok-connection-pending-configuration.png)

***

### Assign an Anrok tax category

Anrok categories are picked directly on the tax feature; there's no separate
mapping step.

**Plans and contracts**

1. Open the plan or contract and open its **Configure Features** panel.
2. Click **ADD FEATURE** and choose **Tax**, or expand the existing **Tax**
   feature.
3. Set **Tax Type** to **Anrok**. This option is always offered, whether or
   not an Anrok connection exists yet; if you publish the plan or contract
   without one, tax calculation fails at that point rather than the feature
   being blocked here.
4. In **Tax Category**, pick from the dropdown. It's fetched live from your
   connected Anrok account.
5. Click **SAVE**.

   ![The Tax feature with Tax Type set to Anrok](https://assets.zenskar.com/20240301/sales-tax-anrok-contract-tax-feature.png)

**Products**

1. Open the product's **Price Details** section, and click **+ ADD NEW PRICE**,
   or **Edit** on an existing price.
2. Click **ADD FEATURE** and choose **Tax**, or expand the existing **Tax**
   feature.
3. Set **Tax Type** to **Anrok**. This option is always offered, whether or
   not an Anrok connection exists yet; if you publish without one, tax
   calculation fails at that point rather than the feature being blocked here.
4. In **Tax Category**, pick from the dropdown. It's fetched live from your
   connected Anrok account.
5. Click **SAVE**.

The feature then appears in the **Features** section under a **Taxes** tag,
showing the feature's label alongside **Anrok - `<code>`**.

> [!NOTE]
>
> Switching **Tax Type** away from **Anrok** clears the **Tax Category**. If a
> category a price already uses is later renamed or removed in Anrok, Zenskar
> keeps showing it labelled **(not in Anrok)** rather than silently dropping it.

***

### Record a customer's tax ID

For EU business customers, a VAT ID lets Anrok apply reverse charge, so the B2B
lines are zero-rated. Record it on the customer.

1. Open the customer and go to its **Tax Information** section, under
   **Edit Customer**. A note here reads *"Some fields have been moved to
   custom attributes section."*
2. Choose the **TAX ID** country and enter the **VAT ID** (or other tax
   registration number).
3. Save.

   ![The customer Tax Information section](https://assets.zenskar.com/20240301/sales-tax-anrok-customer-tax-information.png)

Zenskar sends this tax ID with every transaction for that customer. Only one
tax ID is supported per customer. Once saved, the customer's read-only view
labels the same information differently: **Tax Code** for the country and
code together, **Tax ID** for the number itself.

![The same tax information on the customer's read-only view, labeled Tax Code and Tax ID](https://assets.zenskar.com/20240301/sales-tax-anrok-customer-tax-readonly.png)

The `exempt_tax` custom attribute is not read for Anrok, it only affects
Zenskar's own tax engine. Zenskar has no exemption-number or exemption-reason
field for Anrok.

To exempt a specific customer from Anrok tax (for example, a US resale
certificate), handle it in Anrok directly. Anrok auto-creates the customer on
first transaction using an internal Zenskar identifier plus the customer's
name and email; that identifier isn't shown anywhere in Zenskar's UI, so
search for the customer in Anrok's dashboard by name or email rather than by
ID, and add the exemption certificate there.

***

### Check the Anrok transaction on an invoice

The **Integrations** tab appears on an invoice only after it is approved.

1. Open an approved invoice and go to its **Integrations** tab (next to
   Invoice, Payments, Credit Notes, Sent Emails, and Journal Entries).
2. **Linked Integration Objects** shows an **Anrok ID** card with the Anrok
   transaction ID (copyable), in the form `zenskar:<invoice id>`.
3. **Integration Logs** below it lists each sync event for the invoice (event
   type, direction, status such as **Committed** or **Success**, and a
   timestamp) rather than a per-line breakdown. Expanding a failed row shows
   an additional error line, but it's a generic connector error message, not
   guaranteed to name a tax-specific reason. Anrok's untaxed reasons and the
   per-jurisdiction amounts are not otherwise shown anywhere in this tab.
4. **Sync** re-runs the integration for the invoice. This upserts the same
   Anrok transaction; it never creates a second one.

   ![The Integrations tab on an approved invoice](https://assets.zenskar.com/20240301/sales-tax-anrok-invoice-integrations-tab.png)

The same events also appear on the connector's own **Logs** tab (**More >
Integrations > Sales Tax > Anrok > Logs**), across every invoice rather than
just one, alongside other sync events such as **Contract Sync**.

![The Anrok connector's Logs tab](https://assets.zenskar.com/20240301/sales-tax-anrok-connector-logs.png)

To see the same record on Anrok's side, search Anrok's **Transactions** list
for the **Anrok ID** (`zenskar:<invoice id>`). The row shows the customer,
jurisdiction, sales amount, tax amount, and invoice amount, matching the
invoice total in Zenskar.

![The matching transaction in Anrok's Transactions list](https://assets.zenskar.com/20240301/sales-tax-anrok-console-transactions.png)

***

### Issue a credit note against an Anrok-taxed invoice

Create the credit note on the invoice as you normally would (**ISSUE CREDIT
NOTE**, on the invoice header). Zenskar reports the refund to Anrok
automatically, against the invoice's original transaction:

* A full credit note is recorded as a negation of the original transaction.
* A partial credit note is recorded as a new, negative, pro-rated transaction,
  rebuilt from the original invoice's stored request.

Either way the refund is taxed at the original invoice's date. The refund's
**Anrok ID** appears on the credit note's own **Integrations** tab, the same
layout as an invoice's. The original invoice must already be recorded in
Anrok, you cannot refund a refund, and a transaction Anrok has already
included in a filed return can only be reversed with a credit note, not
edited.

***

### Disconnect Anrok

1. Open **More > Integrations > Sales Tax > Anrok** and go to the
   **Connections** tab.
2. Click **Disconnect** on the connection.
3. In the confirmation dialog, which warns that all resource mappings will be
   deleted, click **Delete**.

Zenskar removes the connection and shows **Anrok disconnected**. This clears
the invoice-to-Anrok-transaction and product-to-Anrok links Zenskar kept for
this connection; past invoices' **Anrok ID** may no longer resolve on their
**Integrations** tab afterward, though the transaction itself still exists in
Anrok. Reconnecting requires re-entering the API key and reassigning a
business entity.

> [!NOTE]
>
> Anrok has no Pause, Resume, or Re-authenticate action. Those are available only
> for the ERP connectors (NetSuite, Xero, Zoho, Rillet, QuickBooks).

***

## Reference

### Connection form fields

Shown in the connect form in this order:

| Field | Required | Notes |
| :- | :- | :- |
| **API Key** | Yes | Your Anrok seller API key. Password field. Validated against Anrok at connect time. One key covers sandbox and production; the key determines the account. There is no company code. |

### Behavior on an unresolvable address

Not a configurable setting. When Anrok cannot resolve an address on an
invoice, Zenskar always ignores tax on the line and generates the invoice.

### How a Zenskar action maps to an Anrok transaction

| Zenskar action | Anrok transaction | Stored in Anrok |
| :- | :- | :- |
| Invoice draft or preview | Estimate | No |
| Invoice approval | `createOrUpdate`, keyed `zenskar:<invoice id>` | Yes |
| Credit note (full) | Negation of the original transaction | Yes |
| Credit note (partial) | New negative, pro-rated transaction | Yes |

Re-running or re-approving an invoice updates the same transaction instead of
creating a duplicate.

### What Zenskar sends to Anrok

For each line: the amount (in minor units), the line's Anrok tax category, and
whether the line's price is tax-inclusive. Per transaction: the invoice ID
(as `zenskar:<invoice id>`), invoice date, currency, the customer (created in
Anrok automatically if new) with its tax ID and address, and the business
entity's address as ship-from. Anrok has no header-discount field, so any
invoice-level discount is allocated across the lines before the tax request is
built. Line descriptions are not sent.

### What Anrok returns

For each line, the tax amount and a per-jurisdiction breakdown at **nexus
(tax agency) level**, one entry per nexus rather than a state, county, and
city stack. A line that isn't taxed carries a reason from Anrok, passed
through as-is:

| Reason code | Meaning |
| :- | :- |
| `jurisHasNoTax` | The jurisdiction does not tax this |
| `notCollecting` | You are not registered to collect in that jurisdiction (a nexus gap) |
| `customerExempt` | The customer is exempt, with an optional detail such as `resale` or `nonprofit` |

These three are the only reason codes attested anywhere in Zenskar's Anrok
connector; Zenskar defines no vocabulary of its own and relays whatever Anrok
sends. A reverse-charged line (a valid customer VAT ID shifting liability to
the buyer) isn't a "not taxed" exception in this sense: it's a correctly
calculated 0% rate, so it carries no reason code at all.

These reasons and the per-jurisdiction amounts are not shown anywhere in the
invoice UI, including **Integration Logs**, which lists sync events (status
and timestamp) rather than line-level detail.

### Product tax category resolution

For each line, Zenskar uses the Anrok tax category set directly on the line's
**Tax** feature; there's no separate Zenskar-side category and no
organization-level default. The line also needs to resolve to a single
product Anrok can identify: the line's own product, or, for a whole-invoice
tax with no product, a stable synthetic product reference registered for
that purpose. A tax feature that can't resolve to a product (for example,
applied to a bundle) is refused when the plan or contract is published.

### Address validation support

Anrok has a dedicated address-resolution call, but the connector uses it as a
separate check (for example, when validating a customer's address), not
chained ahead of each tax calculation. Tax calculation has its own separate
handling: an uncovered jurisdiction (no nexus, or the category isn't
supported there) returns \$0 tax rather than blocking, and a genuinely
unresolvable address is handled per [Behavior on an unresolvable
address](#behavior-on-an-unresolvable-address).

### Connection statuses and lifecycle

Status shows as a chip on the connection card on the **Connections** tab.

| Status | Meaning |
| :- | :- |
| **Pending Configuration** | Authorized but not fully set up: no business entity assigned, or the configuration not saved. |
| **Configured** | Has a business entity and a saved configuration. |

| Action | Available for Anrok |
| :- | :- |
| Connect (**NEW CONNECTION**), Disconnect | Yes |
| Pause, Resume, Re-authenticate | No. ERP connectors only (NetSuite, Xero, Zoho, Rillet, QuickBooks). |

### Where Anrok appears in the UI

| Location | Shows |
| :- | :- |
| **More > Integrations > Sales Tax > Anrok** | Connector page with **Overview**, **Connections**, and **Logs** tabs, and **NEW CONNECTION**. |
| **Anrok Setup** (opens after connecting) | **Select Zenskar Entity** for the connection. |
| Connection card (**Connections** tab) | Business entity, **Status**, **Edit**, **Disconnect**. |
| Plan, contract, or product | The **Tax** feature (**ADD FEATURE > Tax**) with **Tax Type** set to **Anrok** and a **Tax Category** fetched live from Anrok. |
| Customer > **Tax Information** | The customer's tax ID: **TAX ID** and **VAT ID** on the edit form, **Tax Code** and **Tax ID** on the read-only view. |
| Invoice or credit note > **Integrations** tab (approved only) | **Linked Integration Objects** (the **Anrok ID**), **Integration Logs**, **Sync**. |

### External references

Anrok tax categories are read live from your connected Anrok account, not a
public catalog, so there's no external lookup link to include here.


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