Skip to main content
All CollectionsIntegrationsBuilding with Recurpay
Integrate Recurpay with your Mobile App using Shopify checkout
Integrate Recurpay with your Mobile App using Shopify checkout
Sinchain avatar
Written by Sinchain
Updated over a year ago

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:

Showing the subscription options on the Product page.

  1. 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.

    https://{{recurpay_domain}}/api/storefront/v2/plans

    Payload:

    {
    "products": [
    "{{dynamic_product_id}}"
    ]
    }

  2. 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 are 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 is mandatory to add a subscription product using shopify checkout.

  3. While calling add.js API to add a selected product to the cart pass the selected selling_plan_id as a parameter in the add.js data object.

  4. When the customer clicks on the checkout. Use Shopify storefront cart API to create a cart with the items where in the line item object you will be passing the selling_plan_id of the subscription plan selected by the customer for subscription items.

  5. Use Shopify checkout URL API to generate a checkout link for the Cart ID you have received on the 4th step. This will return the Shopify checkout URL in response along with subscription products on which you can redirect the customers directly.


Facing any issue with integrations? Click the green chat button or write us at help@recurpay.com

Did this answer your question?