#ethan_api

1 messages ¡ Page 1 of 1 (latest)

delicate bobcatBOT
#

👋 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/1451391717117919285

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

cinder thistle
#

to clarify, what do you mean by "optional items"?

royal olive
#

it is recommendation items section in the payment link

#

this field here

#

those payment link endpoint not return that field when i tryna get it

cinder thistle
#

Ah I see, okay. Could you share with me your payment link please

royal olive
cinder thistle
#

thank you, give me a moment to check

royal olive
#

please and thank you

#

well i could POST to update that field, but when I use GET endpoint API i cant get that field back which is weird and i need it for my stripe app development

cinder thistle
#

so I do see the optional price on your payment link (plink_1Sf48KCkADo8MSdpuaA8wuu3) in our logs
could you share with me the script you ran to retrieve the payment link?

royal olive
#

const stripe = Stripe(process.env.STRIPE_SECRET_KEY);

const fullPaymentLink = await stripe.paymentLinks.retrieve(paymentLink.id);

cinder thistle
#

Ah okay, you need to specifically expand [0] the optional_items field, so the script should look like

const fullPaymentLink = await stripe.paymentLinks.retrieve(paymentLink.id, {
  expand: ['optional_items']
});

[0] https://docs.stripe.com/api/expanding_objects

#

let me know if you're still blocked

royal olive
#

okay i got it now thank you

royal olive
cinder thistle
#

I only added {expand: ['optional_items']}

royal olive
#

thats weird i added that field before but it returned me an error.... may be it was my mistake. Thank you tho