#CaptainYarb - prices+plans
1 messages · Page 1 of 1 (latest)
Hello, happy to take a look at that screenshot. I think that that is likely part of the backwards compatibility stuff we have with the plans API
Thank you. I think those are expected if undocumented but let me double check
Interesting. I was really excited that it might have been the expanded plan, to prevent further API calls.
What further API calls do you need to make here?
Performing a lookup for the product.
We're showing the current Subscription(s) the user has actively. We don't have the name, the image, or the metadata we need to build the UI.
I think you should be able to still do that. The product should still be expandable here. Have you tried passing in expand: ['items.data.price.product'] or expand: ['items.data.plan.product'] ? https://site-admin.stripe.com/docs/api/subscriptions/object#subscription_object-items-data-price-product
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I did try that, however, the place I discovered this issue on was the Customer retrieve call. With this object we hit the expand limit of 4.
(I then replicated this finding on other Subscription calls)
Oh are you listing the Subscriptions here?
What call was those screenshots from?
The limit of 4 is the limit, that product expansion is just within reach if you do the retrieve subscription call
Again, the screenshot was originally from the Customer retrieve route via expand, but was replicated on the Subscriptions list routes.
Oh I didn't realize that the Customer object had a subscriptions list
Me either until yesterday. It's super nice to have!
So yes, you will need to do at least two API calls to get this info unfortunately
Definitely is! I am surprised it has not come up before
We're heavily using Stripe Billing and are really worried about hitting API rate limits, so we're trying to heavily optimize our requests.
In that case, it may make sense to cache some info on your side of what product ID maps to what info
This isn't a major issue, I just wanted to report a potentially undocumented bug in the data in case it wasn't reported.
We're caching our plans, so we can easily fetch the products without further api calls.
Oh there we go
haha you beat me to the punch
Way ahead of me
Gotcha. Thanks for the report. As far as I can tell, the plan property is expected to be there but I have still not 100% confirmed. Will make sure to fully follow up on that on our side
As always it's a pleasure @timber trench . Thanks and have a great weekend!
Of course! Have a great one yourself