chore(billing): Enable automatic tax calculation by default (#8552)

When a customer signs up for Starter or Team, we don't enable tax
calculation by default. This means customers can upgrade to Team, start
paying invoices, and we won't collect taxes.

This creates a management issue and possible tax liability since I need
to manually reconcile these.

Instead, since we have Stripe Tax configured on our account, we can
enable automatic tax calculation when the subscription is created. Any
products (Starter/Team/Enterprise) therefore in the subscription will
automatically collect tax appropriately.

In most cases in the US, the tax rate is 0. In EU transactions, for B2B
sales, the tax rate for us is also 0 (reverse charge basis). If we sell
a Team subscription to an individual, however, we need to collect VAT.

There doesn't seem to be a way to block consumer EU transactions in
Stripe, so we'll likely need to register for VAT in the EU if we cross
the reporting threshold.
This commit is contained in:
Jamil
2025-03-31 06:23:39 -07:00
committed by GitHub
parent 97cd371bc0
commit 936f5ddb01
2 changed files with 5 additions and 2 deletions

View File

@@ -93,6 +93,7 @@ defmodule Domain.Billing.Stripe.APIClient do
URI.encode_query(
%{
"customer" => customer_id,
"automatic_tax[enabled]" => true,
"items[0][price]" => price_id
},
:www_form

View File

@@ -560,7 +560,8 @@ defmodule Domain.BillingTest do
assert params == %{
"customer" => customer_id,
"items" => %{"0" => %{"price" => "price_1OkUIcADeNU9NGxvTNA4PPq6"}}
"items" => %{"0" => %{"price" => "price_1OkUIcADeNU9NGxvTNA4PPq6"}},
"automatic_tax" => %{"enabled" => "true"}
}
end
@@ -695,7 +696,8 @@ defmodule Domain.BillingTest do
assert params == %{
"customer" => customer_id,
"items" => %{"0" => %{"price" => "price_1OkUIcADeNU9NGxvTNA4PPq6"}}
"items" => %{"0" => %{"price" => "price_1OkUIcADeNU9NGxvTNA4PPq6"}},
"automatic_tax" => %{"enabled" => "true"}
}
end