Products & entitlements
A product, an entitlement, and the difference
BillDog’s public demo: products are what people buy, entitlements what they get. Apps check the entitlement; a store plan change re-maps access to the new one.
Transcript
This line is in a lot of subscription apps, somewhere. And it’s a time bomb with a very specific fuse.
It goes off the day you add an annual plan. Somebody buys it, and this line says no.
There are two things here, and they’re deliberately not the same. A product is something somebody buys. Monthly. Annual. Lifetime.
Each one has a price and a store product ID, and the plans that renew have a billing period. And they multiply, because selling is a business decision, and businesses change their minds.
An entitlement is something somebody has. Here, Premium, and Pro Coach. These stay put, because they’re what your app actually gates on, and your features don’t change every time somebody invents a new price.
So a product grants entitlements. This one, Pro Coach Monthly, grants two: Premium, and Pro Coach.
Look from the other side, and Premium comes from both Premium plans, both Pro Coach plans, and Lifetime.
Your code only ever asks about the entitlement. Add another plan, and you tick it here. The check in your app doesn’t change.
The line from the cold open becomes: does this customer have Premium? And it stops being a time bomb, because the answer doesn’t care which product got them there.
And the moment this stops being tidy bookkeeping, and starts earning its keep, is a plan change.
Say somebody moves from Pro Coach down to Premium. The stores usually apply a downgrade at the next renewal. When the store reports the new product, access is worked out again from its mapping. Premium stays. Pro Coach, which the new product doesn’t map, is taken away. Access from somewhere else, like an admin grant, is left alone.
Worked out from the mapping, not from a list of special cases somebody maintains. That’s the part that’s genuinely hard to write yourself, and the part that goes wrong quietly, because an over-granted customer never files a bug.
Under the hood, a customer’s own grants come from two places, on purpose. A store purchase is worked out again from the purchase and its mapping, every time either one changes.
Everything else, restores, imports from another platform, redemptions, an admin granting somebody access by hand, goes through one shared function, rather than each one having its own idea.
In code, it’s one line. Ask about the entitlement, never the product.
Two nouns. Products change constantly, because that’s what pricing is. Entitlements barely change, because that’s what your product is. Write your app against the one that doesn’t move.