I can fetch a Subscription object from Stripe, but I need to retrieve the ProductID it contains, and I don't know how to parse the object to get it. The Stripe docs are kinda confusing on this. I would appreciate any help. I am using C#.
I fetch the Subscription using this code in a function that returns a Stripe.Subscription object:
var service = new SubscriptionService();
return service.Get(subscriptionID);
Once I get the Subscription object back, how do I parse it in C# to get to the ProductID?
Thanks for the help!
After you call your function, you should already have a Subscription object with an array of items (stand for Subscription Item) inside. Within each item you should have the Price object inside, with its Product Id. Here is the Subscription object structure down to ProductId. You will just need to loop through subscription.Items
and get Item.Price.Product
.