Currently, I am testing out how to setup subscriptions on a Shopify store with a headless setup. I connect my Nuxt frontend to the store through the Storefront API with GraphQL.
I have been looking at several subscription apps (eg. ReCharge and Native Subscriptions), but I am facing problems when sending the line items to the checkout. I use the checkoutLineItemsAdd mutation (https://shopify.dev/api/storefront/reference/checkouts/checkoutlineitemsadd) but cannot send the selling plan along to pick up the subscription (and subscription discounts) in the checkout.
Can you help me clarify whether it is possible at the current state of Storefront API/headless setups for Shopify stores or not.
I’ve been battling with this question too and found out, that Checkout API does not and will not support subscriptions.
Cart API does support subscriptions, but the cart API redirects users to cart checkout url. Programmatically completing cart like completing Checkout is not supported as of now.
It is as of now not possible to build a headless subscription setup.
What i’ve come up with to provide headless subscription setup (but not put in action yet), is to:
Create customer with shippingAddress and paymentMethod
Create subscription contract
Associate customer with subscription contract
Create subscription billing attempt
Create order
Something similar what Shopify does backend when a subscription product is bought.
Not sure if this will work, but kind of sounds legit
H_dev were you able to add the subscriptions in your project? I’m able to pull my sellingplangroups and see the percentage discount, but how do I add the product to the card with the discount applied?