#arat-patel_api

1 messages · Page 1 of 1 (latest)

grand fractalBOT
#

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

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

solemn cape
#

Hello

granite kite
#

Hi there, so you want to check your platform's balance before creating a transfer?

solemn cape
#

Yes

granite kite
solemn cape
#

Yes i'm already using this but i'm explain what is my issue after using this api.

#

Before initiating the transfer, I call Stripe's Balance API :- stripe.balance.retrieve() to get the available and pending balances. Then, I calculate totalBalance = availableBalance + pendingBalance to check if there are sufficient funds to make the transfer.

This approach usually works, but sometimes I'm seeing cases where:

pending balance is negative, or

available balance is negative.

In such cases, the sum of available + pending still shows as positive, so the system proceeds with the transfer — but in reality, the account is in negative balance, and the transfer shouldn't happen.

I want to make sure the transfer only proceeds if there are truly sufficient funds, and that the flow fails safely when there’s not enough balance. Can you suggest the right way to handle this, so that my transfer logic works correctly every time?

granite kite
#

You should only use the available balance for transfer

solemn cape
#

But sometimes, when I use only the available balance for instant payouts, I get an error saying that there is not enough available balance to make the transfer, possibly due to pending amounts or incoming amount.

So, do you suggest that I should just use the available balance? Will that be reliable?

granite kite
#

Can you share with me the ID of a request?

solemn cape
#

Yes give me a few minute

#

req_C9iGvI9ujNvKrg

#

req_mExfOZ3kjSzrjI

granite kite
solemn cape
#

Okay let us check again with only available balance