Retrieve all Clients

GET /v1/api/clients

This endpoint retrieves all clients belonging to a business

Headers

Name
Value

Content-Type

application/json

x-api-key

Business Secret Key

Query

Name
Type
Description
Required

limit

Number

The number of clients to return (default is 20).

false

page

number

The page number to return (default is 1).

false

startDate

String

The start date for filtering clients (format: YYYY-MM-DD).

false

endDate

String

The end date for filtering clients (format: YYYY-MM-DD). Must be greater than or equal to the start date.

false, true if startDate is present

Response

{
"success": true,
"statusCode": 200,
"message": "Clients retrieved successfully!",
"data": {
    "docs": [
        {
            "loans": [
                {
                    "tenure": {
                        "value": 12,
                        "interval": "months"
                    },
                    "dateLoanIsSettled": null,
                    "_id": "669baf94ff3c2f8f82666716",
                    "loanReferenceId": "loan_123456",
                    "applicationDate": "2023-01-01T00:00:00.000Z",
                    "dateLoanWasGranted": "2023-01-15T00:00:00.000Z",
                    "applicationStatus": "approved",
                    "amount": 10000,
                    "currency": "NGN",
                    "totalInstallments": 12,
                    "installmentRepayments": [
                        {
                            "amountPaid": {
                                "_id": "669baf94ff3c2f8f82666719",
                                "amount": 833.33,
                                "currency": "NGN"
                            },
                            "_id": "669baf94ff3c2f8f82666717",
                            "dueDate": "2023-02-01T00:00:00.000Z",
                            "datePaid": "2023-02-01T00:00:00.000Z",
                            "amountDue": {
                                "_id": "669baf94ff3c2f8f82666718",
                                "amount": 833.33,
                                "currency": "NGN"
                            },
                            "status": "fully_paid",
                            "dateAdded": "2024-07-20T12:37:40.213Z",
                            "lastModifiedAt": "2024-07-20T12:37:40.213Z"
                        },
                        {
                            "amountPaid": {
                                "_id": "669baf94ff3c2f8f8266671c",
                                "amount": 833.33,
                                "currency": "NGN"
                            },
                            "_id": "669baf94ff3c2f8f8266671a",
                            "dueDate": "2023-03-01T00:00:00.000Z",
                            "datePaid": "2023-03-01T00:00:00.000Z",
                            "amountDue": {
                                "_id": "669baf94ff3c2f8f8266671b",
                                "amount": 833.33,
                                "currency": "NGN"
                            },
                            "status": "fully_paid",
                            "dateAdded": "2024-07-20T12:37:40.213Z",
                            "lastModifiedAt": "2024-07-20T12:37:40.213Z"
                        },
                        {
                            "amountPaid": {
                                "_id": "669baf94ff3c2f8f8266671f",
                                "amount": 833.33,
                                "currency": "NGN"
                            },
                            "_id": "669baf94ff3c2f8f8266671d",
                            "dueDate": "2023-04-01T00:00:00.000Z",
                            "datePaid": "2023-04-01T00:00:00.000Z",
                            "amountDue": {
                                "_id": "669baf94ff3c2f8f8266671e",
                                "amount": 833.33,
                                "currency": "NGN"
                            },
                            "status": "fully_paid",
                            "dateAdded": "2024-07-20T12:37:40.213Z",
                            "lastModifiedAt": "2024-07-20T12:37:40.213Z"
                        },
                        {
                            "amountPaid": null,
                            "_id": "669baf94ff3c2f8f82666720",
                            "dueDate": "2023-05-01T00:00:00.000Z",
                            "datePaid": null,
                            "amountDue": {
                                "_id": "669baf94ff3c2f8f82666721",
                                "amount": 833.33,
                                "currency": "NGN"
                            },
                            "status": "not_paid",
                            "dateAdded": "2024-07-20T12:37:40.213Z",
                            "lastModifiedAt": "2024-07-20T12:37:40.213Z"
                        }
                    ],
                    "loanRepaymentStatus": "in_progress",
                    "dateLastInstallmentIsDue": "2024-01-01T00:00:00.000Z",
                    "client": "669baedbff3c2f8f8266670c",
                    "businessId": "667d38938450ddf0f7ea2468",
                    "createdAt": "2024-07-20T12:37:40.214Z",
                    "lastModifiedAt": "2024-07-20T12:37:40.214Z",
                    "__v": 0,
                    "_createdAt": "2024-07-20T13:37:4040+01:00",
                    "_lastModifiedAt": "2024-07-20T13:37:4040+01:00",
                    "id": "669baf94ff3c2f8f82666716"
                }
            ],
            "latestDigitalCreditInfo": null,
            "digitalCreditInfoHistory": [],
            "externalReferenceId": "1234567890",
            "businessId": "667d38938450ddf0f7ea2468",
            "createdAt": "2024-07-20T12:34:35.459Z",
            "lastModifiedAt": "2024-07-20T12:37:40.506Z",
            "_createdAt": "2024-07-20T13:34:3535+01:00",
            "_lastModifiedAt": "2024-07-20T13:37:4040+01:00",
            "clientId": "669baedbff3c2f8f8266670c",
            "id": "669baedbff3c2f8f8266670c"
        }
    ],
    "pagination": {
        "totalDocs": 1,
        "perPage": 20,
        "totalPages": 1,
        "currentPage": 1,
        "serialNo": 1,
        "hasPrevPage": false,
        "hasNextPage": false,
        "prevPage": null,
        "nextPage": null
    }
},
"links": []
}

Last updated