Retrieve Financial Institutions Account

Retrieve List of all accounts for this user

Using the previously created user-access-token in Step 3, we can now retrieve the information about different financial institution accounts connected by this user.

curl https://sandbox.onebrick.io/v1/account/list 
  -H 'Content-Type: application/json' 
  -H 'Authorization: Bearer user-access-token'

Where [user-access-token] is the access token generated after successful financial Institution connection through the widget which needs to be passed as the Bearer token in the Authorization header.

The API responds with accounts associated with the user who logged in using the Brick widget.

{
    "status": 200,
    "message": "OK",
    "data": [
        {
            "accountId": "UarXg4ad/81344wJF8xthY==",
            "accountHolder": "JOHN DOE",
            "accountNumber": "1551110757891",
            "balances": {
                "available":22130.0,
                "current": 22130.0
            }
        },
        {
            "accountId": "ZUTBeQcl2FTqNUwcVDuRFF==",
            "accountHolder": "JOHN DOE",
            "accountNumber": "1234567890123",
            "balances": {
                "available": 320554.15,
                "current": 320554.15
            }
        }
    ]
}

Retrieve details of a particular financial institution account

Using the accountId retrieved from the previous API- accounts list, you can get in-depth details about the account include any identifying information that's available on the account.

curl https://sandbox.onebrick.io/v1/account/detail?accountId=accountId 
  -H 'Content-Type: application/json' 
  -H 'Authorization: Bearer user-access-token'

Where [user-access-token] is the access token generated after successful financial Institution connection through the widget which needs to be passed as the Bearer token in the Authorization header. And accountId is the identification of the account for which you want the details.

The API responds with details of the account associated with the accountId.

{
    "status": 200,
    "message": "OK",
    "data": {
        "accountId": "S8vzhyw3owDtYDOB87va==",
        "accountHolder": "John Doe",
        "accountNumber": "987-0675-789",
        "balances": {
            "available": 7500000.0,
            "current": 7500000.0
        }
    }
}

Where [user-access-token] is the access token generated after successful financial Institution connection through the widget which needs to be passed as the Bearer token in the Authorization header. And accountId is the identification of the account for which you want the details.


Did this page help you?