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

# Anrok

> Learn how to configure Anrok as your tax provider with Metronome and Stripe invoicing.

[Anrok](https://www.anrok.com/) is a tax compliance platform. Metronome integrates with Anrok through Stripe—Anrok operates as a Stripe Tax provider through the [Anrok Stripe app](https://marketplace.stripe.com/apps/anrok).

The key difference is that Anrok handles the tax calculation and compliance rather than Stripe's native engine.

## Prerequisites

1. Install the [**Anrok app**](https://marketplace.stripe.com/apps/anrok) in your Stripe dashboard from the Stripe App Marketplace.
2. **Configure Anrok** to connect to your Stripe account. Follow Anrok's setup instructions at [anrok.com/integrations/stripe](https://anrok.com/integrations/stripe). In the Stripe Dashboard, go to **Settings > Tax > [Integrations](https://dashboard.stripe.com/settings/tax/integrations)** and confirm Anrok is selected as your tax calculation provider and that "Use automatic tax" is toggled **ON**. See [Stripe's third-party tax apps guide](https://docs.stripe.com/tax/third-party-apps) for details.
   1. [Complete tax registration](https://docs.stripe.com/tax/registering) in the applicable jurisdictions for sales tax, VAT, and GST.
3. [Connect your Stripe account](/integrations/invoice-integrations/stripe) to Metronome.
4. Link each Metronome customer to their Stripe customer ID.
5. Ensure each Stripe customer has a [**Customer Address**](https://docs.stripe.com/api/customers/object#customer_object-address) set and is marked as **Taxable**.
6. Once you've completed setup, let your Metronome representative know so they can enable tax application on your account.

<Note>
  The Customer Address field is the `address` object on the [Stripe Customer object](https://docs.stripe.com/api/customers/object#customer_object-address), which determines tax jurisdiction. Failure to assign a Customer Address results in failure to apply tax.
</Note>

## Step 1: Create Stripe products

Anrok uses the Stripe product on each invoice line item to determine tax treatment. Create Stripe products and assign appropriate [tax codes](https://docs.stripe.com/tax/tax-codes).

If a Stripe product doesn't have a tax code assigned, Anrok falls back to a default product classification. However, it's recommended to explicitly assign tax codes for accuracy.

## Step 2: Create the Stripe Product ID custom field in Metronome

1. Create a `stripe_product_id` [custom field](/api-reference/custom-fields) on the **Product** entity in Metronome.
2. For each Metronome product, set the `stripe_product_id` value to the corresponding Stripe product ID.

See [Stripe Tax Step 2](/integrations/tax-integrations/stripe-tax#step-2-create-the-stripe-product-id-custom-field-in-metronome) for detailed instructions.

## Step 3: Configure entity mapping

Configure the entity mapping in Metronome to pass the product ID to Stripe:

1. Go to **Connections > Integrations > Stripe > Edit Mapping**.
2. Add the following mapping:

| Stripe vendor entity | Stripe vendor key | Metronome entity  | Metronome key       |
| -------------------- | ----------------- | ----------------- | ------------------- |
| `invoiceitem.price`  | `product`         | `ContractProduct` | `stripe_product_id` |

3. Click **Save**.

## Step 4: Configure invoice settings

**For arrears invoices (end-of-period usage invoices):**

Anrok calculates tax inline through the Stripe app. You don't need "Leave invoices as drafts" enabled for this flow.

**For threshold billing ([prepaid balance recharges](/guides/customers-billing/optimize-customer-experience/prepaid-balance-thresholds), spend thresholds):**

Set `tax_type: "STRIPE"` and `payment_type: "INVOICE"` in the `payment_gate_config`. See the [Stripe Tax threshold billing docs](/integrations/tax-integrations/stripe-tax#threshold-billing) for the exact API payload.

## Test your configuration

1. Use your **Metronome sandbox** (connected to **Stripe test mode**) to test.
2. Create a customer with a valid Stripe customer ID and [Customer Address](https://docs.stripe.com/api/customers/object#customer_object-address).
3. Generate an invoice and verify in Stripe that Anrok has applied tax.
4. Confirm the tax line items appear on the finalized Stripe invoice.

## FAQ and troubleshooting

**Q: My invoices are failing or are finalizing without tax -- what should I check?**
The most common causes are a missing [Customer Address](https://docs.stripe.com/api/customers/object#customer_object-address) on the Stripe customer or an incomplete entity mapping in Metronome. Start by confirming that the Stripe customer has sufficient location information to accurately calculate tax rates for the customer. Next, check if the entity mapping is complete in Metronome. If both are verified and tax still isn't being applied, contact your Metronome representative to check your account configuration.

**Q: Can I use Anrok for compliance and Stripe Tax for calculation?**

Yes. Many customers use Stripe Tax for the actual tax calculation and Anrok for tax compliance, filing, and reporting. In this case, follow the [Stripe Tax setup guide](/integrations/tax-integrations/stripe-tax)—Anrok automatically picks up the transaction data from Stripe for compliance purposes.

**Q: How do I verify Anrok is working?**

After generating and finalizing an invoice, check the Stripe invoice object. You should see:

```json theme={null}
{
  "automatic_tax": {
    "enabled": true,
    "provider": "anrok",
    "disabled_reason": null,
    "liability": {
      "type": "self"
    },
    "status": "complete"
  }
}
```

If you see `"enabled": false` or `"provider": null`, the integration isn't active. Verify the [Anrok app is installed](https://marketplace.stripe.com/apps/anrok) in Stripe. Otherwise, reach out to your Metronome representative for tax automation.

**Q: Do I need to set a default tax behavior in Stripe?**

In the Stripe dashboard, make sure that you have a default tax behavior selected to ensure tax is correctly added to each invoice.
