Skip to main content
Solved

Which Stripe events do I listen to in order to post receipts

  • December 2, 2021
  • 2 replies
  • 524 views

Forum|alt.badge.img+3
  • Dedicated Member
  • 22 replies

I followed this guide to send events directly from Stripe to RevenueCat. 

 

I also saw this link for sending our tokens to RevenueCat which must be done before the above events (I think). I send the token during “checkout.session.completed” but it doesn’t look like that event is happening. Should we be posting receipts from “invoice.payment_succeeded” ? Might be good to put something about this in your docs.

 

Best answer by cody

Hey @Tony!

If you’re using Stripe Checkout or Stripe Payment Links, the token should be sent from the `checkout.session.completed` webhook. This event is called once the the checkout session is completed with a purchase. You can see this in action in our sample project here: https://github.com/RevenueCat-Samples/stripe-no-website-example

If you’re not using Stripe Checkout, it might be a different webhook event that is called after a successful payment (like you mentioned, possible the invoice.payment_succeeded webhook). Basically, we need the Stripe Subscription ID (`sub_**`) as well as the app user ID it should be connected to.

I’ll add this to our backlog to clarify in our docs- let me know if that helps!

View original
Did this post help you find an answer to your question?

2 replies

cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 497 replies
  • Answer
  • December 7, 2021

Hey @Tony!

If you’re using Stripe Checkout or Stripe Payment Links, the token should be sent from the `checkout.session.completed` webhook. This event is called once the the checkout session is completed with a purchase. You can see this in action in our sample project here: https://github.com/RevenueCat-Samples/stripe-no-website-example

If you’re not using Stripe Checkout, it might be a different webhook event that is called after a successful payment (like you mentioned, possible the invoice.payment_succeeded webhook). Basically, we need the Stripe Subscription ID (`sub_**`) as well as the app user ID it should be connected to.

I’ll add this to our backlog to clarify in our docs- let me know if that helps!


Forum|alt.badge.img
  • New Member
  • 1 reply
  • April 4, 2022

I need my own server for this? I was using revenue cat to avoid that in the first place. Why doesn’t revenue cat handle the “checkout.session.completed” webhook its self? The stripe checkout https://stripe.com/docs/js/checkout/redirect_to_checkout allows you to specify a clientReferenceId (userId) so revenuecat would know how to relate the data.

When I try to add this event to the webhook revenuecat gives me a error stating Invalid Stripe webhook event type (checkout.session.completed).


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings