1.3 Get Balance
The Get Balance endpoint retrieves the balance of a user. It requires a valid JWT token for authentication and authorization.
Method: POST
Endpoint:
Parameters:
token (str): The JWT (JSON Web Token) used for authenticating the user. This token is processed by the JWTBearer dependency to ensure its validity.
Return Value:
balance (float or dict): The balance of the user. The format may vary depending on the implementation of the getbalance_ function.
Example Request:
Example Response:
Example Response (Token Invalid):
Overview The Get Balance endpoint enables users to retrieve their balance by providing a valid JWT token. The token is validated and decoded to extract the user's ID, which is then used to fetch the balance. If the token is invalid, an appropriate error message is returned to inform the user of the issue.
Last updated