#NEWJOSSY
1 messages ยท Page 1 of 1 (latest)
This section talks about how to use expansion https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes, I tried many ways, but it does not work ๐ฆ
Here is my code
`CustomerService customerService = new();
CustomerGetOptions customerGetOptions = new();
customerGetOptions.AddExpand("data.customer.subscriptions");
Customer customer = await customerService.GetAsync(stripeCustomerId);`
And i tried many variations
customerGetOptions.AddExpand("subscriptions");
customerGetOptions.AddExpand("data.subscriptions");
and in response I get Subscriptions as null
AddExpand("subscriptions"); should work. I am properly expanding the subscriptions on one of my customers right now with that exact same code so that is hopeful at least
Have you double checked that that customer does actually have subscriptions?
Also what API version are you using? I may be using a different one though I think any of them with this param should work
here is my customer cus_NpG5vdLqQYWs55
My NuGet version is 41.4.0
And as I see from logs API version is
2022-11-15
Here is video
Thanks for the info. Checking in to what the difference might be
Hi there ๐ taking a look, please bear with me a couple moments while I do.
Ok
Looking at the requests we received, it looks like we aren't receiving the expand parameter.
Looking back at your code sample, it looks like you aren't including the options that you're specifying when making the request. What behavior do you see when you include customerGetOptions as the second parameter to GetAsync?
I do believe subscriptions is the correct value to pass to the expansion option.
In there it still looks like you are not passing customerGetOptions to GetAsync
No worries! It took us a while to spot it as well ๐
Big thanks once more ๐ Have a good day !
Thank you, hope you do the same! ๐