#CaptainYarb - prices+plans

1 messages · Page 1 of 1 (latest)

timber trench
#

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

dense laurel
#

Apart of a larger Subscription Object

timber trench
#

Thank you. I think those are expected if undocumented but let me double check

dense laurel
#

Interesting. I was really excited that it might have been the expanded plan, to prevent further API calls.

timber trench
#

What further API calls do you need to make here?

dense laurel
#

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.

timber trench
#

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

dense laurel
#

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)

timber trench
#

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

dense laurel
#

Again, the screenshot was originally from the Customer retrieve route via expand, but was replicated on the Subscriptions list routes.

timber trench
#

Oh I didn't realize that the Customer object had a subscriptions list

dense laurel
#

Me either until yesterday. It's super nice to have!

timber trench
#

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

dense laurel
#

We're heavily using Stripe Billing and are really worried about hitting API rate limits, so we're trying to heavily optimize our requests.

timber trench
#

In that case, it may make sense to cache some info on your side of what product ID maps to what info

dense laurel
#

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.

timber trench
#

Oh there we go

dense laurel
#

haha you beat me to the punch

timber trench
#

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

dense laurel
#

As always it's a pleasure @timber trench . Thanks and have a great weekend!

timber trench
#

Of course! Have a great one yourself