#fizzi - inline subscription items
1 messages · Page 1 of 1 (latest)
Hello! Just starting a thread for you -- I'll review and respond as soon as I can 🙂
Yes you can define that on the fly with price_data but:
1/ you need to have a product id defined to use
2/ there will be a price created for this behind the scenes
https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data
Hi! Thanks synthrider. Couple questions:
- Does this work in the
checkout.sessions.createAPI? - Are race conditions handled? For example, would it be possible to end up with two prices with the same value? This is probably not a big deal, was just curious.
Whats the race condition you're worried about? If two people choose the same amount you get two prices for teh same amount, there is not competition between them.
Yes, the same thing is possible via checkout:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
it also lets you define a dynamic product_data
For checkout we're also working on stuff to make this easier
Any chance you can elaborate one what parts are being improved? It seems pretty straightforward already from what you sent lol, I'll give it a try
Ah so using this method prices will never be re-used across different checkouts? even if they're the same value? that's also totally fine, I just though it would re-use them
Making it easier for you to support customer-selected pricing
Correct - you'll be creating a new price object for every instance
you may end up with many prices for the same amount
Gotcha, I guess last question is to confirm there's no performance issue related to having a bunch of redundant price objects? Even with upwards of 10000 of them?
Haha, fair enough. Excellent. Thanks a ton!