#maat
1 messages ยท Page 1 of 1 (latest)
๐
So yeah the best thing to do here is to track this as you go via checkout.session.completed where you look at the payment_link associated with the Checkout Session: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_link
For backward facing, you'll want to list Checkout Sessions by Payment Link: https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-payment_link
not sure if we're on the same page here, I'm trying to get the coupon information highlighted below on the stripe dashboard from an exported csv with ids for charges and paymentintents. I've done this before for ongoing transactions using the checkout.session.completed object, but is there a way to find this coupon information retroactively? I had previously expanded total_details.breakdown.discounts for this information, but it looks like this isn't available from the information I have on the exported csv.
I'm not sure what you are referring to with regards to "an exported csv". Do you mean a certain Dashboard export? We really only focus on the API so I'm not that familiar with the Dashboard.
Overall the way you do this through the API is get the Checkout Session and look at the line_items.data.discounts (https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-discounts) which is expandable as you noted
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
the export feature on the dashboard for payments:
I'd like to run a pandas script to append the csv export with coupon information, but the checkout session ID doesn't seem to be available here
Yeah as far as I know this isn't possible via the Dashboard export
I don't believe any of those exports contain the Checkout Session ID
You will need to use the API for this
will think this through, thank you for all of your help!