Subscription contacts

I’m using the Shopify subscription APP to manage the subscriptions. The custom APP uses subscription based module, so we need the customer subscription information when they logIn. If customer subscription is active then we’ll allow customer, if not then we show the message you subscription expired.

I have tried to Admin Graphql but not able fetch the customer contracts. Is there any other way we can get the subscription contracts. Please let me know.
Thanks!

Perhaps provide some more information on this, any errors etc and we may be able to help.

Using this graphql:

query {
customer(id: “gid://shopify/Customer/id”) {
displayName
defaultEmailAddress{
emailAddress
}
subscriptionContracts(first: 10) {
nodes {
status
}
}
}
}

I’m able to get the customer info, but their subscriptionContracts node is empty.
There is no error.

I checked the customer have order the subscription product I can see in the Order & in the Shopify subscription APP.

Hi @Chandni_Handa! This is expected behavior - subscription contracts are owned by the app that created them, not by the store. When you query subscriptionContracts with the read_own_subscription_contracts scope, you’ll only see contracts that your app created.

Since you’re using the Shopify Subscriptions app to manage the subscriptions, those contracts belong to that app. Your custom app can’t access them even with the subscription scopes enabled. This was addressed in a similar thread where the same behavior came up, and you can read more on how subscription contracts work here in our docs.

If you can share more about how your app is intended to work, I might be able to suggest some workarounds!

Okay, got it.
Is there any other way to get the customer subscriptions.

How about GraphQL Customer Account API.
Reference: Customer Account API reference

But I need the authorization code first. The reference show to hit the authorizationRequestUrl & it send the code in the redirect_uri.

Can we get the authorization code without any redirection or simply make a request, pass all input info & it return the auth code?

Please let me know.
Thanks!

Hey @Chandni_Handa - unfortunately no, there’s no way to get an authorization code without a redirect. The Customer Account API uses OAuth 2.0 with PKCE, which by design requires the user to be redirected to Shopify’s login page and then back to your app with the code. This is a security requirement - the redirect ensures the actual customer is present and consenting. You can read more about the authentication flow here.

That said, even if you implemented the full OAuth flow, I’m not sure the Customer Account API would solve your underlying problem. The subscription contract ownership model still applies - contracts belong to the app that created them. The Customer Account API lets customers view their subscription data from their perspective, but the cross-app access limitation is fundamental to how subscriptions work.

If your goal is to check subscription status when customers log in, here are some alternatives that might work better:

  1. Store a flag on the customer using metafields that any app can read. You’d need to manually update this when subscription status changes (perhaps through the Shopify admin or a Flow automation).

  2. Query the customer’s orders and check for orders with selling plan associations - though this gives you purchase history rather than real-time subscription status.

  3. If you need full control over subscription data, consider building subscription management within your own app rather than using the Shopify Subscriptions app. That way your app owns the contracts and can query them directly.

The metafield approach is probably the most practical workaround if you want to keep using Shopify Subscriptions but need subscription status accessible to your custom app.