We recently released a subscription app and there are some eligibility requirements for merchants to use these apps, my question is:
Is there any way to find whether the merchant installs our app is eligible or not? by an API or something else.
We want to inform them at the onboarding to solve this issue, first. Some apps including Recharge have this.
Or as an alternative is there any API that we can find the payment gateway of a merchant’s store?
Hi, Koorosh. Thanks for the question. You can directly query if the shop is eligible for subscriptions via the shop features query. If that doesn’t help, let me know.
Easy enough. But is there someway to break this down further, possibly a reason field I didn’t see anything in the schema to take that any further. There are a lot of requirements that all seem to come from different APIs so it would be helpful to know exactly where you’re getting caught up.
I appreciate what you’re asking. I can’t speak for the product decision about this, but I can imagine that this could be quite difficult to do correctly in a centralized way. Each application will have its own requirements and interdependencies. It may be easier and safer to leave it up each application. We’ll keep this in mind for the future.
But if the shop features query is returning whether or not a shop is eligible for subscriptions let’s say as an example, there’s some logic on the backend that’s checking that certain parameters are met I’d assume. Why not just return the failed parameters as a reasons field, perhaps as:
Query:
query Shop {
shop {
name
features {
eligibleForSubscriptions
incompatibilities {
edges {
node {
id
feature
reason
suggestion
}
}
}
}
}
}
Response:
{
"data": {
"shop": {
"name": "graphql-admin",
"features": {
"eligibleForSubscriptions": false,
“incompatibilities”: [
{
“id”: "gid://shopify/ShopFeatureIncompatibility/1234567890",
“feature”: "eligibleForSubscriptions",
“reason”: "Payment gateway incompatible",
“suggestion”: "To use the Subscriptions API's the Shopify Payment
Gateway must be enabled as one of the available payment
gateways."
}
]
}
}
},
"extensions": {
...
}
}
We don’t try to track all the reasons an app or a shop might be ineligible for subscriptions. Some of the decisions are made by humans, not the software, and the range of reasons could be almost anything. So as an app developer, it’s much better that you understand the requirements for your app, and publish the requirements for merchants to install your app. I hope this helps.
I may not be clear as to the purpose of the eligibleForSubscriptions query then- Is there not a specific set of configurables that need to be set up for the query to come back as true? I thought this query checked a store, not an app, against specific requirements dictated by Shopify to be eligible to have the Subscriptions API enabled and working. Otherwise, how would the query be able to run immediately and return a response so quickly if it was being vetted by humans first?
I am proposing that the incompatibilities connection return the reasons why a false result is produced against a store for not being eligible. As a quick example, I ran the eligibleForSubscriptions query against my dev store while initially developing my subscriptions app, and it was coming back false. I had no clue why, but I just knew the Subscriptions API wouldn’t work correctly if it weren’t. I ended up parsing documentation and eventually these forums to figure out that I needed to have the Shopify payment Gateway enabled in test mode to have the eligibleForSubscriptions query come back true. So I was only off by that one requirement, but had that been returned initially, I could have fixed it immediately. It just would have been a much more relevant response. Right now, if false is returned, it’s the same as saying you are not set up correctly. We at Shopify know why you’re not eligible, that’s why we returned false, but that’s not being told here. Am I not understanding the point of the features/eligibaleForSubscriptions query?
My store has a subscription app installed with subscriptions set up. I can create discount codes that are enabled subscriptions.
Yet the shop features gql response says that the store is not eligible for subscriptions. Which is a false negative.
The only solution I have found, is to create a discount code with subscription usage enabled, and if it succeeds, use that as an indication that subscriptions are enabled.