Use this API to get a direct login URL so that you can redirect your customer directly login into SUBPLACE
By calling this API, you are attempting to get direct login URL from SUBPLACE. You can either redirect to the URL or embed it with in your App or website. The URL will either bring the user to the specific plan page or your store page depends on the parameter you pass in while calling the API.
The direct login will only work if you pass in SSO token of the user while calling the API.
If no SSO token is passing in, the system will return you a SSO linkup URL. This URL will prompt the user for their mobile number and ask for the concert to linkup or to create a new account (if the mobile number not present in SUBPLACE as a mobileID) by sending the user an OTP to fill in as a verification and confirmation. After user done the process, SUBPLACE will return the subscriber SSO token through the "redirect_url: that you passed in while calling the API. For more detail, please refer to Subscriber Account Linkup API.
After getting the SSO token, please make sure you save and link it with your customer account so that you can recall the API again to get the exact direct login URL.
Please proved with the following section only if you have done either:
API Suffix: /subscriber/login/url
Method: POST
A successful API call will return you the following response in JSON format
{
"status": {
"code": 1,
"message": "Success"
},
"subscriber": {
"sso_url": "https://subplace.ownapp.asia/login/sso?token=86867BA0-2240-4847-8CA1-466F574CDEF8&hash=27e5c6178cf83e0785a6f569dd67e28493ce95b3c0fb69998d1f36748a1ee425&image=https://file.ownapp.asia/subplace_stage/admin/partner/a4c184beaac6a297955550de00c1b6db/thumbnail/7fbc4dac36900cc601eb15e9df64db17.webp&is_sso=1&redirect=%68%74%74%70%73%3A%2F%2F%73%75%62%70%6C%61%63%65%2E%6F%77%6E%61%70%70%2E%61%73%69%61%2F%70%6C%61%6E%2F%52%69%63%65%2D%42%61%6C%6C%2D%31%36%34%36%33%39%35%37%37%34%33%32%30%34%30%33%39%3F%72%65%66%65%72%65%6E%63%65%3D%31%32%33%35%2F%33%33%36%35%2F%32%32%34%35&bp_redirect=https://subplace_admin.ownapp.asia/login&bp_homepage=https://subplace_admin.ownapp.asia/login"
}
}
With the direct login URL, you can either redirect your customer to the URL or embed the URL under your frame. Your customer will be directly logged into their SUBPLACE account with the registered mobile numebr in your system as SUBPLACE mobileID.
There are 3 pages URL that you can request from this API:
BP Store Page - by passing in the store_url which is the suffix of the BP store page direct URL that BP set in their SUBPLACE admin account
Plan detail Page - by passing in the plan_id of the destinated plan which the id you can get from the Plan API.
Subscription List - by passing in the is_view_order with value = 1. In this page subscriber can:
View ther orders and subscriptions
Change card that tagged to their subscription
Change delivery address to any Recurring Delivery Subscription plan for the next delivery
Please make sure you have created 2 pages in your system:
Page to handle the successful purchase
Page to return if the session expired in SUBPLACE SSO
Make sure you pass in also the 2 URL via a the API
redirect_url
bp_homepage
If the customer completed the order successfully, SUBPLACE will post the result back to your "redirect_url" with the following data in the form.
orderStatus = "success"
If the customer did not proceed with the order and let the session expired, SUBPLACE will redirect to "bp_homepage".
The SSO API support 3 level referral code. If you are running any referral program for your plans, you may pass in the referral code from your system to SUBPLACE via the API. All the order placed within the SSO session via the URL will have a referral code record in the order list and order details in your SUBPLACE BP account.