#dick-flair_best-practices

1 messages ยท Page 1 of 1 (latest)

true currentBOT
#

๐Ÿ‘‹ 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/1316824458438381602

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

kind olive
#

Hi there

spring matrix
#

Hi. I am currently trying to find a webhook event that will allow me to update the record in my DB to update the subscription ID. In my DB, I have a subscriptionId saved but there are times where this may be populated with the sub schedule ID (if I manually create a subscription on stripe that starts in the future, I get given the subscription schedule ID). My goal is, when this sub schedule starts, I want to update the subscriptionId saved in my DB which is currently the sub schedule ID to be the actual subscription ID

#

Unless there's a way to get the subscription Id from the get go for the subscription schedule? Is that possible?

#

There doesn't seem to be a subscription_schedule.started or an equivalent

kind olive
#

Ah gotcha

#

You're right, there's no Subscription ID when you create a Schedule to start a Subscription in the future

spring matrix
#

Yeah, that seems like the closest thing I can use. While I have you, I don't really want the hook to be firing all the time if a customer subscription is created, is there a way to kind of limit this to my specific scenario? Or would I just have to rely on whether schedule is set and if anything matches that in my db?

kind olive
#

Gotcha, no, there's no way to filter event sending on our end other than by event type

#

Which means you'll receive customer.subscription.created for every brand-new Subscription, regardless of whether or not it was created via a Schedule

spring matrix
#

Yeah, thought so. Well, I guess I'd only really be querying my DB if schedule is set and that's only set if a subscription was created via a subscription schedule right? So if I was to create a subscription that's on going right now, that schedule property would be blank. Is that right?

kind olive
#

Correct, it would be null if you're calling the Subscriptions endpoint directly to create a Subscription

spring matrix
#

Great. I think I can work with this. Appreciate the help and sanity checks ๐Ÿ™‚

kind olive
#

Sure thing!