#EightMegsAndConstantlySwapping - Checkout
1 messages · Page 1 of 1 (latest)
The documentation seems to be for a recurring payment, but I want this to be a one off.
Hello! Checkout itself doesn't support ad hoc amounts, but you can enable adjustable quantities on line items using this property when creating the Checkout Session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-adjustable_quantity
Could I create a price for each transaction and then delete it afterwards?
Yes, you can even specify dynamic price_data for each Checkout Session instead of using an existing Price: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
How do you go about removing prices after they're created?
Prices cannot be deleted once used (they need to stick around because they're part of the payment record), but you can make them inactive by setting active to false: https://stripe.com/docs/api/prices/update#update_price-active
Won't that lead to thousands of prices accumulating over time?
Yep, but that's okay, they won't do any harm. 🙂
Brilliant, thank you!