API: Subscription Changes
Recurly makes it easy to modify a subscription. When you request a change to a subscription, you may specify if the change should take place immediately or when the subscription renews.
Modifying an existing Subscription
Changing a subscription can update the subscription's plan, price, quantity, or add ons.
Please see the Upgrades and Downgrades information for more about the logic we use to modify an account's current subscription.
Parameters
- timeframe
- Required. Please specify "now" or "renewal" to delay the change until the subscription renews.
- plan_code
- If specified, change the subscription plan
- quantity
- Optionally changes the quantity on the subscription
- unit_amount_in_cents
- Optionally override the unit amount in cents of the subscription plan
- add_ons
- If provided, explicitly define all the add-ons for the subscription.
- add_on_code
- Unique add on code to identify the add-on
- quantity
- Optionally override the default quantity of 1
- unit_amount_in_cents
- Optionally override the default price of the add-on
Timeframe
The timeframe parameter controls when the upgrade or downgrade takes place. The subscription chance can occur now or when the subscription renews. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to "renewal" so the change takes affect at the end of the current billing cycle.
Please see the Upgrades and Downgrades information for more about the logic we use to modify an account's current subscription.
Plan Code, Quantity, and Unit Amount
Values not specified will be not be changed.
If the subscription plan changes, the unit amount will default to the new plan's unit amount. Of course, you are welcome to override the plan's unit amount by specifying it in the change request. If you change the subscription plan but do not specify a quantity, the new subscription will use the same quantity as the previous subscription.
Add-ons
Any add ons included in the subscription change request will be applied to the new subscription. The original subscription's add ons will not be carried over to the new subscription automatically.
Request
Status: 200 OK Content-Type: application/xml; charset=utf-8
1 | <subscription> |
Look up a subscription with pending changes
When looking up a subscription that has pending changes, the new subscripion details will be in a pending_subscription node. Since immediate subscription changes take place immediately, pending subscription changes will only show for changes occuring at the subscription renewal.
Pending subscription parameters
- plan
- Specifies the new plan
- unit_amount_in_cents
- Unit amount in cents after the change
- quantity
- Quantity of the subscription after the change
- add_ons
- The complete list of addons after the change
Response
Status: 200 OK Content-Type: application/xml; charset=utf-8 ETag: "17e9af50489ec928feda798be95f02ee"
1 | <?xml version="1.0" encoding="UTF-8"?> |
