#jjd921_api
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/1419746972025360535
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Yeah any approach via the api is going to be really slow. I recommend instead listening for connect webhooks on your platform account and storing this info proactively in your database so you can easily query it
do you mean listening for events of type "customer.subscription.created" and "customer.subscription.deleted" to store subscription status in my own database?
yep but for you connect accounts
there's 2 types of webhook endpoints
1 for events on your platform account
and other for events on your connect accounts
right, I saw that. I think I have it configured correctly
So you could do that and then write a one-off script to query the stripe api and backfill existing data in your db
and then going forward accessing data about subscriptions across connect accounts will be quick because it'll just be a db query
The purpose of this would be to fix the data in my DB if for some reason the webhook didnt work and got out of sync with subscriptions in stripe?
No that would be to load existing subscriptions
Because adding this code to store data in your webhook handler will catch new subscriptions
But maybe you don't need to do that
And maybe you're fine with waiting until the next billing cycle for existing subscriptions so that customer.subscription.updated is fired and you store it then
Depends on your requirements
I was just suggesting one approach to load existing subscriptions if you need to query them immediately