Here is a step-by-step guide for creating addon services that can be linked with your main product for subscription purchase.
Problem Statement - The client sells a product "UP Wireless 4200 Series" of price $129.99, now they want to sell recurring services to the customer along with the main product. Eg: AT&T Service of price $6 so customers will be charged $6 every month for this service once they opt for a subscription.
Create a product on your Shopify admin panel named as Monthly Services and add 3 variants in this with the below details:
Variant 1 - AT&T Service
Price - $6 USD
Variant 2 - Verizon Service
Price - $6 USD
Variant 3 - AT&T and Verizon Service
Price - $10 USD
Now create a monthly subscription plan on the Recurpay dashboard and under the products section choose the newly created product.
https://atm-universal-processors.recurpay.com/plans
Now on your main product page show the addon product with the variants in a dropdown and fetch the subscription plans using our Plans API.
Whenever a user adds the product to a cart, use add.js of Shopify to add the main product and the addon product with the selected plan id.
Please ensure only the addon product will be added as a subscription product.
https://shopify.dev/api/ajax/reference/cart#add-a-selling-plan
That's it, so now whenever a customer goes to checkout they will have a recurring service with their main product. This add-on product will be renewed every month and the customer will be charged accordingly.