#eoghanobrien_webhooks
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/1283253602923839521
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! taking a look, gimme a while
Thank you!
hmm, from what I understand, you want to actually check the customer's current plan, before the subscription downgrade actually happens?
kinda, I want to check their account in our web app using their customer_id, I need to check whether their next plan supports their user count and then, if not, release the scheduled update before it actually downgrades and creates/pays the invoice.
that's not going to be possible with subscription schedule webhooks. You need to do this action before the webhook actually occurs. I think you might need to log the dates in your own DB and then run a cron job
okay, so look at the next payment date perhaps?
it depends on when you've scheduled to downgrade, when you've made the request to create the subscription schedule to downgrade, you can always save the downgrade date
yeah, I created the schedule to downgrade at current_period_end using phases[0].end_date = subscription.current_period_end
Do you think that using next payment date would work given the above? @signal fjord
i'm not sure i understand what you mean by using the next payment date? You created the schedule to downgrade at current_period_end right? So save the date for current_period_end in your own DB when the subscription schedule is successfully created. Then however far before you want to do so, run a cron job to perform your checks