Stripe payments for subscriptions

I am starting out with Stripe payments and have 2 specific questions. Perhaps some Stripe-expert will be able to help me :slight_smile: .

  1. In my service, each paying user, in addition to the monthly subscription validity period, has a limited number of activities. Activities are counted and stored in the database. But after the start of the next billing period they should be reset to zero. What kind of Stripe event corresponds to a successful payment for the next month? I’m assuming I should use a webhook listener to trigger a backend workflow in the event of a successful next month’s subscription download. But which Stripe event signals that the next month’s subscription has started?

  2. Second, related topic - which Stripe event triggers when the payment for the next month’s subscription fails? How to trigger such an event for testing purposes?

Thanks!

Webhooks

Check on the Stripe documentation in the Stripe Dashboard at the list of webhooks available. They should be categorized and easily understood which is the correct choice for this use case

Same as above, check out Stripe. Super simply to see all available webhook options and determine which one you need for any particular use case of a webhook.

Stripe has some CDLI or some other acronym to refer to their testing of webhooks. Likely some videos on youtube about how to do it.

1 Like

invoice.payment_succeeded

which Stripe event triggers when the payment for the next month’s subscription fails?

invoice.payment_failed

How to trigger such an event for testing purposes?

You can use their CLI to test certain events - but it’s by no means a complete selection (but you can use it to test initial payments)

For testing subscriptions you’ll probably want to use their Test Clocks feature.

1 Like