About Wix Functions APIs

The Wix Functions APIs allow you to manage a site's Functions through code.

With the Wix Functions APIs, along with the Automations API, you can control every aspect of a site's functions.

What are Wix Functions?

Wix Functions allow you to create custom business logic that integrates with Wix's business solutions. Functions run at specific points in a business solution's workflows. Using functions, you can create custom behaviors, validations, and integrations that aren't available by default. For example, adding a fragile packaging fee to a checkout flow.

The simplest way to implement Functions on your site is to use the Functions dashboard page. This page allows you to manage your site's functions and their logic through a no-code interface.

How Functions extend site functionality

Functions work by integrating with existing Wix business solutions through a service plugin architecture. You must build each function from a function type that a service plugin defines and that specifies the following:

  • When the business solution calls the function.
  • What parameters the function accepts.
  • What the function returns.

Learn more about function architecture.

When to use the Functions APIs

In most cases, it's simplest to add functions to a site using the site's dashboard. However, there are some cases when developing an app or a site where you need to use APIs:

  • Apps: To use functions in an app, you must use the Functions APIs.
  • Sites: To manage functions dynamically. For example, to activate functions based on site events rather than manually editing the site's Functions page.

Use cases

Terminology

  • Business solution: An app built by Wix, such as Wix Stores.
  • Function: Logic that runs at a specific point in a Wix business solution's workflows.
  • Function extension: Another name for a function type.
  • Function method: An objects that connects logic, defined in an automation, to a function.
  • Function type: A slot for a function within a business solution workflow that defines when the function runs and what data it receives and returns.
  • Function template: An implementation of a function type with attached logic from which you can create a function.
  • Service plugin: An interface that defines how a function integrates with a Wix business solution.
  • Service plugin configuration: Static data that's sent to a business solution when a function runs.
  • SPI: Service plugin.

See also

Did this help?