#some1ataplace
1 messages · Page 1 of 1 (latest)
Here's the line_items property on the Checkout Session object. You just need to use the fields that it mentions in the error message instead of the ones you're currently trying to use
so keep line_items like line_items=[{ but use price_data ?
Correct. Or use line_items.price, depending on if you have a Price created already or not
hmm
Request req_BbhR9P6dVj8iEB: You must specify either product or product_data when creating a price.
how do i specify product? Does that mean product id?
Correct. You separately create a Product object which will have an ID that you'd pass in to line_items.price_data.product or you can use line_items.price_data.product_data to create a new Product in-line with this Checkout Session request
So is this correct? It seeems to work... https://dpaste.org/Zj5hU
What is the benefit of this now? Each time if I make a 1 time donation with varying amounts, will there still be tons of price ids?
A new Price will be created each time you create a Checkout Session. There isn't necessarily an inherent benefit to doing it this way, it mostly depends on what you're trying to do.
ok i might come back later to ask again about this thanks
Sure thing!
Hi, stepping in for two-shoes. Let me know if you have any follow up questions here.