#david-product-expand
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Do you have an example Product ID I can review?
yes
prod_NImMVcOl6SVBsP
{
"id": "price_1MYAnyBUI5OPyd6pP8tbEljr",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1675613462,
"currency": "usd",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_NImMVcOl6SVBsP",
"recurring": {
"aggregate_usage": null,
"interval": "year",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "inclusive",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 360000,
"unit_amount_decimal": "360000"
},
also it seems description is missing too
for some reasons
I don't see any API request where a nick name was provided for this product
No
oh
Also this is the Price object that you are looking at
right
Which you can tell by the ID price_
So if you wanted detail on the Product you would pass it in the expand parameter when retrieving (or listing) the Price
it's fine
nvm
i can't just use a dictionary
hardcoded
for the products name by price?
Sorry I'm not clear on what you mean there? Product name by Price?
Well i want to list the subscriptions dinamically clientside by requesting them from my backend
but this request doesn't return product names
That's a response, but what is the request?
sorry i am bad at explaining things
so i made an endpoint on my backend which returns that array from stripe api
and i want to show the products on clientside from that response
but i don't have any names in it
I think I get it but want to be sure. So you are making a List request to the Prices endpoint and want product names too?
Okay so the expand parameter is exactly what you are looking for. You'll. make a request to the Prices API: https://stripe.com/docs/api/prices/list and pass the expand=['product'] parameter as we show here: https://stripe.com/docs/api/expanding_objects
That will return the product: as an object with all the details instead of just the prod_XXX ID
ait