#Lukas V
1 messages · Page 1 of 1 (latest)
Hi there!
No idea how that particular user is using Stripe. But if you are using Checkout Session, you don't have to create Price objects at all. You can directly set the price with price_data https://stripe.com/docs/api/checkout/sessions/create?lang=curl#create_checkout_session-line_items-price_data
Also Checkout Session has a feature to let user chose the amount directly in the Stripe UI: https://stripe.com/docs/payments/checkout/pay-what-you-want
Okay, I see, so stripe still creates the price with that account, or is it just one time during that checkout?
line_items.price_data
REQUIRED CONDITIONALLY
Data used to generate a new Price object inline. One of price or price_data is required.
Stripe will still create a Price yes.
Thanks for that, in your opinion which one would be easier for me to do? should I simply pass price_data?
It's completely up to you. If you tend to reuse the same amount, you can pass an existing price ID. If the amount varies a lot, use price_data.
Nice one, appreciate it.