#linups_api

1 messages ยท Page 1 of 1 (latest)

wise archBOT
#

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

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

wheat basalt
#

Example: ch_3QtGRQ2WxmpWlx1M000UfFVV

novel micaBOT
subtle comet
#

Hi ๐Ÿ‘‹

You can't get it directly from either the Charge or Refund object. You'll have to step through the chain of related objects to find the association there.

Are the Checkout Sessions being created with a mode of payment?

wheat basalt
#

yes, it is created with mode => payment.

subtle comet
#

Perfect, then from either the Charge or the Refund object you'll want to find the related Payment Intent: (I'm not sure which refund event you're listening to, refund.created or charge.refunded, which is why I'm talking about both Charge and Refund objects. You can ignore whichever isn't in the Event you're looking at)
Charge's payment_intent: https://docs.stripe.com/api/charges/object#charge_object-payment_intent
Refund's payment_intent: https://docs.stripe.com/api/refunds/object#refund_object-payment_intent

Once you locate the ID of the associated Payment Intent, you can then list Checkout Sessions and use that ID as a filter to only find the related Checkout Session, via the payment_intent parameter:
https://docs.stripe.com/api/checkout/sessions/list#list_checkout_sessions-payment_intent
When making that list request, also use expand to expand line_items, so you get those in response and can see the contents of the Checkout Session's line items without having to make another request:
https://docs.stripe.com/api/expanding_objects

#

Let me know if that doesn't do what you're hoping!

wheat basalt
#

thank you, please give me some time to go through it.