#liam-curran_api

1 messages ¡ Page 1 of 1 (latest)

glacial perchBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1251088615434489858

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

quick sundial
#

hi! what exact permission error are you getting?

burnt hazel
#

StripePermissionError: The provided key 'sk_test_8a******************i2II' does not have access to account 'acct_1OuGEhBHbFgrJmk2' (or that account does not exist). Application access may have been revoked.

#

Seems to happen on the first account in the list, is there a way to skip rather than throwing the error?

quick sundial
#

for clarity that account is already deleted, it was deleted about 15:50 yesterday

burnt hazel
#

Is there a way to skip accounts that are already deleted when querying? seems like in the docs there's no handy way to filter

quick sundial
#

when you list are you maybe getting a "deleted" stub?

{ id: "acct_xxx", deleted:true}
#

I would have thought deleted accounts don't get returned from the list API

burnt hazel
#

hmm, it looks like the deleted is void or undefined in our code

#

we're on 2020-08-27 - would that be a newer flag?

quick sundial
#

that's a typescript problem because you have to cast to a specific "deleted" stub or something

#

but anyway, let's ignore that

#

what is an example of the full JSON response you're getting from the list call?

burnt hazel
#

i ran the script a couple times and it always hits that same account so i think it is returning it

quick sundial
#

in any case, you can just wrap the call to stripe.accounts.del() in a try/catch and continue the loop if it errors, that's what I would do.

burnt hazel
#

ace cheers i'll try that

#

I've gotta jump on a call now but i'll take a look at the json/try catch and let you know if that helps