#paulC-adhoc-prices
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ there is, you can pass values into the line_items.price_data parameter to set the price. If you don't already have a product created, then you'll need to pass in at least a name to line_items.price_data.product_data.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hi toby ! Thanks for the prompt reply !
Can this name be some random variable , for ex some uuidv4?
Yup, we aren't picky about that. I'd just recommend you test the flow and make sure it won't look confusing to your users.
Got it ! Many I ask , do these have to be unique ? Or can I just hard-code it ?
No, the name doesn't need to be unique.
Thanks a lot ! Cheers !
Any time! ๐
Sorry to bother you again , but it seems like in the docs all the prices are based on the quantity , how can I pass the amount without relying on a quantity, basically computed by myself ?
The easiest way would be to pass in the desired amount as the unit_amount and then just always set the quantity to 1.