Okra API endpoints for Balance

Get balance by customer

post /balance/getByCustomer

This endpoint allows you retrieve the bank account balance associated with a record's current, savings, and domiciliary accounts using the customer id

HTTP bearer bearer

customer

string

required

The customer.id you want to get detailed information about.

Example
"34jhjsh98983jjwhj"

page

int

i32

required

A page number within the paginated result set.

Example
1

limit

int

i32

required

This limits the number of records returned based on a limit value

Example
5

includePeriodic

boolean

The includePeriodic is a boolean optional input that can take true or false values When the request body includes includePeriodic with a false value, the periodic field will NOT be included in the response When the request body does NOT include includePeriodic , then by default the periodic filed will be included (the default behavior is includePeriodic is true)

Example
false

Response

Examples Schema

OK

{
  "status": "success",
  "message": "Balance retrieved succesfully",
  "data": {
    "pagination": {
      "totalDocs": 32,
      "limit": 1,
      "hasPrevPage": false,
      "hasNextPage": true,
      "page": 1,
      "totalPages": 32,
      "pagingCounter": 1,
      "nextPage": 2
    },
    "balance": [
      {
        "_id": "",
        "account": {
          "_id": "",
          "bank": {
            "_id": "",
            "colors": {
              "accent": "",
              "primary": "",
              "button": "",
              "icon": ""
            },
            "icon": "",
            "logo": "",
            "name": "",
            "v2_icon": "",
            "v2_logo": ""
          },
          "nuban": "",
          "name": ""
        },
        "__v": 0,
        "available_balance": 29180,
        "created_at": "",
        "currency": "",
        "customer": {
          "_id": "",
          "name": ""
        },
        "env": "",
        "last_updated": "",
        "ledger_balance": 7456.4,
        "owner": [
          ""
        ],
        "record": [],
        "connected": [
          ""
        ],
        "id": ""
      }
    ]
  }
}

status

string

message

string

data

object (data)

Example
{ "pagination": { "totalDocs": 32, "limit": 1, "hasPrevPage": false, "hasNextPage": true, "page": 1, "totalPages": 32, "pagingCounter": 1, "nextPage": 2 }, "balance": [ { "_id": "", "account": { "_id": "", "bank": { "_id": "", "colors": { "accent": "", "primary": "", "button": "", "icon": "" }, "icon": "", "logo": "", "name": "", "v2_icon": "", "v2_logo": "" }, "nuban": "", "name": "" }, "__v": 0, "available_balance": 29180, "created_at": "", "currency": "", "customer": { "_id": "", "name": "" }, "env": "", "last_updated": "", "ledger_balance": 7456.4, "owner": [ "" ], "record": [], "connected": [ "" ], "id": "" } ] }

pagination

object (pagination)

totalDocs

int

i32

The total number of results that match the request.

limit

int

i32

Returns the value of the limit parameter. Limit sets the number of results that the API returns in a single page. If you do not specify a value for limit, the API will limit the response to 10 results per page.

hasPrevPage

boolean

Shows when a previous page of results is available. This field always returns true when the value of page is greater than 1.

hasNextPage

boolean

Shows when a next page of results is available. When true, Okra recommends that you make subsequent requests to retrieve the following pages of results.

page

int

i32

Returns the number of the current page. For example, if you set page to 1 in your request, the API will return the first page of results in the response.

totalPages

int

i32

The total number of pages that the API returns.

pagingCounter

int

i32

The index number of the first result on the current page. For example, if the value of page is 2 and limit is set to 10, then pagingCounter returns 11.

prevPage

string or null

The number of previous result pages. If the value of page is 1 and there is no previous page, the value of prevPage is null.

nextPage

string or null

The number of following result pages. Each page consists of up to 100 items. If there are not enough results for an additional page, the value is null.

balance

array[object (Balance1)]

Balance1

object (Balance1)

Example
{ "_id": "", "account": { "_id": "", "bank": { "_id": "", "colors": { "accent": "", "primary": "", "button": "", "icon": "" }, "icon": "", "logo": "", "name": "", "v2_icon": "", "v2_logo": "" }, "nuban": "", "name": "" }, "__v": 0, "available_balance": 29180, "created_at": "", "currency": "", "customer": { "_id": "", "name": "" }, "env": "", "last_updated": "", "ledger_balance": 7456.4, "owner": [ "" ], "record": [], "connected": [ "" ], "id": "" }

_id

string

The unique identifier created by Okra used to reference the account.

account

object (account)

Example
{ "_id": "", "bank": { "_id": "", "colors": { "accent": "", "primary": "", "button": "", "icon": "" }, "icon": "", "logo": "", "name": "", "v2_icon": "", "v2_logo": "" }, "nuban": "", "name": "" }

_id

string

The unique identifier created by Okra used to reference the balance.

name

string

The account name of the account holder as returned from the bank

nuban

string

The account number of the account holder

__v

int

i32

available_balance

int

i32

The balance that the account owner can use.

created_at

string

The ISO-8601 timestamp of when the data point was first created in Okra's database.

currency

string

The currency of the account. For example:

  • 🇳🇬 NGN (Nigeria Naira)
  • 🇺🇸 USA (United State Dollars) Please note that other currencies other than in the list above may be returned.

customer

object (customer)

_id

string

The unique identifier that references the user.

name

string

The user’s full name.

env

string

The environment variable. Could either be:

  • production
  • sandbox.

last_updated

string

The ISO-8601 timestamp of when the data point was last updated in Okra's database.

ledger_balance

number

The checking account balance at the beginning of a given day.

owner

array[string]

The account owner of the account balance.

string

record

array[string]

The record ID of the balance returned from the bank.

string

connected

array[string]

string

id

string

The unique identifier created by Okra used to reference the balance.

X-Powered-By

string

Content Type
text/plain
Example
"Express"

Access-Control-Allow-Methods

string

Content Type
text/plain
Example
"GET, POST, OPTIONS, PUT, PATCH, DELETE"

Access-Control-Allow-Headers

string

Content Type
text/plain
Example
"X-Requested-With,content-type,authorization"

Access-Control-Allow-Credentials

string

Content Type
text/plain
Example
"true"

Content-Length

string

Content Type
text/plain
Example
"14500"

ETag

string

Content Type
text/plain
Example
"W/\"38a4-a4I4F9tulD/UHaGs+3QiGPro3A0\""

Date

string

Content Type
text/plain
Example
"Fri, 20 Nov 2020 12:46:23 GMT"

Connection

string

Content Type
text/plain
Example
"keep-alive"

Keep-Alive

string

Content Type
text/plain
Example
"timeout=5"

Get balance by account

post /balance/getByAccount

This endpoint allows you retrieve the bank account balance associated with a record's current, savings, and domiciliary accounts using the account id

HTTP bearer bearer

account

string

required

The account.id you want to get detailed information about.

Example
"786hjgw9776uijj8973"

page

int

i32

A page number within the paginated result set.

Example
1

limit

int

i32

This limits the number of records returned based on a limit value

Example
1

includePeriodic

boolean

The includePeriodic is a boolean optional input that can take true or false values When the request body includes includePeriodic with a false value, the periodic field will NOT be included in the response When the request body does NOT include includePeriodic , then by default the periodic filed will be included (the default behavior is includePeriodic is true)

Example
false

Response

Examples Schema

OK

{
  "status": "success",
  "message": "Balance retrieved succesfully",
  "data": {
    "pagination": {
      "totalDocs": 1,
      "limit": 1,
      "hasPrevPage": false,
      "hasNextPage": false,
      "page": 1,
      "totalPages": 1,
      "pagingCounter": 1
    },
    "balance": [
      {
        "_id": "",
        "account": {
          "_id": "",
          "name": "",
          "nuban": "",
          "bank": {
            "_id": "",
            "colors": {
              "primary": "",
              "accent": "",
              "button": "",
              "icon": ""
            },
            "icon": "",
            "logo": "",
            "name": "",
            "v2_icon": "",
            "v2_logo": ""
          }
        },
        "env": "",
        "__v": 0,
        "available_balance": 505.33,
        "created_at": "",
        "currency": "",
        "customer": {
          "_id": "",
          "name": ""
        },
        "last_updated": "",
        "ledger_balance": 505.33,
        "owner": [
          ""
        ],
        "record": [
          {
            "_id": "",
            "status": {
              "process": {
                "running": false,
                "completed": true
              }
            }
          }
        ],
        "periodic": {
          "available_balance": [
            {
              "_id": "",
              "amount": 505.33
            }
          ]
        },
        "connected": [
          ""
        ]
      }
    ]
  }
}

status

string

message

string

data

object (data)

Example
{ "pagination": { "totalDocs": 1, "limit": 1, "hasPrevPage": false, "hasNextPage": false, "page": 1, "totalPages": 1, "pagingCounter": 1 }, "balance": [ { "_id": "", "account": { "_id": "", "name": "", "nuban": "", "bank": { "_id": "", "colors": { "primary": "", "accent": "", "button": "", "icon": "" }, "icon": "", "logo": "", "name": "", "v2_icon": "", "v2_logo": "" } }, "env": "", "__v": 0, "available_balance": 505.33, "created_at": "", "currency": "", "customer": { "_id": "", "name": "" }, "last_updated": "", "ledger_balance": 505.33, "owner": [ "" ], "record": [ { "_id": "", "status": { "process": { "running": false, "completed": true } } } ], "periodic": { "available_balance": [ { "_id": "", "amount": 505.33 } ] }, "connected": [ "" ] } ] }

pagination

object (pagination)

totalDocs

int

i32

The total number of results that match the request.

limit

int

i32

Returns the value of the limit parameter. Limit sets the number of results that the API returns in a single page. If you do not specify a value for limit, the API will limit the response to 10 results per page.

hasPrevPage

boolean

Shows when a previous page of results is available. This field always returns true when the value of page is greater than 1.

hasNextPage

boolean

Shows when a next page of results is available. When true, Okra recommends that you make subsequent requests to retrieve the following pages of results.

page

int

i32

Returns the number of the current page. For example, if you set page to 1 in your request, the API will return the first page of results in the response.

totalPages

int

i32

The total number of pages that the API returns.

pagingCounter

int

i32

The index number of the first result on the current page. For example, if the value of page is 2 and limit is set to 10, then pagingCounter returns 11.

prevPage

string or null

The number of previous result pages. If the value of page is 1 and there is no previous page, the value of prevPage is null.

nextPage

string or null

The number of following result pages. Each page consists of up to 100 items. If there are not enough results for an additional page, the value is null.

balance

array[object (Balance2)]

Balance2

object (Balance2)

Example
{ "_id": "", "account": { "_id": "", "name": "", "nuban": "", "bank": { "_id": "", "colors": { "primary": "", "accent": "", "button": "", "icon": "" }, "icon": "", "logo": "", "name": "", "v2_icon": "", "v2_logo": "" } }, "env": "", "__v": 0, "available_balance": 505.33, "created_at": "", "currency": "", "customer": { "_id": "", "name": "" }, "last_updated": "", "ledger_balance": 505.33, "owner": [ "" ], "record": [ { "_id": "", "status": { "process": { "running": false, "completed": true } } } ], "periodic": { "available_balance": [ { "_id": "", "amount": 505.33 } ] }, "connected": [ "" ] }

_id

string

account

object (account)

Example
{ "_id": "", "bank": { "_id": "", "colors": { "accent": "", "primary": "", "button": "", "icon": "" }, "icon": "", "logo": "", "name": "", "v2_icon": "", "v2_logo": "" }, "nuban": "", "name": "" }

_id

string

The unique identifier created by Okra used to reference the balance.

name

string

The account name of the account holder as returned from the bank

nuban

string

The account number of the account holder

env

string

__v

int

i32

available_balance

number

created_at

string

currency

string

customer

object (customer)

_id

string

The unique identifier that references the user.

name

string

The user’s full name.

last_updated

string

ledger_balance

number

owner

array[string]

string

record

array[object (Record2)]

Record2

object (Record2)

Example
{ "_id": "", "status": { "process": { "running": false, "completed": true } } }

_id

string

The unique identifier created by Okra used to reference the record.

status

object (status)

Example
{ "process": { "running": false, "completed": true } }

process

object (process)

Example
{ "running": false, "completed": true }

running

boolean

completed

boolean

periodic

object (periodic)

Example
{ "available_balance": [ { "_id": "", "amount": 505.33 } ] }

available_balance

array[object (AvailableBalance1)]

AvailableBalance1

object (AvailableBalance1)

Example
{ "_id": "", "amount": 505.33 }

_id

string

The unique identifier created by Okra used to reference the account.

amount

number

The amount available to spend by the user.

connected

array[string]

string

X-Powered-By

string

Content Type
text/plain
Example
"Express"

Access-Control-Allow-Methods

string

Content Type
text/plain
Example
"GET, POST, OPTIONS, PUT, PATCH, DELETE"

Access-Control-Allow-Headers

string

Content Type
text/plain
Example
"X-Requested-With,content-type,authorization"

Access-Control-Allow-Credentials

string

Content Type
text/plain
Example
"true"

Content-Length

string

Content Type
text/plain
Example
"90456"

ETag

string

Content Type
text/plain
Example
"W/\"16158-MXYqjKh7rqmKJ5/W8hDKiYR0JEw\""

Date

string

Content Type
text/plain
Example
"Fri, 20 Nov 2020 12:50:01 GMT"

Connection

string

Content Type
text/plain
Example
"keep-alive"

Keep-Alive

string

Content Type
text/plain
Example
"timeout=5"

Was this page helpful?