Flowchart of subscription lifecycle

140 views
Skip to first unread message

Stathis fra Ramsalt

unread,
Apr 25, 2018, 4:10:19 AM4/25/18
to api-d...@lists.stripe.com
Hello,

Is there any flowchart with all the stripe events that get triggered during the subscription lifecycle?
The documentation is quite good but I think it doesn't contain all the info.

What I'm trying to figure out is which event would be the most suitable to use in order to trigger a license renewal.


Remi J.

unread,
Apr 25, 2018, 4:15:33 AM4/25/18
to api-d...@lists.stripe.com
Hello Stathis,

We don't have a flowchart for this today unfortunately. For the license renewal, I think you'd want `invoice.payment_succeeded` event. This is sent every time an invoice is paid successfully which would let you update your database to extend their current subscription until the next renewal.

Hope this helps!
Remi



--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.


Stathis fra Ramsalt

unread,
Apr 25, 2018, 4:59:19 AM4/25/18
to api-d...@lists.stripe.com
Thank you.
But is it possible to distinguish if the invoice.payment_succeeded is triggered for the first time (when the subscription is created) or if it is a renewal?



To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Remi J.

unread,
Apr 25, 2018, 5:01:18 AM4/25/18
to api-d...@lists.stripe.com
The easiest solution is to count the invoices on your end so that you track whether this is a renewal or a new subscription. You can also use the List Invoices API [1] for that specific customer and subscription to see if you get more than one result.

Best,
Remi

Stathis fra Ramsalt

unread,
Apr 30, 2018, 7:28:44 AM4/30/18
to api-d...@lists.stripe.com
Hello again, and thank you for your help.

I found out now that the "invoice.payment_succeeded" event is not the best option.
If, for example, a subscription cycle would restart on early Saturday, there is no actual payment up until Monday, so the event has not yet been triggered. Which means that the user is left without access during the weekend, although they will finally get charged for these days. Do you have any suggestions on that?

Another thought would be that the "invoice.created" event might be more suitable to renew licenses, and then use "invoice.payment_succeeded" to confirm the payment, or "invoice.payment_failed" to revoke the access. Do you have any thoughts, or any counterexamples on that?

Thank you,
Stathis



To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Remi J.

unread,
Apr 30, 2018, 7:37:25 AM4/30/18
to api-d...@lists.stripe.com
Hey Stathis,

Both approaches should work and the decision is mostly on your end. It depends mostly if you want to block access until the new cycle is paid for, or if you prefer to keep access and assume the first payment attempt will succeed.

When the invoice is created, it should be paid immediately if the customer pays by card, whether it's early Saturday morning or any other time of the week. If they pay via other payment methods then you would potentially assume the current week or month is paid for until the first payment failure and then cut access until their payment lands.

If you have any follow up questions, you should feel free to reach out to our support team [1] as this will be more specific to your case and business model and less about the API itself.

Best,
Remi

Reply all
Reply to author
Forward
0 new messages