Collect customer addresses
Learn about collecting customer address information to calculate tax.
Stripe Tax requires your customer’s location to automatically calculate tax. This requirement applies even if you don’t have an active registration. This guide helps you understand how to collect addresses from your customers.
Checkout and Payment Links 
Checkout handles the collection of customer addresses for you, including those created by Payment Links.
Invoicing, Subscriptions, and custom payment integrations 
If you don’t use Payment Links or Checkout, you’re responsible for the collection of customer addresses.
- Collect and set both the country and the postal_code fields on your customer objects.
- Use two-letter country codes (ISO 3166-1 alpha-2).
- When creating or updating a customer, set tax[validate_location]=“immediately” to prevent customer_tax_location_invalid errors later.
- Listen for subscription webhook events as most activity happens asynchronously.
Regional considerationsUnited States
Invoice finalization errors 
Finalizing invoices with Stripe Tax requires a recognized customer location. Location details might be missing or invalid if you update or remove a customer’s default payment method, or if you didn’t provide tax[validate_
when creating or updating a customer.
If we don’t have a recognized customer location, invoices for a subscription continue to finalize automatically but without calculating taxes. This has the following effects:
- The
automatic_
parameter changes totax[enabled] false
on the subscription and invoice. - The
Invoice[automatic_
parameter changes totax][disabled_ reason] finalization_
.requires_ location_ inputs - The
Subscription[automatic_
parameter changes totax][disabled_ reason] requires_
.location_ inputs - If the subscription has a schedule, we set
automatic_
totax[enabled] false
on the current phase and indefault_
. We set thesettings disabled_
in both toreason requires_
.location_ inputs - We send
invoice.
andupdated customer.
events to inform your integration of these changes.subscription. updated - If there’s a schedule, we also send a
subscription_
webhook.schedule. updated
- If there’s a schedule, we also send a
- The invoice finalizes without calculating or collecting taxes. It won’t contain any tax amounts.
- We collect payment as usual according to the collection method for the invoice.
To review subscriptions without automatic tax calculations in your Stripe Dashboard, visit your Subscriptions page and filter the view by the Automatic tax not enabled option. To reactivate automatic tax for these subscriptions in the future, make sure you have at least one valid customer location, and activate automatic tax through the Stripe Tax Dashboard.
Exceptions to automatically disabling tax
Stripe returns an error and leaves the invoice in a draft
status when finalizing with the API or Dashboard without a valid customer location. In the API, this returns an HTTP 400 error with a code
of customer_
.
Similarly, for automatic finalization of standalone invoices without a subscription, the invoice remains a draft if the customer location isn’t valid. We send an invoice.finalization_failed event with the invoice last_finalization_error[code] being customer_
.
How you recover from a customer_
error depends on whether you have or can collect a customer address.
- If you have a customer address or can collect it, update the customer and finalize the invoice manually.
- Update the customer with tax[validate_location]=“immediately” to make sure that the new address is valid.
- Finalize the invoice.
- If you don’t have a customer address or can’t collect it, disable Stripe Tax for the invoice and its subscription, and finalize the invoice manually.
- Update the affected invoice with
automatic_
.tax[enabled]=false - Update the affected subscription with
automatic_
.tax[enabled]=false - Finalize the invoice.
- Update the affected invoice with
OptionalWhich customer address we use
Stripe Tax uses a single address as your customer’s location when calculating tax. How we choose an address doesn’t depend on the type of product you sell.
You can see which location was used for an automatic tax calculated payment in the Automatic tax calculation section of the Transactions details page in your Dashboard. You can also review the Customer API object tax parameter to see the tax-location-source.
Checkout and Payment Links 
Checkout and Payment Links use the address collected during the session.
Invoicing, Subscriptions, and custom payment integrations 
We use the first viable item in the list below to determine your customer’s location:
- We use your customer’s shipping address, if present.
- If a shipping address is present but invalid, we raise a
customer_
error instead of trying the next address in this list.tax_ location_ invalid
- If a shipping address is present but invalid, we raise a
- We use your customer’s billing address, if present.
- If a billing address is present but invalid, we raise a
customer_
error instead of trying the next address in the list.tax_ location_ invalid
- If a billing address is present but invalid, we raise a
- We use the billing details of the most specific payment method, if present.
- Default payment method of the invoice, if present.
- Default payment method of the subscription, if present.
- Default payment method of the customer, if present.
- We use your customer’s IP address, if present.
Note
If the billing details associated with a payment method are incomplete or missing, we try assembling a more complete billing address. For example, knowing the country of the card issuer, we combine it with the postal code in the billing details.
Tax API 
For the Tax API, the address hierarchy follows a simplified approach:
- The address provided in the API request is used directly for tax calculations.
- There is no fallback to other address sources such as shipping address, billing address, payment method, or IP addresses.
Warning
When using the Tax API, you must provide a valid and complete address in your API requests, or they return an error. Include the country and, where applicable, the postal code and state.
OptionalMinimal address collection
Each billing and shipping address has the fields line1
, line2
, city
, state
, postal_
, and country
. The country
must be a two-letter ISO 3166-1 code.
Use one of the supported address formats above to make sure that we can recognize your customer addresses consistently.
OptionalRegional considerations
United States
IP Address Accuracy
In most cases, we can resolve an IP address to a physical area, but its precision varies and might not reflect the customer’s actual location. Given that the US imposes local taxes, we don’t recommend relying on a customer’s IP address to determine their address.
Precise Address Lookup
Stripe Tax supports full rooftop-accurate address lookup for customer addresses in the US, meaning you can attribute your customer’s location to a specific house or building. This provides greater accuracy in the US, where two houses located side-by-side on the same street might be subject to different tax rates, due to complex jurisdiction boundaries.
For addresses outside the US, Stripe uses the country, state, and postal code fields to determine tax obligations without comparing against a comprehensive address database. See “Special jurisdictions and excluded territories” for more about when the state and postal code are used.
Note
Stripe Tax uses the 5-digit US postal code if the address lacks sufficient information, has inconsistencies, or otherwise can’t be matched to an address in the US Postal Service address database.
US Military and Diplomatic Addresses
Stripe Tax calculates no tax for US military and diplomatic mail going overseas. Overseas military and diplomatic addresses are assigned an APO, FPO, or DPO zip code, and the USPS treats it as domestic mail before transferring it to the military. Because sales to these special zip codes are sent out of the country, their sales taxes don’t apply.
ZIP Codes 
In the United States, Stripe Tax supports calculating sales tax with only a basic 5-digit US postal code. We use the point at the geographical center of the 5-digit postal code area as your customer’s location. The tax rate at this point might differ from the tax rate at your customer’s full address. Whether or not a postal code alone is sufficient to identify the correct tax rates to impose varies by state.
We recommend against relying on a postal code alone in the following states:
- Alabama
- Alaska
- Arizona
- Arkansas
- California
- Colorado
- Illinois
- Kansas
- Louisiana
- Missouri
- Nebraska
- New Mexico
- North Dakota
- Oklahoma
- South Dakota
- Texas
- Utah
- Washington
- West Virginia
Note
Stripe Tax also supports 9-digit ZIP+4 codes, but we don’t use the four additional digits.
Europe
IP Address Reliability
In regions that don’t impose local taxes, such as the EU, an IP address is more likely to resolve to an accurate address.
Excluded territories 
In Europe, tax authorities in each country impose tax, not state or local authorities. The tax rate for the country doesn’t apply in a small number of areas, even though they’re physically located in a country that imposes tax. For example, the Italian postal code “00120” identifies Vatican City, where Italian VAT doesn’t apply.
Collect your customer’s postal code or state to enable Stripe Tax to determine when your customer is located in an excluded territory.
See the list of excluded territories supported by Stripe Tax.