#jaime-la-gym_best-practices
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1347222520046288999
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- jaime-la-gym_best-practices, 6 days ago, 16 messages
Payment Links are designed to be re-usable, and require a defined price object to be specified
https://docs.stripe.com/api/payment-link/create#create_payment_link-line_items-price
If you want to send a link for payment with an ad-hoc price specific to one customer transaction, you should instead use Checkout Sessions, which are one-time use and allow you to declare ad-hoc pricing in the creation request using price_data:
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data
AD hoc ? What does that mean ?
👋 stepping in here
Ad hoc just refers to the dynamic nature that you are talking about.
Meaning a different price for each customer
Overall you should use Checkout as stated above, but you can also just create a new Price each time before creating a new Payment Link and then send that Link... there are no limits on amount of Prices/Products/Payment Links
Oh okay, im Reading the checkout doc but the price data seems juste like price but without making the api call right ? Or i misunderstood
Correct
It creates the Price inline when you create the Checkout Session
So just 1 API call instead of 2
Price data can bé created without a product ? It says resuirrd conditionnaly what's the conditions ?
Required*
Either product or product_data is required
So product data it will bé
Be
Id there something important to know about checkout session ?
Is*
Not really
Mostly you should just test this out
And make sure it fits your use-case
If i pass metadata to the checkout session does thé metadata transfer to the payment ?
Oh yes i found the field Ty for all your anwsers have a great day