As a custom charges provider, you can integrate with Wix to allow a merchant to manage what customers must pay to use an app. This includes regularly recurring base prices, installation and usage fees, and any other custom charges.
The integration is done via an app in the Wix App Market and by implementing the Custom Charges service plugin. After the app is installed on a site, Wix triggers a call to your service when specific actions are taken on the site. Refer to each function's description for details about those actions.
Using the service plugin, you can design your app to:
It’s important to note the following points before starting to code:
AUD
, BRL
, CAD
, EUR
, GBP
, ILS
, INR
, JPY
, MXN
, PLN
, RUB
, TRY
, USD
. Wix may add more currencies in the future.instanceId
instead of the subscriptionId
to track usage and billing for apps.Follow these steps to begin implementing your service plugin.
You can implement this service plugin using a self-hosted deployment. Learn how to implement a self-hosted service plugin with the SDK and the Wix Dev Center.
To configure and customize your plugin, you need to provide important information in the service plugin configuration file. You can configure your plugin in the Wix Dev Center. For details, see Custom Charges Extension Configuration.
Use customCharges.provideHandlers()
to define the following handler functions that implement your custom business logic. Make sure you define all required functions.
Function | Required |
---|---|
chargeLimitUpdatedEvent() | Yes |
chargesRejectedEvent() | Yes |
getChargeLimit() | Yes |
invoiceCreatedEvent() | Yes |
listCharges() | Yes |
Below is an example for implementing the Custom Charges service plugin in your code.
This is the basic code structure for implementing the Custom Charges service plugin with the Wix CLI:
This is the basic code structure for implementing a self-hosted Custom Charges service plugin: