Automated VAT Calculations With Stripe

Use Vatstack to automatically calculate the VAT due on your checkout page. Apply the correct VAT rate for both recurring subscriptions and one-time purchases.

Grace Teo

Published March 14, 2021

Charging the legally appropriate amount of VAT on purchases is especially tricky for digital goods and services. The right percentage generally depends on your customer’s country (the place of supply), the types of digital products being purchased, and the order total.

We have documented all VAT rules for the European Union if you plan to implement a customized business logic.

To help most other businesses dynamically calculate and apply accurate VAT in real-time, Vatstack has released the quotes endpoint which centralizes all VAT rules. It now works even better hand in hand with the updated Stripe integration.

How the Stripe Integration Works

To enable dynamic VAT calculations for online sales, go to the integrations page in your dashboard and connect Vatstack with Stripe.

Before connecting, you can elect whether you want to give read-only or read-write access. Write access can additionally keep tax rates in your Stripe account updated and add tax rates to invoices. This will work for all your activated tax regions.

If you prefer to do a one-time synchronization only, simply disconnect and reconnect with read-only access after performing a synchronization.

Connect Vatstack with Stripe to automate VAT rate synchronizations
Connect Vatstack with Stripe to automate VAT rate synchronizations

Once the connection is established, you will find a few tax rates settings as shown below:

VAT rate synchronization settings for the Stripe integration
VAT rate synchronization settings for the Stripe integration
  • VAT-inclusive or VAT-exclusive: This is normally a one-time setting. Choose carefully based on how you want to charge your customers. This setting will also influence how tax rates are created on Stripe.
  • Synchronize automatically: New tax rates are created on Stripe as soon as a VAT rate changes in our database. You can thus eliminate manual maintenance of your tax rates. Note that this only works for standard rates.
  • Amend new invoices: New invoices can be amended automatically with the applicable tax rate attached. This is particularly relevant if you present Stripe invoices to your customer and want to ensure VAT is correctly stated. Vatstack will try to determine the place of supply based on a billing address and an IP address (if found in the metadata as documented here).

Using Quotes for Correct Tax Treatments

Responses from the quotes endpoint will now contain the applicable tax rate ID stored in your Stripe account. Quotes are used to dynamically calculate the correct final price before your customer checks out.

For example, the response below includes the 20% Austrian VAT applicable to a purchase, including the tax_rate_id from Stripe:

{
  "id": "604e1495a2bea9f7f628f438",
  "abbreviation": "UID",
  "amount": 10000,
  "amount_total": 12000,
  "category": null,
  "country_code": "AT",
  "country_name": "Austria",
  "integrations": [
    {
      "provider": "stripe",
      "tax_rate_id": "txr_1ITwFlE4GGQvLhGdcQyihZBu"
    }
  ],
  "ip_address": null,
  "local_name": "Umsatzsteuer-Identifikationsnummer",
  "member_state": true,
  "validation": null,
  "vat": {
    "abbreviation": "MwSt.",
    "inclusive": false,
    "local_name": "Mehrwertsteuer",
    "rate": 20,
    "rate_type": "standard",
    "amount": 2000
  },
  "created": "2021-03-14T13:50:13.220Z",
  "updated": "2021-03-14T13:50:13.220Z"
}

Generate new quotes whenever your customer modifies details such as the item quantity or when adding their VAT ID. In the event your customer provides a VAT ID, perform a validation request and attach its ID to the validation field.

Each quote object has a unique ID that lets you interchange tax treatment details between your frontend and backend applications. When your customer confirms the order, you can use the quote’s id to retrieve the same tax treatment information from your backend, and associate your subscription or one-time purchase with the tax rate object based on the tax_rate_id field.

Exempt B2B Customers on Stripe

If vat.rate_type results in reverse_charge, you should designate your customer’s tax treatment accordingly. Stripe has a customer field tax_exempt for that. Setting it to reverse will ensure no VAT is charged even if a tax rate object is attached to an invoice.

Selling  a subscription? an online course? a hosting plan? an ebook?

Other Recent Articles