Well, if you are running with the pace of this digital world, you would be aware of the fact that simply having a website for businesses is not enough.
While merchants today are offering mobile apps to the customer to increase conversion rates, and provide a better user experience by personalizing the shopping experience, the loyal customers needs to be retained and should always have a hassle-free experience for subscriptions. We could have chosen to build the feature ourselves but we know we couldn't have done it better than you so here is a simple process for integrating Recurpay with your mobile app:
Note: The steps are only for Recurpay checkout and not for any other ecommerce platforms native checkout.
Showing the subscription options on the Product page.
Do a GET request for the respective product by calling the Plans API to get the selling plan details from Recurpay along with the product details in the payload.
The response received from the above API call will have the plan info which needs to be shown to the end customer.
Loop the plans array and fetch the plan details. The plans is an array of objects which will contain the plan id, plan name, and discount that needs to be shown to the end customer. Create a dropdown with all the plan names for the respective product, add it as an option and show it to the end customer.
The selling_plan_id and selling_plan_group_id won't be required here since it's not a native shopify checkout integration.
While calling add.js or change.js API to add a selected product on the cart pass the selected plan id as parameter _PlanId and plan name as parameter Plan in the properties object.
When the customer clicks on the checkout, loop in through all the items in the cart. If any of the items in the cart contains the line item property _PlanId that means it's a subscription product and Recurpay checkout needs to be initiated otherwise initiate the normal Shopify checkout.
To initiate Recurpay checkout, call our Initiate Checkout API along with the cart data in below format:
Note: In case any of the line item is not a subscription item just don't pass the entire plan object for that specific line item.
5. You will get a checkout URL from the initiate checkout API response called in Step 4. Just redirect the customer to the specific URL received in the response and it's done :)
Facing any issue with integrations? Click the green chat button or write us at firstname.lastname@example.org