Search code examples
recurly

How to find out what is the next subscription using Recurly?


recurly_account = Recurly::Account.find "xxx account code"
subscription = recurly_account.subscriptions[0]
subscription.update_attributes(:plan_code => "desired subscription type",
:timeframe => 'renewal')

After doing this, Recurly (a subscription manager product) will remember to change this subscription to have the new plan_code when the current cycle ends. My question is whether there is a way to ask this subscription object what is the plan_code that it is going to change to?


Solution

  • It sounds like you want to get pending subscription changes. If you GET the details of a specific subscription UUID, any pending changes will be nested within the response. Take a look at https://dev.recurly.com/docs/lookup-subscription-details for more details.