# Stripe Tax for Rillet

Calculate tax on Rillet invoices with Stripe Tax and include them in your reporting and filing.

Connect your Rillet organization to Stripe Tax to calculate tax on your Rillet invoices. When you create or update an invoice, Stripe Tax calculates tax for each line and writes it back to the invoice in Rillet. When the invoice is fully paid in Rillet, Stripe Tax commits it and records a tax transaction.

Stripe Tax for Rillet is in private preview.

### Request to join the preview for Stripe Tax for Rillet.

Enter your email to request access.

```bash
curl https://docs.stripe.com/preview/register \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Referer: https://docs.stripe.com/use-stripe-apps/rillet" \
  -d '{"email": "EMAIL", "preview": "tax_rillet_connector_preview"}'
```

You can use Stripe Tax to:

- [Monitor thresholds](https://docs.stripe.com/tax/monitoring.md) across Stripe and Rillet sales to know when to register in new jurisdictions
- Include Rillet invoices in your [reports](https://docs.stripe.com/tax/reports.md)
- Include Rillet invoices in your [filings](https://docs.stripe.com/tax/filing.md)

## Before you begin

Confirm you have:

- Permission in the Stripe Dashboard to write tax transactions and create API keys.
- Stripe Tax [configured](https://docs.stripe.com/tax/set-up.md) with your origin address and tax registrations.
- Access to **Organization settings** in Rillet to create an API key and a webhook.
- A shipping or billing address on each Rillet customer that you invoice.

## Connect Rillet

Setup is manual. The Dashboard generates a webhook URL that’s unique to each setup, and you copy credentials between Rillet and the Dashboard. Live mode connects to your Rillet organization at `app.rillet.io`. A Stripe sandbox connects to your Rillet sandbox at `sandbox.rillet.io`. Create the API key and webhook in the Rillet environment that matches the Stripe environment you’re connecting.

To connect Rillet to Stripe Tax:

1. In the Dashboard, go to [Tax overview](https://dashboard.stripe.com/tax/overview), select **Add connection**, and select **Rillet**.
2. Create an API key:
   1. In Rillet, go to **Organization settings** > **Integrations & API** > **API Access** and select **Create API key**.
   2. Enter `Stripe Tax API Key` as the name.
   3. Don’t select **Read-only**. Stripe Tax needs write access to update your invoices.
   4. Copy the key and paste it into the Dashboard.
3. Register a webhook:
   1. Copy the webhook URL from the Dashboard.
   2. In Rillet, go to **Integrations & API** > **Webhooks** and select **Create webhook**.
   3. Enter `Stripe Tax Calculations` as the name and paste the webhook URL.
   4. For **Invoice** and for **Credit memo**, select **Created**, **Updated**, **Deleted**, and **Payment updated**.
   5. Select **Create**.
4. In Rillet, open the dropdown menu for the webhook, copy the **Signing token**, and paste it into the Dashboard.
5. Select **Create connection**.

The Dashboard checks only that you entered an API key, not that the key has write access. If you cancel and start again, use the new webhook URL that the Dashboard generates.

## How Stripe Tax calculates tax

Stripe Tax calculates tax on each Rillet invoice as follows:

- **Customer location**: Stripe Tax uses the shipping address on the invoice. If there’s no shipping address, it uses the billing address. If the invoice has neither, Stripe Tax skips the invoice and reports an [error](https://docs.stripe.com/use-stripe-apps/rillet.md#view-connection-errors).
- **Tax behavior**: Stripe Tax treats prices as tax-exclusive and adds tax to each line.
- **Tax details**: Stripe Tax writes tax for each invoice line and each jurisdiction. Rillet has only two tax types, so VAT, GST, HST, IGST, and JCT appear as `VAT` in Rillet. All other taxes appear as `SALES_TAX`.
- **Reporting**: Stripe Tax considers an invoice committed when it’s fully paid in Rillet, and creates a tax transaction at that point. Sending an invoice or partly paying it doesn’t commit it or create a tax transaction.

Stripe Tax adds tax shortly after an invoice changes, not instantly. Rillet’s invoice preview and send dialog don’t show tax until you refresh the page.

> #### Wait for tax before you send or pay an invoice
> 
> If you send or pay an invoice before tax appears, Stripe Tax can’t calculate and report tax correctly for that invoice. Refresh the invoice in Rillet and confirm that tax appears first.

## Assign product tax codes

Rillet doesn’t have a tax code field, so Stripe Tax reads product tax codes from a Rillet custom field. To assign a tax code:

1. In Rillet, create a custom field and add a value for each tax code that you use. The name of the field doesn’t matter.
2. Name each value with a Stripe [tax code](https://docs.stripe.com/tax/tax-codes.md), either `txcd_10103001` or `tax_code:txcd_10103001`.
3. Set the value on your products. Rillet copies product fields onto invoice lines, so the invoice line uses the tax code from its product.

Stripe Tax uses your default tax code for any invoice line without a valid tax code. This includes lines with unknown, unsupported, or deactivated values. Stripe Tax doesn’t show an error in these cases, so check that your value names match a supported tax code.

## Add customer tax IDs

Stripe Tax uses [customer tax IDs](https://docs.stripe.com/billing/customer/tax-ids.md) to apply rules such as [reverse charge](https://docs.stripe.com/tax/zero-tax.md). Stripe Tax receives these tax IDs from the Rillet customer:

- EU VAT registration numbers.
- Generic VAT numbers, for customers in the UK, Switzerland, and Norway. Stripe Tax treats the number as a VAT number for the customer’s country.

Stripe Tax ignores generic VAT numbers for customers in other countries. If Stripe Tax rejects a tax ID, it calculates tax without the tax ID.

## Test before going live

Test the connection in a Stripe sandbox before you connect your live account. Learn more about [testing Stripe Tax](https://docs.stripe.com/tax/testing.md). A sandbox connects to your Rillet sandbox, so Stripe Tax doesn’t write to your live Rillet organization during testing.

1. In the Dashboard, select the account picker and select **Switch to sandbox**.
2. Create a sandbox or select an existing one.
3. Configure Stripe Tax with your origin address and tax registrations. These settings aren’t copied automatically. Learn more about [sandbox settings](https://docs.stripe.com/sandboxes/dashboard/sandbox-settings.md).
4. [Connect Rillet](https://docs.stripe.com/use-stripe-apps/rillet.md#connect-rillet) using credentials from your Rillet sandbox.
5. In Rillet, create an invoice for a customer with an address. Refresh the invoice and confirm that tax appears on each line.
6. Pay the invoice in Rillet, then check your Stripe Tax [reports](https://docs.stripe.com/tax/reports.md) to confirm that they include the invoice.
7. Switch out of the sandbox and connect your live Rillet organization to your live Stripe account.

## View connection errors

To check the status of invoices, open your Rillet connection on the [Connectors page](https://dashboard.stripe.com/data-management/connectors) in the Dashboard. Invoices that Stripe Tax can’t process appear in two groups:

- **Needs attention**: Problems that you can fix, such as an invoice without an address or an API key that Rillet rejects.
- **Failed**: Invoices where Stripe Tax couldn’t write tax to the invoice, or calculated tax but couldn’t report it as a tax transaction.

To resolve a **Needs attention** error, fix the invoice, customer, or API key in Rillet. For example, add an address to the customer. An error clears when Stripe Tax later processes the invoice successfully.

## Limitations

This integration has the following limitations:

- Stripe Tax adds tax shortly after an invoice changes. Rillet’s invoice preview and send dialog don’t show tax until you refresh the page.
- If you send or pay an invoice before tax appears, the invoice isn’t calculated and reported correctly. Wait for tax to appear first.
- Stripe Tax doesn’t calculate tax on credit memos. Tax on a credit memo comes from the invoice that it applies to. If a credit memo has no invoice, Stripe Tax ignores it.
- Invoices with more than 100 line items aren’t supported.
- Stripe Tax doesn’t process invoices from before you connected Rillet. There’s no backfill.
