Sample Use Cases and Flows

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.

Calculate tax for the United Kingdom

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.

  1. Configure the service plugin and give it a calculatorDisplayName, such as "UK Tax App".

  2. Use Tax Regions API to create or update tax regions for the UK with your app ID in the appId field.

  3. 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.

Did this help?

Extension Config


To configure and customize your service plugin, you need to provide important details in the plugin.json configuration file.

Note

If you created your service plugin extension with the CLI, required fields are automatically populated for you.

Configuration Params
calculatorDisplayNamestring

Display name of the tax calculator.


deploymentUriSpiBaseUri

Required.* Base URI where the endpoints are called. Wix appends the endpoint path to the base URI.

For example, to call the Calculate Tax endpoint at https://my-tax-calc.com/v1/calculateTax, the base URI you provide here is "https://my-tax-calc.com/".


unsupportedCountriesArray<string>

List of countries, in ISO-3166 alpha-1 format, that the calculator does not support.

0
Did this help?