#ozolan - billing portal and webhook

1 messages · Page 1 of 1 (latest)

cold onyx
#

Hey there, what can we help with?

finite fog
#

Hi @cold onyx, thank you for your help. I am trying to implement stripe into my SaaS product and I'm using the Billing Portal to manage customer plans. If I have two plans, Basic and Pro Plan and some customer downgrade from Pro to Basic, the billing portal automatically updates information to Basic but I really wanted to show something like: Pro until X day and then automatically renews to Basic.

#

Is this possible ?

cold onyx
#

Pro until X day and then automatically renews to Basic

#

It sounds like you want to schedule a future change on the subscription

#

Is that right?

finite fog
#

Yes, something like that. But I am using the inbuilt billing portal

cold onyx
#

Sure, but scheduled future changes are not currently supported in the Portal

#

The portal provides features that allow your customers to:

Update subscriptions.
Cancel subscriptions.
Pause subscriptions.
Resume subscriptions.
View their active subscriptions.
View their current and past invoice history, and download invoices.
Update payment methods.
Update billing information, including their tax IDs.

finite fog
#

Ok, I think I will need to implement that functionality myself. Thank you. Can I ask one other question about webhooks please?

#

I'm currently using customer.subscription.created and customer.subscription.updated to handle my customers subscriptions. When subscriptions are paid every month, which webhooks should I listen?

#

Should it be invoice.payment_succeeded?

cold onyx
#

invoice.paid is the better event to use

#

Because if for example your customer has some credit an invoice might not involve a new payment, but will always produce invoice.paid once successfully paid, even if out of their balance

finite fog
#

Perfect, didn't know about that. I will use invoice.paid to listen to new payments. Should I also wait for invoice.paid on customer subscription created? Or customer.subscription.created only happens when the payments was processed?

cold onyx
#

That depends on your integration pattern, you can create subscriptions without invoices being paid, eg by following our suggested pattern with payment_behavior=default_incomplete

finite fog
#

Do you know what is the common case for SaaS products ? Maybe should I accept the customer and then watch for the payment ?

#

I saw this example from github and it seems they only handle invoice.payment_succeeded to keep the database updated

trim arch
#

hello! catching up here

finite fog
#

Hello hmunoz ! Are invoice webhooks instant like customer.subscription or they are delayed? My question is because I want my customers to start using the app right after introducing card details

trim arch
#

My question is because I want my customers to start using the app right after introducing card details
they are near instant really, test them out in test mode, live mode would be faster than test mode due to priorityu of webhooks

finite fog
#

Perfect, I will test them. Thank you so much for your help. Awesome support