#mattsulima
1 messages ยท Page 1 of 1 (latest)
Unfortunately there is no search API for Payment Links. You'd need to list all Payment Links and expand line_items, then filter the product in line_items by yourself.
- List all payment links with
expand: ['line_items']: https://stripe.com/docs/api/payment_links/payment_links/list - Expanding: https://stripe.com/docs/api/expanding_objects
Ouch, in that case is it okay to have multiple payment links? We want to create new payment link each time we ask customer to pay for specific item
If this is the case, I'd recommend using Checkout Session instead. It's similar to payment links with one-time usage: https://stripe.com/docs/checkout/quickstart
Otherwise, I'd recommend storing the product to the Payment Link in your database and send corresponding Payment Link with your own database search.
Thanks. Checkout session would be better, trouble is that we need to send those links via email. We currently use "custom payment flow" (element generated on our website- https://stripe.com/docs/payments/quickstart), but sometimes people exit the form and are unable to go back and try paying. Sometimes people don't know how to use our system so we do all for them (e.g. over the phone) and then send a link asking them to pay
So Checkout Session sounds like something we can't simply generate using api/server only
Actually... I see url is generated from backend... I'll check it out!
Yep! Checkout Session is generated using API. Let me know if you have further question ๐
Great, thanks!
No problem! Happy to help ๐