Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

difference between 'checkout.session.completed' and 'payment_intent.succeed'ed

1,323 views
Skip to first unread message

Syed Noor Alam

unread,
Aug 30, 2023, 9:28:20 PM8/30/23
to Stripe API Discussion
Hi there,
I was wondering if anyone could explain the difference between these two events.  and which one would be better to implement. What I want is, only when a payment (card/google[ay/PayPal etc) is successful, the relevant data will be save into my database.
kind regards

Remi J.

unread,
Aug 30, 2023, 9:34:05 PM8/30/23
to api-d...@lists.stripe.com
Hello,

Those Events related to different API objects that are involved when using Checkout. The first one, `checkout.session.completed` is sent when the Checkout Session is driven to completion with your customer paying on Checkout. That's the Event we recommend using for handling fulfillment via Checkout as documented here: https://stripe.com/docs/payments/checkout/fulfill-orders

The second one, `payment_intent.succeeded`, relates to the PaymentIntent API resource [1]. This represents a "state machine" associated with a payment in our API. It allows tracking payment attempts, modeled as a Charge [2], which can happen after a successful or declined/failed payment for example.

Our Checkout product is built on top of our other APIs so when you accept a one-time payment, it will create and use a PaymentIntent under the hood to represent this. Similarly, for recurring payments, it will create a Subscription which in turn will create Invoices and PaymentIntents automatically for you. This is covered in details in our documentation here: https://stripe.com/docs/payments/tour

As a developer using Checkout though you really would only care about the Events associated with your Checkout Session overall as mentioned in the first doc.

I hope this helps but if you have a follow up question please make sure to work with our support team who will be better equipped to help you with this: https://support.stripe.com/contact

Best,
Remi


--
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages