> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Introduction ## Article: Introduction ## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/additional-fees/additional-fees-service-plugin/introduction.md ## Article Content: # About the Wix eCommerce Additional Fees Service Plugin
__Important:__ When developing websites or building apps with Blocks, use [Velo service plugins](https://dev.wix.com/docs/velo/events-service-plugins/about-events-service-plugins-and-the-sdk.md).As an additional fees calculation provider, you can integrate with Wix to allow merchants to request and use your services on their Wix sites. The additional fees you calculate are 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 Additional Fees [service plugin](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/service-plugins/about-service-plugin-extensions.md). After the app is installed on a site, Wix calls your service whenever the site needs to calculate additional fees for a transaction. Using the service plugin, you can design your app to calculate various additional fees for the merchant's customers, including: + Fragile packaging fees + Shipping insurance fees + Item warranty fees + Gift wrapping fees + Carbon offset fees Learn more about [service plugin extensions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/service-plugins/about-service-plugin-extensions.md). ## Before you begin It's important to note that when Wix calls your implementation of the Calculate Additional Fees method, the app must return fees in the same currency as the Wix site. Extract the `currency` for a site from the request to ensure the correct currency is used in your calculation. ::::tabs :::REST_TAB ## Get started To enable Wix to communicate with your app: 1. Go to [Extensions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/about-extensions.md) in your app's dashboard. 1. Click **Create Extension** in the top right. 1. Filter by **eCommerce** in the left menu, then find **Ecom Additional Fees** and click **Create**. 1. Provide the following configuration in the JSON editor and then click **Save**. | Name | Type | Description | | --- | --- | --- | | `deploymentUri`|string|**Required.** Base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI. For example, to call the Calculate Additional Fees endpoint at `https://my-additional-fees.com/v1/calculateAdditionalFees`, the base URI you provide here is `https://my-additional-fees.com/`. | | `componentName`|string|A unique name for this component. This is an internal name that will only appear in the app dashboard. | ::: :::SDK_TAB ## Get started Follow these steps to begin implementing your service plugin. ### Step 1 | Choose a framework You can implement this service plugin with the following [frameworks](https://dev.wix.com/docs/build-apps/get-started/overview/wix-s-development-frameworks.md): + **Wix CLI:** Learn how to [implement a service plugin with the CLI and the SDK](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/backend-extensions/service-plugins/add-service-plugin-extensions-with-the-cli.md). + **Self-hosted:** Learn how to [implement a self-hosted service plugin with the SDK and the Wix Dev Center](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions-with-the-sdk.md). ### Step 2 |Configure your service plugin To configure and customize your plugin, you need to provide important information in the service plugin configuration file. You can [configure your plugin in your app's dashboard](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions-with-the-sdk.md#step-1--add-a-service-plugin-extension-to-your-app). For details, see [Additional Fees Extension Configuration](https://dev.wix.com/docs/rest/business-solutions/e-commerce/extensions/additional-fees/additional-fees-service-plugin/extension-config.md). ### Step 3 | Define handler functions Use [`additionalFees.provideHandlers()`](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions-with-the-sdk.md#step-4--define-handler-functions) to define the following handler functions that implement your custom business logic. Make sure you define all required functions. | Function | Required | |-----------------------------|----------------| | [`calculateAdditionalFees()`](https://dev.wix.com/docs/rest/business-solutions/e-commerce/extensions/additional-fees/additional-fees-service-plugin/calculate-additional-fees.md) | Yes | ## Code examples Below is an example for implementing the Additional Fees service plugin in your code. ### CLI: Basic code structure This is the basic code structure for implementing the Additional Fees service plugin with the Wix CLI: ```js import { additionalFees } from '@wix/ecom/service-plugins' additionalFees.provideHandlers({ calculateAdditionalFees: async (payload) => { const {request, metadata} = payload; // Add your logic here } }); ``` ### Self-hosted: Basic code structure This is the basic code structure for implementing a self-hosted Additional Fees service plugin: ```js import { createClient } from '@wix/sdk'; import { additionalFees } from '@wix/ecom/service-plugins' const wixClient = createClient({ auth: { appId: