#theplay3r_accounts-api-list-filtering

1 messages ¡ Page 1 of 1 (latest)

noble harborBOT
#

👋 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/1328398354689953836

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

tiny geyser
#

Hello, unfortunately not. It looks like the only filter we have is for when the accounts were created. So in this case I think you would have to keep records of this on your side or iterate through the list and check https://docs.stripe.com/api/accounts/list

glass kelp
#

I need it in order to process manual payouts each month, is it safe for me to iterate over all the accounts, or am I risking getting rate limited?

#

Meaning using Stripe's pagination to go through all the records and filtering them locally.

This is the current implementation

    fun monthlyAccountsCheck() {
        logger.info { "Performing monthly accounts check." }
        val accounts = stripe.accounts().list().autoPagingIterable()

        accounts.forEach { account ->
            if (account.payoutsEnabled) {
                checkAccountBalances(account)
            }
        }
    }

Makes it easier than storing the data on our side and "hoping" that the data stays synced.

tiny geyser
#

that wouldn't be many calls to make usually and you can meter them out because that isn't time sensitive, but that does sound like it would likely make more sense to listen to account.updated events and listen for payouts being enabled/disabled as it happens

glass kelp
#

Well, if we were to store the information about payout availability on our side, we would then have to query each account individually, wouldn't that result in even more requests?

noble harborBOT
tiny geyser
#

The account object in the event would have this field, so you wouldn't have to retrieve it when you get the event

glass kelp
#

We are processing payouts once per month - on the 1st.

#

Meaning we would have to query all the accounts in our DB and for each of them make individual Stripe API call.

#

It cannot be webhook based, because no event exists that would satisfy the use-case of handling manual payouts. (It doesn't make sense to only create a payout when we get account.updated)

tiny geyser
#

I more mean that once you see that it is enabled, you can note in your DB that the account is enabled and then make the request to create a payout without checking again if they are enabled

#

Unless of course you get an event about it being disabled

#

There is no need to check again or to wait on a scheduled event from us to create your manual payouts

glass kelp
#

Yeah, I see what you meant now.

#

Still a shame Stripe doesn't allow us to filter via API, even though dashboard has it.

Well, I will implement it like you said, thanks!

tiny geyser
#

Yep, can put in feedback. Glad we could find a workaround at least!