reviewing the new App Pricing and I’m stuck on something.
My app lets merchants create and delete collections (a custom resource managed by the app). I want to bill based on how many active collections they currently have, not how many they’ve ever created.
The problem is the App Events API only accepts value > 0, so the meter only ever goes up. Sending +1 on creation is not the same as tracking active count.
Is there an official pattern for this? Would periodic snapshots work (sending current count once a day)? Also the negative reporting mentioned in the announcement. Does that apply here or is it only for correcting a specific past event like a bounced message?
And last, any advice on preventing merchants from gaming this by deleting and recreating collections right before the billing cycle closes?
I haven’t got an answer in this thread I’d like to know how if there is a way we can leverage the new pricing model to bill per collection that’s managed by the app. Which will help offering better and more flexible pricing for small merchants.
As far as I know Shopify stated (still not publicly documented in the docs) that the usage charges on app pricing also allows negative values so you can remove usage charges you once charged without having to make refunds. But it must be in the current billing period, you cannot remove usage charges that were already billed and paid.
thank you for sharing. I suppose we’ll have to do something like bank’s interest systems do. That is: take an average of the daily number of items on the month. Otherwise it will be easy for ill-intended users to delete and re-create once a month to skip the billing.
I was hoping for something easier.
I can check myself by searching, but if by any chance you know the answer: do you know if this new pricing system can automatically adapt to the number of products in the store without having to manually bill per product?
Thank you, I think it will help. We will probably develop something based on bucketing the number per day or so and have the average reported in the billing.
For example if they have
10 items on day 1
100 items on day 2
back to 50 items on day 3
we would average (10+100+50)/3 = 53.
Just adjust the current billing to match this amount. Unless you see another way of doing that, it will help to protect against abuse while offering better pricing for everyone.
Not the ideal solution as we have to manage the pricing internally and we’re not protected from mistakes, but should work.
We updated the App Events API to allow for negative and fractional values. This might allow you to adjust a customer’s collection count during a billing period.
Hi @chriso thank you for confirming. Regarding the pattern I described to get an average by a given time interval and adjust positively/negatively based on the currently register value VS the average. Do you think it’s an appropriate use of the new pricing system, or do you have plans to support this use case in a simpler way?
It’s important to know as we want to avoid developing something specific if shopify ships it soon
Hey @Soufiane_Ghzal if I would be you, I would collect all the data (number of collections) each day and save it in your database somewhere. On the day or a day before of the billing period end I would send the event with the median average or just the average to the events api to be billed for.
Also when a customer uninstalls before the end of the billing period, the events api gives you (I think) 24 hours to send usages still that have not been billed for even after they uninstalled.
In that way it is easy for you to manage and you must not correct the billing each day or so.