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?

calculateTax( )


Important: This is a handler function. Implement it only as part of the service plugin.


Calculates tax for the provided line items.

Tax is calculated for each line item based on the tax region in lineItems.taxRegionId and the tax group in lineItems.taxGroupId.

The breakdown of calculated tax returned, includes:

  • taxSummary: The overall total tax calculated.
  • lineItemTaxDetails.taxBreakdown: The tax calculated for each line item in each jurisdiction.
  • lineItemTaxDetails.taxSummary: The total tax calculated for each line item.
Method Declaration
Copy
Method Parameters
payloadCalculateTaxEnvelope
Returns
Return Type:CalculateTaxResponse | Promise<CalculateTaxResponse>
Did this help?