Subscription-managed entitlement: immediate upgrade while preserving current-period usage #4394
Unanswered
zmingsgithub
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi OpenMeter team,
We are running a self-hosted OpenMeter OSS deployment with Helm on Alibaba Cloud ACK.
1.0.0-beta.227/api/v1and customer entitlement/api/v2api_creditsapi_creditspoc-test-20250519Our product requirement:
freetostartershould take effect immediately.startertofreeshould take effect at the next billing cycle.Plan setup
The plans use subscription-managed metered entitlements through
rateCards[].entitlementTemplate.Example free plan entitlement:
{ "type": "usage_based", "key": "api_credits", "name": "API Credits", "featureKey": "api_credits", "billingCadence": "P1M", "price": null, "entitlementTemplate": { "type": "metered", "issueAfterReset": 50000, "usagePeriod": "P1M" } }Example starter plan entitlement:
{ "type": "usage_based", "key": "api_credits", "name": "API Credits", "featureKey": "api_credits", "billingCadence": "P1M", "price": null, "entitlementTemplate": { "type": "metered", "issueAfterReset": 550000, "usagePeriod": "P1M" } }Current validation flow
1. Check customer subscription and entitlement value
2. Send a usage event
Then check entitlement value again:
Expected before upgrade:
{ "totalAvailableGrantAmount": 50000, "usage": 3, "balance": 49997 }3. Try change subscription from
freetostarterObserved behavior:
0from the entitlement value perspective.This causes native
entitlements.balance.thresholdnotifications to lose the previous current-period usage.4. Try overriding the customer entitlement after subscription change
We tried to force the new entitlement to measure from the current period start:
Observed response:
{ "type": "about:blank", "title": "Forbidden", "status": 403, "detail": "forbidden error: entitlement is managed by subscription" }So
overridedoes not seem to be allowed for subscription-managed entitlements.5. Possible workaround:
edit subscriptionInstead of
change subscription, we can try editing the current subscription item and changing the entitlement limit from50000to550000.If the item already exists, try remove and add:
This might preserve current-period usage, but it does not appear to change the subscription plan key from
freetostarter.That means the entitlement behavior becomes starter-like, but the subscription still looks like the free plan.
We are also not sure whether this only edits the current subscription's rate card for the current timeline, instead of making the subscription truly become the
starterplan for future billing periods. If so, the customer might not automatically continue as a starter subscriber in the next billing cycle, which would not satisfy our product requirement.Question
For subscription-managed entitlements, what is the recommended way to implement this upgrade/downgrade lifecycle?
Required behavior:
free -> starterin the middle of a billing period.starter -> freeshould be scheduled for the next billing cycle.Is
edit subscriptionthe only supported way to preserve current-period usage for immediate mid-cycle upgrades, even if the subscription plan key remains inaccurate?If yes, does
edit subscriptionmake the customer continue with the edited starter-like rate card in future billing periods, or does it only patch the current subscription timeline without turning the subscription into thestarterplan?Or is there a supported way to use
change subscriptionwhile making the new subscription-managed entitlement measure usage from the current billing period start?Notes
We also validated a manual entitlement model:
entitlementTemplateThat model can preserve usage, but it makes next-period reset and plan-to-entitlement synchronization the responsibility of our Portal. We would prefer to keep subscription-managed entitlements if possible.
Beta Was this translation helpful? Give feedback.
All reactions