#ahsan575
1 messages · Page 1 of 1 (latest)
Hi there!
HI
If you are using line_items.price_data, then you can't store metadata there.
You should either use Price objects (which can have metadata), or store the metadata directly on the Checkout Session itself.
can i use Price objects for dynamically adding products?
First you create a Product, and then for each Product you can add Prices to it. So you need both Products and Prices.
i have like more than 1000 products available to sell on my website, so are you saying I need to store info regarding each one of them in product object and then use it?
There's no limit to the number of products you can store in Stripe. So yes that's an option.
The other option, like I mentionned at the beginning, is to store the metadata directly in the Checkout Session object.
is it okay if I use the Checkout Session object to achieve this metadata functionality, i mean from performance, security or efficiency perspective?
Yes absolutely. You can store whatever you want in the metadata, and it will be only visible to you and not users.
Note that there are some limitations, that you can check here: https://stripe.com/docs/api/metadata
alright cool. Thanks @old moss for your help. cheers