A service plugin is a configuration file plus a handler. You generate the files first, then spend most of your time in the handler.
This article walks through that loop for an Ecom Additional Fees plugin. Other plugin types use the same two files. The handler's functions and return value depend on the type you chose.
Follow the instructions below to:
Start from a generated service plugin rather than an empty folder, so the file structure and registration are already in place.
For the full procedure, see Add a Service Plugin Extension in Studio Two.
You can find the new files under src/extensions/backend/service-plugins/<plugin-name>/. You spend most of this article in <plugin-name>.ts. For what every file in the folder is for, see Service Plugin Extension Files and Code.
<plugin-name>.extension.ts is the configuration file. For an Ecom Additional Fees plugin it looks like this:
Keep id stable. name matches the folder name. source is the path to the handler, relative to src/.
The builder function changes with the plugin type. Generate picks the function that matches the type you chose. For every field, see Service Plugin Extension Files and Code.
<plugin-name>.ts is the code Wix calls. A generated Ecom Additional Fees handler returns no fees:
request is the cart and checkout state Wix sends. metadata includes the call context. Your return value has to match the method's contract or Wix ignores the response.
For example, to return a fee:
<plugin-name>.ts.additionalFees array with the fees you want to add.With one fee in the array, the handler looks like this:
currency has to match the site's currency. The fields each fee needs, including the name and amount, are on Calculate Additional Fees.
For any other plugin type, open that plugin in Available Service Plugins and use its API reference for the handler functions and the response.
To check the plugin, trigger the Wix flow that calls it. For additional fees, that is a checkout on a site with an eCommerce app installed. See Add a Service Plugin Extension in Studio Two.
When the plugin behaves the way you want, click Publish in the Studio Two editor to ship it with your site.
Last updated: 2 November 2026