Documentation

Get Account Balance

Access to timely and accurate financial information is a vital resource for users of the GrailPay API. One of our key features is the ability to retrieve the current balance of any bank account linked to a user. To utilize this feature, the account must first be registered through GrailPay’s Bank Link Widget. You will then need to provide the following information as path parameters when making the API call:

  • uuid: The UUID of the user.
  • account_uuid: The UUID of the bank account associated with that user.

🚧

Note

Keep in mind that this balance check is only available to accounts connected through our Bank Link Widget. If attempted on an account added through the API ( manual_account ), we will respond with an error with a status code of 403.


Endpoint

   /3p/api/v2/users/{uuid}/bank-accounts/{account_uuid}

 

Response Object

{
    "status": true,
    "message": "",
    "data": {
        "available_balance": "25425"
    },
    "errors": null,
    "error_code": null
}

Errors & Warnings

{
    "status": false,
    "message": "Only a bank account connected through GrailPay's bank link widget can provide access to the account balance",
    "data": null,
    "errors": null,
    "error_code": null
}
{
    "status": false,
    "message": "This user is not available as they have been scheduled for deletion",
    "data": null,
    "errors": null,
    "error_code": null
}
{
    "status": false,
    "message": "The User was not found",
    "data": null,
    "errors": null,
    "error_code": null
}
{
    "status": false,
    "message": "No bank account found with the given details",
    "data": null,
    "errors": null,
    "error_code": null
}
{
    "status": false,
    "message": "We are unable to fetch the account balance",
    "data": null,
    "errors": null,
    "error_code": null
}
HTTP Status CodeError CodeReasonMessage
400client_errorMissing Accept HeaderInvalid value provided for Accept header.
400client_errorMissing Path ParametersYour request could not be processed due to invalid or missing parameters.
401client_errorInvalid Token FormatInvalid token format. The token should be in the following format: ID|TOKEN_VALUE. Example: 12345|abcdefg
401client_errorInvalid Token FormatInvalid token format. The ID in the token must be an integer. Example: 12345|abcdefg
401client_errorUnauthorizedInvalid token.
403client_errorInvalid Account TypeOnly a bank account connected through GrailPay's bank link widget can provide access to the account balance.
403client_errorUser Scheduled for DeletionThis user is not available as they have been scheduled for deletion.
404client_errorUser Not FoundThe User was not found.
404client_errorBank Account Not FoundNo bank account found with the given details.
503system_errorUnable to fetch the balanceWe are unable to fetch the account balance.