less than a minute read • Updated an hour ago
Upgrade or downgrade a subscription
How to replace the products in an existing subscription using sub_modify=replace, for use cases like plan changes and auto-ship updates.
To upgrade or downgrade a customer’s subscription, use the sub_modify=replace parameter combined with a sub_token to completely replace the existing subscription’s products with new ones.
By default, loading a sub_token into the cart appends products to the existing subscription. Adding sub_modify=replace changes this behaviour so the existing products are replaced entirely.
How to set it up
For example:
https://YOURSTORE.foxycart.com/cart? name=Premium+plan&price=40&sub_frequency=1m &sub_token=TOKEN&sub_modify=replace
When the customer completes checkout, their existing subscription products are replaced with the new ones.
Use cases
Plan upgrades and downgrades: Build upgrade and downgrade links for each plan combination. When a customer clicks the link and checks out, their subscription is updated to the new plan.
Auto-ship subscription changes: If a customer has a subscription containing multiple products and wants to change the product mix entirely, use sub_modify=replace to swap out the full set of products in one transaction.
Notes
sub_modify=replacedoes not prorate the subscription. If the customer is mid-period, any price difference between the old and new subscription is not adjusted.To remove an end date from the subscription when replacing it, include
sub_enddate=00000000in the link.Any new subscription products added via a
sub_tokenwill automatically have theirsub_startdateset to the next scheduled date for that subscription, preventing the customer from being charged again for the current period.PayPal Express (non-Reference Transactions) does not support subscription modification via
sub_token. Foxy strongly recommends using the Reference Transaction option for PayPal Express Checkout.