#genesisisamazing
1 messages · Page 1 of 1 (latest)
hello! can you share an example Subscription id?
` var subscriptionService = new SubscriptionService();
var subscriptions = await subscriptionService.ListAsync(new SubscriptionListOptions
{
Customer = customer_id,
Expand = new List<string> { "data.plan.product", "data.latest_invoice"}
});`
a subscription id is prefixed with sub_ e.g. sub_1Mp1Q8JQtHgRImA7uNe4ibLd
oh you need the id, sub_1MswoDHACfx1gPx5Enz6UCRP
to clarify, you don't receive any list of subscriptions, or data.plan.product is null?
I receive the subscription list but the product data is null
have you tried with data.price.product?
yes, it says the property cannot be expanded
gimme a second to test what's the correct parameter to use here
hrm, does the below work for you?
var options = new SubscriptionListOptions
{
Expand = new List<string> { "data.plan.product" },
};
var service = new SubscriptionService();
StripeList<Subscription> subscriptions = service.List(options);
it's still returning null
can you paste the output of the first Subscription in the list?
the json string?
yep
<Stripe.SubscriptionItem@66344018 id=si_NeFIZUGkl5A6Tt> JSON: { "id": "si_NeFIZUGkl5A6Tt", "object": "subscription_item", "billing_thresholds": null, "created": 1680564550, "metadata": { "virt_server_id": "31" }, "plan": { "id": "price_1MsmzpHACfx1gPx5RdotYHKk", "object": "plan", "active": true, "aggregate_usage": null, "amount": 1000, "amount_decimal": 1000.0, "billing_scheme": "per_unit", "created": 1680526829, "currency": "gbp", "interval": "month", "interval_count": 1, "livemode": false, "metadata": {}, "nickname": null, "product": "prod_Ne5ACO4KcujRIl", "tiers": null, "tiers_mode": null, "transform_usage": null, "trial_period_days": null, "usage_type": "licensed" }, "price": { "id": "price_1MsmzpHACfx1gPx5RdotYHKk", "object": "price", "active": true, "billing_scheme": "per_unit", "created": 1680526829, "currency": "gbp", "currency_options": null, "custom_unit_amount": null, "livemode": false, "lookup_key": null, "metadata": {}, "nickname": null, "product": "prod_Ne5ACO4KcujRIl", "recurring": { "aggregate_usage": null, "interval": "month", "interval_count": 1, "trial_period_days": null, "usage_type": "licensed" }, "tax_behavior": "unspecified", "tiers": null, "tiers_mode": null, "transform_quantity": null, "type": "recurring", "unit_amount": 1000, "unit_amount_decimal": 1000.0 }, "quantity": 1, "subscription": "sub_1MswoDHACfx1gPx5Enz6UCRP", "tax_rates": [] }
isn't this a SubscriptionItem? Shouldn't it be a Subscription object?
give me a while to try in a dotnet project
hmmm, okay, this is maybe a problem with the .NET sdk - we can reproduce the same issue, but it works in other languages. Can you https://support.stripe.com/contact/email with your code and the question? Once you've written in, let me know so that we can grab the ticket, we'll look into this and let you know