Note: This service plugin will be deprecated on September 30, 2025. Use the identical Tax Calculation service plugin in the @wix/ecom
module instead.
As a tax calculation provider, you can integrate with Wix to allow merchants to request and use your services on their Wix sites. The tax calculated is then included on the site's cart and checkout pages.
The integration is done via an app in the Wix App Market and by implementing the Tax Calculation Provider Service Plugin. After the app is installed on a site, Wix triggers a call to your service whenever the site needs to calculate tax for a transaction.
Using the service plugin, you can design your app to calculate taxes for different regions and based on various tax groups.
Follow these steps to begin implementing your service plugin.
You can implement this service plugin with the following frameworks:
To configure and customize your plugin, you need to provide important information in the service plugin configuration file. You can configure your plugin in the Wix Dev Center. For details, see Tax Calculation Provider Extension Configuration.
Use taxCalculationProvider.provideHandlers()
to define the following handler function that implements your custom business logic.
Function | Required |
---|---|
calculateTax() | Yes |
Below is an example for implementing the Tax Calculation Provider service plugin in your code.
This is the basic code structure for implementing the Tax Calculation Provider service plugin with the Wix CLI:
import { taxCalculationProvider } from "@wix/billing/service-plugins";
taxCalculationProvider.provideHandlers({
calculateTax: async (payload) => {
const { request, metadata } = payload;
// Add your logic here
},
});
This is the basic code structure for implementing a self-hosted Tax Calculation service plugin:
import { createClient } from '@wix/sdk';
import { taxCalculationProvider } from '@wix/billing/service-plugins'
const wixClient = createClient({
auth: {
appId: <YOUR_APP_ID>,
publicKey: <YOUR_APP_PUBLIC_KEY>
},
modules: { taxCalculationProvider }
});
wixClient.taxCalculationProvider.provideHandlers({
calculateTax: async (payload) => {
const { request, metadata } = payload;
// Add your logic here
}
});
// Implement a router to process all requests
express.post('/plugins-and-webhooks/*', (req, res) => {
wixClient.process(req);
});
country
and subdivision
with a specific tax treatment. Tax is calculated based on the tax region and the tax group associated with a line item. See the Tax Regions API.This article shares a possible use case your app could support, as well as a sample flow that could support the use case. You aren't limited to these exact flows, but it can be a helpful jumping off point as you plan your app's implementation.
A business operating in the United Kingdom needs to charge and collect tax at different rates throughout the country. Your app can provide the correct tax to charge for their sales.
Follow these steps to create an app that can calculate tax for the United Kingdom.
Configure the service plugin and give it a calculatorDisplayName
, such as "UK Tax App"
.
Use Tax Regions API to create or update tax regions for the UK with your app ID in the appId
field.
Add logic to your app so that when Wix calls it with Calculate Tax your app returns a tax calculation based on different, relevant tax regions in ISO-3166 alpha-2 format.