How to get status of a subscription

Modified on: Wed, 5 Sep, 2018 at 1:36 PM

Getting status for all subscriptions (limit set as 5).


 

$all = ChargeBee_Subscription::all(array("limit" => 5));
foreach($all as $entry){
  $subscription = $entry->subscription();
  echo  "SubID:" . $subscription->id . " - SubStatus: " . $subscription->status . "<br />";
}

 


Getting the status of a particular subscription:

 

$subscription_id="<replace-with-subscription-id>";
$result = ChargeBee_Subscription::retrieve($subscription_id);
$subscription = $result->subscription();
echo "$subscription->status";

 

B
Balaji is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.