laravelstripe-paymentslaravel-cashier

Calculating subscription churn rate in Stripe api


I want to earn my "Churn rate" with the stripe api. I want that whenever someone does not renew their subscription, I can save a log in my database

I wanted to ask how exactly this should be done

My idea is to use stripe-webhooks, but I don't know exactly which ones and how.


Solution

  • I recommend giving the Using webhooks with subscriptions doc from Stripe a read. It depends what you mean by "whenever someone does not renew their subscription". For tracking failure of a monthly payment, you could monitor the invoice.payment_failed event. For getting notified of when a subscription is cancelled, you could monitor the customer.subscription.deleted event.