I see many apps on the Shopify App Store offering billing based on the plan or tier of the shop.
E.g. 3$ for SHOPIFY BASIC shops, 8$ for SHOPIFY & ADVANCED shops and 15$ for SHOPIFY PLUS.
I would like our application to have a similar pricing model.
I understand the concepts behind the Billing API and how to work with it, what I haven't figured out is how to definitely identify which pricing tier to apply for a given shop, based on information available about the shop.
The ShopPlan GraphQL data endpoint (https://shopify.dev/docs/admin-api/graphql/reference/store-properties/shopplan) lets us know if a shop is on Shopify Plus, so that can easily be validated.
My struggle is with distinguishing between Basic and Advanced shop plans.
Apparently, using the plan's name is no good, because we don't know all possible values and there is no reasonable way of handling all unknown names. What should I charge the merchant if shop plan is custom, singtel_basic, singtel_unlimited, dormant or any unknown value?
Another approach I explored is distinguishing shop tiers by checking for available features.
One unambiguously distinctive feature seems to be Locations (the max number of locations allowed for the shop) - Basic: 4, Shopify: 5, Advanced: 8.
The data is accessible in GraphQL via Shop.resourceLimits.locationLimit (https://shopify.dev/docs/admin-api/graphql/reference/store-properties/shopresourcelimits).
Basing the billing of merchants on 'secondary' data like available features seems to be a very inelegant and error prone solution to me.
Is there really no standard way of building tier based pricing? (I couldn't find any Shopify-provided resources on the topic so far)
Do you think the Locations approach is sensible or can you think of scenarios in which that solution will break?