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
baseUriSpiBaseUri

Base part of your integration's deployment URI for the Custom Charges SPI. For example "https://provider.example.com", if Wix should call your integration at https://provider.example.com/v1/charge-limit for the Get Charge Limit method.

Custom Charges Extension Config
JSON
{ "baseUri": { "baseUri": "https://my-custom-charges-app.com/", "alternativeUris": { "absoluteUri": "https://www.my-custom-charges-app.com/my-charge-limit", "methodName": "GetChargeLimit" } } }
Did this help?

getChargeLimit( )


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


Wix calls this method to retrieve the initial charge limit for a paid instance of your app. This happens every time a customer is upgrading to a paid version of your app.

You can't update the charge limit after you've set an initial value. Customers can increase the limit in their site's dashboard, currently they aren't allowed to decrease it.

Method Declaration
Copy
function getChargeLimit(
  payload: GetChargeLimitEnvelope,
): GetChargeLimitResponse | Promise<GetChargeLimitResponse>;
Method Parameters
payloadGetChargeLimitEnvelope
Returns
Return Type:GetChargeLimitResponse | Promise<GetChargeLimitResponse>
Example of a `chargeLimit` return value
JavaScript
import { customCharges } from "@wix/app-management/service-plugins"; customCharges.provideHandlers({ getChargeLimit: async (payload) => { const { request, metadata } = payload; // Use the `request` and `metadata` received from Wix and // apply custom logic. return { // Return your response exactly as documented to integrate with Wix. // Return value example: chargeLimit: "1000.00", }; }, });
Did this help?