#krisp_best-practices
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1371507126433878053
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi 👋 invoice.paid sounds like it would be a good fit.
If you want to see what other Event types are usually beneficial for Stripe Billing integrations, I'd suggest taking a look at our guide about using webhooks with subscriptions:
https://docs.stripe.com/billing/subscriptions/webhooks#:~:text=invoice.paid,is active
From invoice.paid i can get the subscription of the customer ?
Should be able to .... but I think we made this harder in our most recent API version, and I'm trying to double check whether that was intentional
Or I can just listen to subscription.updated and check if the status is not incomplete ?
Probably not, customer.subscription.updated is triggered whenever a Subscription object is updated, it doesn't correlate with you getting paid like you mentioned in your message.
Okay, yes, you can find the related Subscription from the Invoice object (though depending on what you're doing the customer and lines fields may give you the insight you need).
Depending on which version of our API you're using, you'll look at different fields on the Invoice to find the related Subscription.
If you're using an acacia API version, or a version before that, you'll want to reference the subscription field on the Invoice.
For basil versions or newer, you'll want to look at the parent field.
Basically what I need is juste the price_id, my backend map it with the correct subscription, is it directly accessible from the invoice (in basil)
Hi hi! I’m going to be taking over for my colleague here. Give me a minute to read back and understand things.
Based on the Subsctiption life cycle, the Invoice-related events are possibly your best bet here.
Question for you though: how are you creating the Subscriptions?
Okay but if i have trial and paid subscription, i can’t just listen to customer.subscription.updated and check the status if it’s active ?
You could just listen to that event assuming your settings will disable the Subscription in that situation, but if an Invoice payment fails and you're not listening to the Invoice- or Charge-related events, you'd never know to be able to ask the Customer to come back and pay for it - or that that needs to be done.
I’m not sure to understand your point
Which part?
I guess there are two separate parts here:
A) Is the Subscription active, yes or no? and in the latter case,
B) Why is the Subscription not active, and what an be done about it?
Listening to customer.subscription.updated and checking its status will absolutely deal with A.
For B, you will need to listen to the Invoice-related events so you can find out why it failed to (re-)become active, and what next steps are required to get your customer paid up.
Okay but i can’t let the customer manage this since I enabled customer portal ?
Okay but i can’t let the customer manage this since I enabled customer portal ?
Customer's should be able to manage subscriptions via the portal.