Proration
When a subscriber changes plans mid-cycle, Subscribd calculates the appropriate billing adjustment using one of three proration strategies. The strategy can be set globally in config or overridden per swap.Strategies
| Strategy | Behaviour |
|---|---|
now | Charge or credit immediately at the moment of the swap. This is the default. |
renewal | Apply the price difference at the next renewal. No immediate charge or credit. |
none | No proration — the new plan price takes effect at the next renewal with no adjustment. |
Setting the default strategy
Overriding per swap
Pass aprorate option to SwapPlan to override the default for a single swap:
Native vs. Subscribd proration
Some gateways support native proration — the provider calculates and bills the adjustment directly. Others rely on Subscribd’s built-inProrationEngine to compute and apply the credit or charge locally.
| Gateway | Proration |
|---|---|
| Stripe | Native |
| PayPal | Subscribd ProrationEngine |
| Braintree | Subscribd ProrationEngine |
| Paddle | Subscribd ProrationEngine |
| FastSpring | Subscribd ProrationEngine |
| Square | Subscribd ProrationEngine |
| Fake | Subscribd ProrationEngine |
prorate strategy to the gateway’s API call and respects the gateway’s calculated amounts. When using the ProrationEngine, Subscribd calculates the adjustment locally and creates a credit or debit line item on the next invoice.
How the ProrationEngine calculates adjustments
For anow swap mid-cycle, the engine:
- Calculates remaining days in the current billing cycle
- Computes the per-day rate of the old plan:
old_amount / days_in_cycle - Computes the per-day rate of the new plan:
new_amount / days_in_cycle - The credit for unused time =
old_rate × remaining_days - The charge for the new plan =
new_rate × remaining_days - Net = charge − credit; positive values are billed immediately, negative values become credits on the next invoice
renewal swap, no calculation is performed at swap time. The new plan amount is billed in full at the next renewal date.
Previewing a proration
Calculate what a plan swap will cost before executing it:Proration and coupons
Active coupons are applied to the prorated amount when Subscribd calculates the adjustment. If the subscription has a100% off coupon active, the upgrade charge is zero regardless of proration strategy.
Multi-currency
All proration calculations are performed in the plan’s configured currency using the Money library. Currency conversion is not performed — both plans must use the same currency for a swap with proration to succeed. Swapping between plans in different currencies requires anone proration strategy.
Next steps
- Swapping Plans — How to perform a plan swap
- Hooks and Events — Events fired on plan changes