#jjd921_api

1 messages ¡ Page 1 of 1 (latest)

wild emberBOT
#

👋 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.

fresh sky
#

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

solar rain
#

do you mean listening for events of type "customer.subscription.created" and "customer.subscription.deleted" to store subscription status in my own database?

fresh sky
#

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

solar rain
#

right, I saw that. I think I have it configured correctly

fresh sky
#

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

solar rain
fresh sky
#

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