Switch WebUI

In the WebUI implementation of Switch, Minna will guide the user through the process of switching subscriptions in different categories. The following section, and flowchart below, describe the actions you need to perform to get the Switch WebUI up and running.

954954

Overview of the steps for switching a subscription through the WebUI

Improvable subscriptions

Before being able to switch a subscription you need to determine if the subscription is improvable or not. To answer this question, you need to conduct a service provider synchronization. A service provider is improvable if the serviceProvider.actions.improve option is Improvable .

Fetch the WebUI URL

The webUI URL is fetched through the Manage subscriptions endpoint. In the request you are required to provide a service provider ID. You can optionally provide the action to be taken, improve in this case, and a service ID. For the user to be able to make informed decisions about possibly changing subscriptions, you should also provide the cost of the subscription, and the interval at which it is paid. Without this information the user will be unable to compare pricing which can give a poor or confusing impression.

If you provide a service ID, Minna can avoid asking the question "Which service do you want to switch?" resulting in a smoother user experience. Example request including all parameters:

curl 'https://developer.minna.tech/v1/users/5d7777b2-07d0-49d9-9821-fa5c3c51aee9/manage-subscriptions/webui' \
-H 'Authorization: Bearer 582020ed-d70a-4724-87ed-a02da52998ae' \
-X 'POST' \
-d '
{
  "serviceProviderId": "82b4c9bd-c930-4f27-b843-ff1064d5c2f4",
  "serviceId": "281b8839-aaee-4e2d-918d-07fd59d9c8a2",
  "action": "Improve",
  "cost": {
    "amount": 100,
    "currency": "EUR"
  },
  "interval": {
    "amount": 1,
    "unit": "month"
  }
}'

It is possible to for you to allow the user to perform an action earlier on your side by having a "Switch" button in your UI. The user will be directed into the user flow for that action.

Open the WebUI URL

To display the webUI to the user, please refer to the Opening WebUI URLs guide.

The user will be logged in automatically to the Minna application and see their subscription. From there, they can choose to enter the Switch user flow. When the user finishes the flow, the WebBridge event CLOSE_WEB_VIEW will be sent. For more information on WebBridge events, see the general Webview guide.


What’s Next
Did this page help you?