Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How to determine if a store is eligible for subscription discounts

How to determine if a store is eligible for subscription discounts

roane
Shopify Partner
1 0 0

In the graphql api i can create discounts for normal purchases & subscriptions using this mutation: https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/discountCodeBasicCreate

however, if a store does not have subscription purchases enabled then the `applies_on_subscription` field of the above mutation causes an error when you fire the mutation (even if the field is set to false). The error is: "applies_on_subscription field is not permitted without the shop using subscriptions"

To fix this I've used this query: https://shopify.dev/docs/api/admin-graphql/2023-10/queries/shop to determine when a store is `eligibleForSubscriptions` (under `features.eligibleForSubscriptions`). HOWEVER, even that query doesn't work in all cases. I've found stores where `eligibleForSubscriptions` is true but I still get the "not permitted without the shop using subscriptions" error.

So, what can a developer query to determining when a shop is using subscriptions?

Replies 0 (0)