#sdkwtf_api

1 messages ยท Page 1 of 1 (latest)

native lightBOT
#

๐Ÿ‘‹ 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/1242553642876407941

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

wooden aurora
lucid sundial
#

hi thank you. I am using htpp request, so how would i do this, the same way as creating :

line_items[0][price] = my_new_price
?

wooden aurora
#

Correct

lucid sundial
#

ok thanks i'll try now :))

#

i create a new product / price, and use the new price to try to update the payment link

wooden aurora
lucid sundial
#

all my other other requests i pass as query params though

wooden aurora
#

ah you're right, it may not be that. Thinking..

lucid sundial
#

should i be setting the new price using: line_items[0][id]

#

i can see this is the differnec in the docs compare to the create method that indicates line_items[0][price]

wooden aurora
#

ah yeah try changing the ID

#

actually, wait

#

that doesn't make sense really. That prob just allows you to update quantity

#

I think the price update on a PaymentLink is a dashboard only feature.

lucid sundial
#

i was fearing you would answer that to start with ahah

wooden aurora
#

Yeah sorry, I haven't tried to do this myself recently

lucid sundial
#

but then i still dont get how to correctly use the /update endpoint, using the indicated

line_items.id string Required

#

haaaa yeah we can only adjsut quantity

#

of a given price id

wooden aurora
#

So you'd basically pass the existing price ID to the line_items.id and adjust

#

yeah

lucid sundial
#

i get the docs now

#

but yeah then my only option is to create a new payment link with a new product / price

wooden aurora
#

Yeah, you can file in a feature request for this via
https://support.stripe.com/?contact=true

however, if your usecase requires updating the price ID frequently then using Checkout Sessions API directly might be a better fit

lucid sundial
#

ok thanks for the suggestion i have not looked into this API yet

#

and yeah in my app i may chance prices freqyently so dont feel like creating loads of unused links

wooden aurora
lucid sundial
#

after creating a payemnt linik, when does the checkout session is created ?

Bascially my use case is
I create a payemnt link, send it to my customer. The customer might not visit the link and send me email about some changes, so i wan to go back to the link i sent him and change the price. just like from dashbaord, but using my app

#

if i can acces the session as soon as i created my payment links, then i can change the price directly in the session ?

wooden aurora
#

When you use PaymentLink, Stripe creates the checkout session when the user visits the PaymentLink URL.

If your price changes frequently then you can build your own API based app where you set your own line items for the checkout session.

if i can acces the session as soon as i created my payment links, then i can change the price directly in the session ?
No, there's no way to access the session generated via payment link and update it.

lucid sundial
#

ok i understand. i'll look deeeper into that. and submit a feature request for sure ๐Ÿ™‚