How to notify user about account balance

when placing order(buy) what if there is no balance in user account? how should i let user know about there account status and about that balance error?

I recommend using the funds and margin API from Upstox (Get Fund And Margin | Upstox Developer API) to display the user’s balance.

Be cautious when calling the funds API, as excessive usage may lead to hitting the rate limit (Rate Limits | Upstox Developer API).