# Collect tax on usage-based rate card subscriptions

You can use Stripe Tax to calculate the tax amount on recurring payments for rate card subscriptions. To automatically handle tax calculation when your customer is ready to pay, set the customer’s location details when you create a rate card subscription.

## Activate Stripe Tax

Log in or sign up for Stripe to activate Stripe Tax.

## Update rate cards (optional)

When you create a rate card, you specify the product tax code. If you don’t specify a code, Stripe Tax uses the default tax code selected in your Tax Settings.

## Collect customer information

### Client-side

After you have an estimate of the taxes and the total, you can collect customer information, including:

*   Shipping address (if applicable)
*   Billing address
*   Payment details

Stripe Tax collects payment details without creating a Setup Intent. The first step is to create an Elements object without an Intent:

```javascript
const stripe = Stripe("pk_test_51FeMfIG3Ks4CHLRJvYOjBLY05dmeTT9oZLxqTspUtTlGyNv3EQDbyBPPRMY9vf72LOE4ZEWZMP5I5uoULSG49IPe00tasHNr6j");
const elements = stripe.elements({
  mode: 'subscription',
  currency: '{{CURRENCY}}',
  amount: {{TOTAL}},
});

// Next, create an Address Element and a Payment Element and mount both:
const addressElement = elements.create('address', {
  mode: 'billing' // or 'shipping', if you are shipping goods
});
addressElement.mount('#address-element');

const paymentElementOptions = {
  layout: 'accordion'
};
const paymentElement = elements.create('payment', paymentElementOptions);
paymentElement.mount('#payment-element');

// Listen to change events on the Address Element. When the address changes, re-estimate the taxes and the total.
addressElement.on('change', function(event) {
  // Throttle your requests to avoid overloading your server or hitting
  // Stripe's rate limits.
  const { tax, total } = event;
  // ...
});
```