Hi everyone. I’m using Shopify as a headless ecommerce for a NextJS website that I’m developing It has been a great experience using the Storefront API to manage the cart, fetch products, etc.
I’m now working on the account page and I want to fetch all orders for a customer, which seems to be really easy, but it looks like the Storefront API doesn’t support getting active subscriptions for a customer, or seeing if an order is associated with a subscription/selling plan. Additionally I want the customer to be able to cancel a subscription.
I can see that the Admin API can list subscriptionContracts for a Customer, but is there a reason why the Storefront API can’t? I also can’t find anything on the roadmap other than that the Subscriptions API is supported in the Storefront API, but in reality it’s only partly supported (unless this is by design).
As a plan B I’m thinking about creating my own API to manage subscriptions through the Admin API, is there a way to cancel a subscription through the Admin API?
Hi RaRaRa - I’m looking to do this exact same thing. Did you find a solution? How did you manage to do it? Did you use the admin api? Did you manage to figure out a way to cancel subscriptions? Or perhaps even a skip next order feature?
Through Admin API you cant to fetch all subscription of user only subscription that created through this app.
That’s why scope named like: read_own_subscription_contracts
You can use Customer Account API to get all customer subscription and other information. just change you auth function to OAuth and use exchange token for requests - https://shopify.dev/docs/api/customer#retrieving-nonce