Identity Endpoints

Establishing Eligibility for Critical Services.

The /products/identities endpoint allows you to retrieve various account holder information on file with the bank, including names, emails, phone numbers, and addresses.

Note: This request may take some time to complete if identity was not specified as an initial product when creating the Record. This is because Okra must communicate directly with the institution to retrieve the data.

curl -X POST https://api.okra.ng/v2/products/identities
-H 'Content-Type: application/json' 
-H 'Authorisation: Bearer <secretKey>'
const okra_client = require("okra-node")
okra_client.getIdentities(secretKey, {}, (err, results) => {
    // Handle err
    const auths = results.auths;
});
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.okra.ng/v2/products/identities")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json; charset=utf-8'
request["Authorization"] = 'Bearer {your_token}'

response = http.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.okra.ng/v2/products/identities",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json; charset=utf-8",
    "Authorization: Bearer {your_token}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import requests

url = "https://api.okra.ng/v2/products/identities"

headers = {
    "Accept": "application/json; charset=utf-8",
    "Authorization": "Bearer {your_token}"
}

response = requests.request("POST", url, headers=headers)

print(response.text)
{
    "status": "success",
    "message": "Identity retrieved succesfully",
    "data": {
        "pagination": {
            "totalDocs": 120,
            "limit": 1,
            "hasPrevPage": false,
            "hasNextPage": true,
            "page": 1,
            "totalPages": 120,
            "pagingCounter": 1,
            "prevPage": null,
            "nextPage": 2
        },
        "identity": [
            {
                "_id": "5ea1812477c7700382b20edc",
                "aliases": [
                    "GAVIN THEADORE BELSON",
                    "GAVIN BELSON",
                ],
                "phone": [
                    "+12329384738"
                ],
                "email": [
                    "[email protected]"
                ],
                "verified": true,
                "next_of_kins": [],
                "address": [
                    "123 Main St. San Francisco, Calidronia"
                ],
                "owner": [
                    {
                        "_id": "5d9288ea182d3d000cb7c486",
                        "name": "Okra Tech Inc.",
                        "app_name": "Okra, Inc"
                    }
                ],
                "record": [
                    {
                        "_id": "5fc65a0fad30601d8c67affb",
                        "status": {
                            "transactions": {
                                "last_success_at": null,
                                "last_fail_at": null
                            },
                            "process": {
                                "running": false,
                                "completed": true
                            }
                        },
                        "owner": "5d9288ea182d3d000cb7c486"
                    },
                    ...               
                ],
                "bvn": "12345678989",
                "firstname": "GAVIN",
                "lastname": "BELSON",
                "fullname": "GAVIN BELSON",
                "customer": {
                    "_id": "5e93bad841850d3a5315f32b",
                    "name": "GAVIN BELSON"
                },
                "env": "production",
                "photo_id": [
                    {
                        "_id": "5eaffd51f61c0e7bccf68c2d",
                        "url": "URL TO PHOTO"
                    }
                ],
                "created_at": "2020-04-23T11:51:00.286Z",
                "last_updated": "2020-12-21T17:45:25.908Z",
                "__v": 1,
                "dob": '1978-09-29',
                "gender": 'M',
                "marital_status": 'Single',
                "middlename": null,
            }
        ]
    }
}

Run in PostmanRun in Postman

Request Payload

Definition of All Payload Items from the Routes Below.

Key

Description

Default

page
Number

Page of list you would like to fetch

1

limit
Number

Number of Records you would like to fetch

20

pdf
Boolean

Send back as PDF

false

to
Date

YYYY-MM-DD

from
Date

YYYY-MM-DD

customer
ObjectId

Customer's Okra Unique ID

id
ObjectId

Unique Okra Identity ID

Retrieve Identity by Value

Use the baseURL https://api.okra.ng/v2/identity and append with any of the available routes.

curl -X POST https://api.okra.ng/v2/identity/${route}
-H 'Content-Type: application/json' 
-H 'Authorisation: Bearer <secretKey>'

Route

Payload

Node Function

/getById

id
to
from
pdf

getIdentityById

/getByCustomer

customer
to
from
pdf

getIdentityByCustomer

/getByDate

to
from
pdf

getIdentityByDate

/getByCustomerDate

customer
to
from
pdf

getIdentityByCustomerDate

Check out the Identity Reference


What's Next

Check out how NUBAN Identity Verification works

Did this page help you?