Skip to main content

Fetch Payin Balance

Api Endpoint:

This API for fetching Payin Balance will be a GET request.

{BaseUrl}/user/payin/getBalance

Description

The Fetch Payin Balance API allows a user to check the available balance in their payin account. This is useful for verifying the remaining balance before initiating transactions.

Request

Request Header

The request must include the following headers for authentication:

Request Header
{
"apiKey": "your api key",
"token": "your token",
"content-type": "application/json"
}
  • apiKey: Your unique API key provided by PayHub.
  • token: A token that validates your session or request.
  • content-type: Specifies that the request body is in JSON format.

Request Body

This API does not require a request body.

Possible Responses:

Success Response

A response indicating the available payin balance.

Success Response
{
"responseCode": 200,
"responseMessage": "Success",
"responseData": {
"balance": 39335.15
}
}
  • responseCode: 200 - Indicates a successful request.
  • responseMessage: Success - A message indicating the request was successful.
  • responseData: Contains the balance details.
    • balance: 39335.15 - The available balance in the payin account.

Error Responses

Invalid API Key

A response indicating that the provided API key is invalid.

Invalid API Key
{
"responseCode": 401,
"responseMessage": "Invalid apiKey"
}
  • responseCode: 403 - Indicates forbidden access due to an invalid API key.
  • responseMessage: Invalid apiKey - A message indicating the provided API key is invalid.
Invalid User
Invalid User
{
"responseCode": 400,
"responseMessage": "User does not exist"
}
  • responseCode: 400 - Indicates a bad request due to a non-existent user.
  • responseMessage: User does not exist - A message indicating the user specified in the request does not exist.

Invalid Details

A response indicating that some of the details provided in the request are invalid.

Invalid Details
{
"responseCode": 400,
"responseMessage": "Invalid details"
}
  • responseCode: 400 - Indicates a bad request due to invalid details.
  • responseMessage: Invalid details - A message indicating that some of the details provided in the request are invalid.

Notes

  • Ensure that the correct API key and token are provided.
  • Check the response codes to handle different outcomes appropriately in your application.
  • For security, keep your API key and token confidential.

By following this documentation, you can integrate and use the Fetch Payin Balance API effectively in your payment gateway system.