> ## 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

This document explains how Zenskar integrates with Anrok through Anrok connections, Anrok tax codes, Anrok products, Anrok customers, and Anrok transactions.

> **Map of concepts**
>
> | Concept | Details |
> | - | - |
> | [Anrok connection](#anrok-connections-one-anrok-account-for-one-business-entity) | Zenskar records Anrok transactions in the Anrok account of an Anrok connection. |
> | [Anrok tax code](#anrok-tax-codes-how-anrok-taxes-what-you-sell) | Each Zenskar tax category maps to one Anrok tax code. |
> | [Anrok product](#anrok-products-what-anrok-taxes) | Each Anrok product carries one Anrok tax code. |
> | [Anrok customer](#anrok-customers-who-anrok-taxes) | A link to an Anrok customer belongs to one Anrok connection. |
> | [Anrok transaction](#anrok-transactions-what-zenskar-records) | An Anrok transaction uses the Anrok products of the Zenskar invoice. |
>
> An Anrok connection links a Zenskar business entity to an Anrok account. Each Zenskar tax category maps to an Anrok tax code. Zenskar creates an Anrok product for each Zenskar product whose Zenskar tax category has an Anrok tax code. Zenskar names or links the Anrok customer of each Zenskar customer. When a Zenskar invoice is generated, Zenskar asks Anrok for a tax estimate. When the Zenskar invoice is approved, Zenskar records its Anrok transactions.

> **Related modules**
>
> Anrok uses the following modules:
>
> | Module | Details |
> | - | - |
> | [Tax configuration](/docs/20260301/product-modules/settings/tax-configuration/concepts/tax-configuration.md#tax-categories-how-products-are-taxed) | Each Zenskar tax category maps to one Anrok tax code. |
> | [Business entity](/docs/20260301/product-modules/settings/business-entity.md#organization-versus-business-entity) | Each Anrok connection belongs to one Zenskar business entity. |
> | [Products](/docs/20260301/product-modules/products/concepts/products.md#products-what-you-sell) | Zenskar creates an Anrok product for each Zenskar product whose Zenskar tax category has an Anrok tax code. |
>
> The following modules use Anrok:
>
> | Module | Details |
> | - | - |
> | [Tax configuration](/docs/20260301/product-modules/settings/tax-configuration/concepts/tax-configuration.md#served-countries-and-tax-engines) | A served country can use Anrok as its tax engine. |
> | [Contracts](/docs/20260301/product-modules/contracts/concepts/contracts.md#invoices-what-a-contract-produces) | The Zenskar invoices of a contract get their tax from Anrok. A contract becomes active only after each of its taxed Zenskar products has an Anrok product. |

## Anrok connections: one Anrok account for one business entity

> [!NOTE]
>
> This page names each object by its system. A term that starts with "Zenskar", such as "Zenskar product", names the object in Zenskar. A term that starts with "Anrok", such as "Anrok product", names its equivalent in Anrok:
>
> | Zenskar | Anrok |
> | - | - |
> | Zenskar [business entity](/docs/20260301/product-modules/settings/glossary.md#business-entity) | Anrok account |
> | Zenskar [tax category](/docs/20260301/product-modules/settings/glossary.md#tax-category) | [Anrok tax code](#anrok-tax-codes-how-anrok-taxes-what-you-sell) |
> | Zenskar [product](/docs/20260301/product-modules/products/glossary.md#product) | [Anrok product](#anrok-products-what-anrok-taxes) |
> | Zenskar customer | [Anrok customer](#anrok-customers-who-anrok-taxes) |
> | Zenskar invoice | [Anrok transaction](#anrok-transactions-what-zenskar-records) |

An **Anrok connection** is a link between one Anrok account and one Zenskar business entity.

> [!NOTE]
>
> * A Zenskar business entity can have only one Anrok connection. Different Zenskar business entities can link different Anrok accounts.
> * A Zenskar business entity can have only one third-party [tax engine](/docs/20260301/product-modules/settings/glossary.md#tax-engine) connected. Zenskar rejects a second third-party tax engine.
> * The API key decides the type of Anrok account Zenskar can connect to:
>   * A key from a sandbox account connects that sandbox account.
>   * A key from a production account connects that production account.

Connecting Anrok does not switch any [served country](/docs/20260301/product-modules/settings/glossary.md#served-country) to Anrok. Each served country keeps its current tax engine until it is set to Anrok. See [Setup of an Anrok connection](#setup-of-an-anrok-connection).

## Setup of an Anrok connection

An [Anrok connection](#anrok-connections-one-anrok-account-for-one-business-entity) starts without a Zenskar business entity. The setup of the connection has three parts, in the following order:

1. The first part sets the Zenskar business entity of the connection.
2. The second part sets the [served countries](/docs/20260301/product-modules/settings/glossary.md#served-country) of the Zenskar business entity. It also sets the [tax engine](/docs/20260301/product-modules/settings/glossary.md#tax-engine) of each served country. See [Served countries and tax engines](/docs/20260301/product-modules/settings/tax-configuration/concepts/tax-configuration.md#served-countries-and-tax-engines).
3. The third part maps the Zenskar [tax categories](/docs/20260301/product-modules/settings/glossary.md#tax-category) to [Anrok tax codes](#anrok-tax-codes-how-anrok-taxes-what-you-sell). These mappings apply in every Zenskar business entity. See [Third-party tax codes](/docs/20260301/product-modules/settings/tax-configuration/concepts/tax-configuration.md#third-party-tax-codes).

Parts 2 and 3 are available only after part 1 is complete.

## Anrok tax codes: how Anrok taxes what you sell

An **Anrok tax code** is the identifier of the Anrok equivalent of a Zenskar tax category.

Anrok uses the Anrok tax code to decide how to tax an Anrok product. Anrok tax codes are the [third-party tax codes](/docs/20260301/product-modules/settings/glossary.md#third-party-tax-code) of Anrok. Each Zenskar tax category maps to one Anrok tax code. The mapping applies in every Zenskar business entity.

Anrok has standard tax codes and custom tax codes. Every Anrok account offers the standard tax codes. A custom tax code exists only in the Anrok account that created it. Its ID starts with `sptc`. The Anrok tax codes for mapping come from all connected Anrok accounts.

Each connected Anrok account must offer every mapped Anrok tax code. Otherwise, Zenskar cannot create Anrok products in that account. This can affect [contracts](/docs/20260301/product-modules/contracts/concepts/contracts.md).

An Anrok tax code can stop existing in Anrok after you map it. The Zenskar tax category keeps the mapping. Zenskar marks the Anrok tax code as missing from Anrok.

## Anrok products: what Anrok taxes

An **Anrok product** is the Anrok equivalent of a Zenskar product.

Anrok taxes a line item through its Anrok product. Each Anrok product carries one Anrok tax code. An Anrok product holds no tax amounts.

Zenskar creates the Anrok products in every connected Anrok account. It creates one for each Zenskar product whose Zenskar tax category has an Anrok tax code. A contract becomes active only after each of its taxed Zenskar products has an Anrok product.

Zenskar names each Anrok product. The ID has the form `zenskar:{Zenskar product ID}:{Anrok tax code}`. For example, a Zenskar product with the ID `3f9c2a1e-…` and the Anrok tax code `cloudServicesBusiness` has the Anrok product `zenskar:3f9c2a1e-…:cloudServicesBusiness`.

The Anrok tax code is part of the ID. When a Zenskar tax category gets a new Anrok tax code, its Zenskar products get new Anrok products. Zenskar never changes or deletes an Anrok product. Old Anrok products stay in Anrok, with the Anrok transactions that used them. Zenskar ignores Anrok products that you create directly in Anrok.

## Anrok customers: who Anrok taxes

An **Anrok customer** is the Anrok equivalent of a Zenskar customer.

Anrok applies the exemption certificates of the Anrok customer. Anrok does not use the `exempt_tax` custom attribute of Zenskar.

Zenskar finds the Anrok customer of a Zenskar customer in one of two ways:

| Zenskar customer | How Zenskar finds the Anrok customer |
| - | - |
| Not linked | Zenskar names the Anrok customer with the Zenskar customer ID. Zenskar also sends the name and email of the Zenskar customer. If Anrok has no Anrok customer with that ID, Anrok creates one. |
| Linked to an existing Anrok customer | Zenskar uses the ID of the linked Anrok customer. Zenskar does not send the name or email of the Zenskar customer. |

In both cases, Zenskar sends the billing address and the tax ID of the Zenskar customer.

A link is for a Zenskar customer whose Anrok customer already exists, for example with its exemption certificates. Zenskar does not link customers automatically. An Anrok customer can be linked to only one Zenskar customer. A link can change to another Anrok customer. A link cannot be removed. Each link belongs to the Anrok connection of the Zenskar customer's business entity. Disconnecting Anrok removes the links of the connection.

## Address validation

When a Zenskar customer is created or updated, Zenskar asks Anrok to validate the billing address of the Zenskar customer. This happens only when the Zenskar customer's business entity has Anrok connected. Zenskar stores the result with the address.

A billing address that Anrok reports as invalid can affect [contracts](/docs/20260301/product-modules/contracts/concepts/contracts.md). A billing address that Anrok has not validated yet has no effect.

## Anrok transactions: what Zenskar records

An **Anrok transaction** is a record in Anrok of the tax of a Zenskar invoice.

Zenskar works with Anrok at two points of a Zenskar invoice:

| When | What happens |
| - | - |
| A Zenskar invoice is generated | Zenskar asks Anrok for a tax estimate. Anrok does not record the estimate. |
| A Zenskar invoice is approved | Zenskar asks Anrok for the tax again. It compares that tax with the tax on the Zenskar invoice. Then Zenskar records the Anrok transactions of the Zenskar invoice. |

A Zenskar invoice can have more than one Anrok transaction. Zenskar sends the invoice email only after Anrok records every Anrok transaction of the Zenskar invoice. If Anrok does not record one, the Zenskar invoice stays approved without an email.

Zenskar names each Anrok transaction. The ID has the form `zenskar:{Zenskar invoice ID}:`, followed by eight characters. For example, a Zenskar invoice with the ID `96c0a5d2-…` can have the Anrok transaction `zenskar:96c0a5d2-…:1a2b3c4d`.

Disconnecting Anrok removes the links between Zenskar invoices and their Anrok transactions. The Anrok transactions stay in Anrok.

The estimate, the comparison, and the recording can affect [invoices](/docs/20260301/product-modules/contracts/concepts/contracts.md#invoices-what-a-contract-produces).

## Work that stays in Anrok

Zenskar uses Anrok to calculate tax and to record Anrok transactions. The following work stays in Anrok:

| Work | Details |
| - | - |
| Filing and remittance | Tax returns and tax payments happen in Anrok, from the Anrok transactions that Zenskar records. |
| Registration in jurisdictions | Registration in the jurisdictions where your business collects tax happens in Anrok. Anrok returns no tax for a jurisdiction where the Anrok account is not registered. |
| Exemption certificates | Exemption certificates belong to the Anrok customer, in Anrok. |
| Custom tax codes | Custom tax codes are created in Anrok. Zenskar reads them as Anrok tax codes. |


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