#flavio-paymentintent-discount
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- flavio_21902, 6 days ago, 14 messages
- flavio_21902, 6 days ago, 5 messages
flavio-paymentintent-discount
@potent hemlock PaymentIntents have no concepts of line items or discounts at all so that's expected. What matters is how you integrated and what "product" you're using. For example if you are using Invoicing or Checkout then the "discount details" would live on those respective objects. Does that make sense?
I see, is there a way I can get this information from the any data inside Get payment intent ?
Context: I run a automation that triggers based on data
no that's impossible, there's nothing on the PaymentIntent that stores this information
How can I get this info them? only in get Invoice ? I'm trying get checkout session but no luck
Step 1: clearly explain how you integrate since that completely changes the answer. Where does that PaymentIntent come from?
Trigger is from zapier, "New Payment in Stripe".
Then we have a workflow that grab the discount code used to update a field in a CRM
ignore that
I'm asking how you created that PaymentIntent
What is your real code doing to get a payment from the customer? We have dozens of ways to integrate our products and APIs so I need to know which one you're using
They are generated from payment links that we have embed after a form inside a website
HI 👋
Okay so Payment Links redirect your users to Checkout pages where they enter their payment method information as well as any discount codes
These are stored in the line_items property, in line_items.data.discounts https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-discounts
If you. have a Payment Intent ID, you can use it to look up the related Checkout Session using the List API https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-payment_intent
How are you receiving the Payment Intents?
I don't think it makes sense to look at the line items discount
They likely have a ton of no-code solution since they use PaymentLinks. They are using Zapier to react to payment_intent.succeeded Events I assume and that won't work. Zapier basically won't work for any of this since they need to retrieve the completed Checkout Session and expand the relevant properties
(have to leave but hopefully I summarized things well)
I think I've got a clear picture of what's going on, thanks!
Thanks for the help, I did the call "https://api.stripe.com/v1/checkout/sessions/cs_live_b138XtM4KNVsClSNv5BsUxFInUZjl5BmpjxaQFm5QDNkMMU9N1yJAmv5dz/line_items" but I dont see any information about the discount coupon/name only the discount amount
What do you mean "did the call"? can you clarify what you are doing?
Using the payment intent I found the checkout seessiojn ID and did the API Call to get the checkout info
My colleague was correct, you will need to expand the total_details.breakdown property which will include the discount codes applied to this checkout session. https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details-breakdown