This article presents a sample flow your app can support. You aren't limited to this exact flow, but it can be a helpful jumping off point as you plan your Additional Fees integration.
A site owner installs and authorizes your 3rd-party app to provide additional fee calculations based on various factors (line items, shipping info, and buyer details). The app collects the JSON Web Token (JWT), decodes it, and stores the resulting instance ID.
For example, the token in this request:
Decodes into:
A customer logs on to the merchant’s Wix site and adds a product to the cart or checkout.
Wix sends a Calculate Additional Fees service plugin request to your app. The payload will include some or all of the fields described in the Body Params and example sections of Calculate Additional Fees. The payload will also include the currency
in a context
parameter in the request envelope.
Your Additional Fees integration triggers the required flow on its platform and processes the request.
Wix expects an object containing the additional fees calculated, the currency of those fees, and either a 4xx HTTP status code or a 200 HTTP status code.
Example of a successful response from your app:
The Wix site displays the additional fees on the cart or checkout page (depending on which page triggered the service plugin request). The customer can confirm the additional fees before proceeding to payment.