#okg - balance + transfer question
1 messages ยท Page 1 of 1 (latest)
๐
We ran (1) A Stripe balance check, and then sequentially (2) A transfer of Stripe balance to a connected account.
Our Stripe balance check showed sufficient funds, but the transfer failed with insufficient funds. A balance check after the transfer call also showed sufficient funds.
We're thinking this might be a transient Stripe error -- is there something we're missing? Is this something you've seen before?
The error we received was:
You have insufficient funds in your Stripe account for this transfer. Your card balance is too low. You can use the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance).
We are using stripe sdk balance.retrieve() for this
Can you send me what balance.retrieve shows for the currency that you are trying to transfer in?
Yep, to give you a full picture, our balance response was showing:
"{\"object\":\"balance\",\"available\":[{\"amount\":8994029,\"currency\":\"usd\",\"source_types\":{\"bank_account\":2379551,\"card\":6614478}}],\"connect_reserved\":[{\"amount\":0,\"currency\":\"usd\"}],\"instant_available\":[{\"amount\":250000,\"currency\":\"usd\",\"source_types\":{\"bank_account\":250000,\"card\":250000}}],\"issuing\":{\"available\":[{\"amount\":0,\"currency\":\"usd\"}]},\"livemode\":true,\"pending\":[{\"amount\":<redacted>,\"currency\":\"usd\",\"source_types\":{\"bank_account\":<redacted>,\"card\":<redacted>}}]}"
Which indicates ~$66k available. We were trying to initiate a transfer for $13k (1368484)
To work around this, we were able to initiate the transfer via the UI, but via the API failed in this way multiple times across a period of ~10 hours (so, not transient)
Interesting. Can you send me a request ID from a time that you got this error in the API?
Yes! Here are a couple, thanks so much for looking into this.
req_5eIgSckRkiHSR1 (July 4, 7:41pm Pacific)
req_jHal5lzqioq6Sn (July 5, 5:49am Pacific)
Thank you, looking in to those in a moment
Hi there ๐ taking over
Give me a few minutes to get caught up.
Do you have the request ID for the request that gave you this available balance?
Unfortunately I don't think so, but we made retrieve balance requests for the same account ~100-200 ms before in each case?
Gotcha, no worries. I think I found it
Still digging though. Will circle back once I have something tangible
Awesome, thanks. Let me know if I can give you any more details from my end as you investigate
So I found the issue. You are retrying a previously failed request to create a Transfer, using an idempotency key. Our idempotent requests are designed for allowing retries while avoiding the possibility of performing the same action twice. Since the first request made it to us successfully, we save the response from that and map it to the idempotent key. Any future requests with that key will just serve the same result of the initial request. So you're essentially replaying the first request.
If you want to try to create Transfers later on, you'll want to omit the idempotency key
nice. Is there any field returned from requests that can show us what time the response is coming from? (i.e. If I reran a request with the same idempotency key at 12pm, it would return me the response from my prior run at 8am, would I be able to see that the original response was from 8am?)
Unfortunately not.The idempotency key is the only thing that would tie them together on your end