#some1ataplace

1 messages · Page 1 of 1 (latest)

harsh waspBOT
indigo tinsel
#

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

restive viper
#

so keep line_items like line_items=[{ but use price_data ?

indigo tinsel
#

Correct. Or use line_items.price, depending on if you have a Price created already or not

restive viper
#

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?

indigo tinsel
#

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

restive viper
#

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?

indigo tinsel
#

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.

restive viper
#

ok i might come back later to ask again about this thanks

indigo tinsel
#

Sure thing!

cobalt mulch
#

Hi, stepping in for two-shoes. Let me know if you have any follow up questions here.