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

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

ExamplesSchema

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": ""
      }
    ]
  }
}

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

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

ExamplesSchema

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": [
          ""
        ]
      }
    ]
  }
}

Was this page helpful?