#jack-metadata-expand
1 messages · Page 1 of 1 (latest)
Hello! I you said you added metadata to the Product so it's normal it wouldn't be on the Plan which is a completely separate resource. Also Plan has been deprecated for years, you should use the Price API instead
jack-metadata-expand
my bad
did that on price itself sorry for confsuion
priceID -> price_1NhXreFBOk0mujJ71k69BOvV
That Price has no metadata at all
and doing price, err := price.Get(priceID, priceParams)
so I assume you set it on the Product and not on the Price right?
yes
like this
Okay so what is the problem? You set metadata on object A, then you retrieve a completely separate object B and that object would have no metadata
okay and is there any purpose for the metadata that i just set
can it also be retreived somehow?
You set the metadata on the Product. If you retrieve the Product, which is a separate resource/API then it will be there
every object has its own separate metadata and you set metadata on the object you want, that's controlled with your own code
i checked the product struct
there is a field DefaultPrice, is there any way to fetch all prices related to that product?
https://stripe.com/docs/api/prices/list + product: 'prod_123'
Also when you call the Retrieve Price API, you can use the Expand feature: https://stripe.com/docs/expand to also expand the Product at the same time and see its metadata (what you mentioned earlier)
that documentation page has a clear example code for all languages
yep got it