Manage Customers

Track the records of customers who have connected their bank accounts with your app.

📘

Verify your customer & speed up onboarding

Checkout our Selfie Verification and Identity API to properly identify your customer's and speed up onboarding

Okra offers an api that returns an array of customers associated to your company. You will only receive Unique Identifier's e.g. BVN, NIN, or Drivers License if Identity is chosen as a product.

curl -X POST https://api.okra.ng/v2/customers/list
-H 'Content-Type: application/json' 
-H 'Authorization: Bearer <secretKey>'
const okra_client = require('okra-node');
okra_client.getCustomers(secretKey, {},(err, results) => {
        // Handle err
    const customers = results.customers;
    });
{
    "status": "success",
    "message": "Customer's successfully retrieved",
    "data": {
        "total": 1,
        "data": {
            "customers": [
                {
                    "credentials": [
                        {
                            "bank": {
                                "colors": {
                                    "accent": "",
                                    "primary": "",
                                    "button": "",
                                    "icon": ""
                                },
                                "_id": "",
                                "icon": "",
                                "logo": "",
                                "name": "",
                                "v2_icon": "",
                                "v2_logo": ""
                            },
                            "nuban": "",
                            "accountName": "",
                            "connected": true
                        }
                    ],
                    "record": [
                        {
                            "_id": "",
                            "bank": "",
                            "env": ""
                        }
                    ],
                    "email": [
                        ""
                    ],
                    "phone": [
                        ""
                    ],
                    "blocked": false,
                    "owner": [
                        {
                            "_id": "",
                            "name": "",
                            "app_name": ""
                        }
                    ],
                    "linkLater": false,
                    "debitLater": true],
                    "otherInfo": [],
                    "unconnected": false,
                    "manual": false,
                    "_id": "",
                    "name": "",
                    "env": "",
                    "created_at": "",
                    "last_updated": "",
                    "__v": 0
                }
            ],
            "pagination": {
                "totalDocs": 147,
                "limit": 1,
                "hasPrevPage": false,
                "hasNextPage": true,
                "page": 1,
                "totalPages": 147,
                "pagingCounter": 1,
                "prevPage": null,
                "nextPage": 2
            }
        }
    }
}

Retrieve Customer by Field

Retrieve a customer via any of the nodes within the schema

l -X POST https://api.okra.ng/v2/customers/find-customers-by
-H 'Content-Type: application/json' 
-H 'Authorization: Bearer <secretKey>'
-D '{ 
    key: "name", 
  value: "Akeeb" 
}'
const okra_client = require('okra-node');
okra_client.getCustomersByKey(accessToken, {key: 'email', value: 'customerEmail'},(err, results) => {
        // Handle err
    const customers = results.customers;
    });
{
    "status": "success",
    "message": "Customer search by email succesfully fetched",
    "data": {
        "_id": "",
        "email": [
            ""
        ],
        "phone": [
            ""
        ],
        "blocked": false,
        "last_login": "2020-08-25T13:01:37.000Z",
        "name": "",
        "env": "production",
        "created_at": "2020-08-25T12:56:36.625Z",
        "last_updated": "2020-08-25T13:01:37.788Z",
        "__v": 0
    }
}

Remove a Customer

Once removed you will no longer have access to a customer's products.

curl -X POST https://api.okra.ng/v2/customers/remove
-H 'Content-Type: application/json' 
-H 'Authorization: Bearer <AccessToken>'
-D '{ 
            customer: "5cnvkfb0368nvk"
    }'

Flag a Customer

Once flagged this customer will no longer be able to link with your account and you will be unable to retrieve any new data points.

curl -X POST https://api.okra.ng/v2/customers/flag
-H 'Content-Type: application/json' 
-H 'Authorization: Bearer <AccessToken>'
-D '{ 
            customer: "5cnvkfb0368nvk"
      bank: "5cnvkfb0368nvk" //optional
    }'
curl -X POST https://okra.ng/v1/customers/unflag
-H 'Content-Type: application/json' 
-H 'Authorization: Bearer <AccessToken>'
-D '{ 
            customer: "5cnvkfb0368nvk"
      bank: "5cnvkfb0368nvk" //optional
    }'

Check other related endpoints on the customer reference


What's Next
Did this page help you?