#tbhaxor-expand-list
1 messages · Page 1 of 1 (latest)
Hi there! Let me take a look
So yeah you want to expand data.items but then you need to actually log out something like console.log(data.data[0].items.data[0].price); to see the product
Yes, here is the object
{
id: 'price_1LDvGxSCgO5PrlJoMcoqwFkM',
object: 'price',
active: true,
billing_scheme: 'per_unit',
created: 1656010859,
currency: 'inr',
custom_unit_amount: null,
livemode: false,
lookup_key: null,
metadata: {},
nickname: null,
product: 'prod_Lvmqb6O7KbbQI0',
recurring: {
aggregate_usage: null,
interval: 'month',
interval_count: 1,
trial_period_days: null,
usage_type: 'licensed'
},
tax_behavior: 'unspecified',
tiers_mode: null,
transform_quantity: null,
type: 'recurring',
unit_amount: 2500,
unit_amount_decimal: '2500'
}
see, product is still a string
Sorry maybe I'm misunderstanding. You want to expand the product itself?
Yeah okay pretty sure this isn't possible when listing since you can't expand deeper than 4 levels here
I'll double check with a colleague
Sure, you can expand it when retrieving a Subscription
But I don't think you can expand while listing
Getting all products and then using linear search just adds overhead each time request is made to the backend. I want to optimize this somehow and leverage stripe expansion feature
Please check this with your colleague and let me know, here if the thread is not archived. If it is archived, I believe you already got my email from the request id i have shared
You can reach me via email anytime
Yeah this isn't possible when listing since it would require 5 levels
It would need to be expand: ["data.items.data.price.product"]
I don't think so. In this case you would retrieve the Sub after listing it
And then expand that way
Yes it takes more requests but that is the reality of the API at this moment.
It is still expandable, just not with a list request
Yes, I have first fetch the product store in the variable and then do linear search on it