Here are the steps to create a custom subscription flow on the product page of your Shopify store:
Note: The steps are only for Shopify and not for any other Ecommerce platforms.
Do a GET request for the respective product by calling the product js API to get the selling plan details from Shopify
https://{{shop.permanent_domain}}/products/{{product.handle}}.js
The response received from the above API call will have the selling plan info which needs to be shown to the end customer.
https://shopify.dev/api/ajax/reference/product#selling-plan-example
Loop the selling_plan_groups object and fetch the selling_plans. The selling plans is an array of objects which will contain the plan name and discount that needs to be shown to the end customer. Create a dropdown with all the selling plan names as an option and show it to the end customer.
Recurpay automatically creates and manage subscription selling plans on Shopify store so you need not use our direct APIs for the integration.
While calling add.js API from Shopify, pass the selected selling plan id if customer selects subscription option and redirect customer to cart page on success.
https://shopify.dev/api/ajax/reference/cart#add-a-selling-plan
Eg:https://{{shop.permanent_domain}}/cart/add.js
Facing any issue with the flow? Click the green chat button or write us at help@recurpay.com