Borrower Onboarding and Loan Application

Aggregated API endpoint for borrower onboarding and loan application

Introduction

This api endpoint aggregates all the steps involved in borrower onboarding and loan application into a single api call. This api handles creating the borrower, verifying the borrower bank account details, and processing a default loan for the created borrower. To have a better understanding of the steps involved in onboarding a borrower, please check Borrower Onboarding

When the endpoint is called,

  1. The system checks to see if the borrower with the provided identity number exists for the aggregator. If the borrower exists, the onboarding flow proceeds to the next step which is the bank account verification. If the borrower does not exist for that aggregator, the borrower is created under that aggregator.

  2. Upon bank account verification; if the borrower has a bank account already registered, the onboarding flow proceeds to loan request and approval. However, if a bank account does not exist, the bank account is verified and added for that borrower.

  3. Once bank account is done, loan request and approval is done. see Loan Request and Approval

See Borrower Onboarding and Loan Application endpoint below.

Get Country's States

GET {{BaseUrl}}api/v1/account/all_state?country_code=NG

Endpoint to get list of states for a specific aggregator's country. Call this endpoint to get the respective states based on an aggregator's country before processing borrower onboarding and loan application

Query Parameters

{
  "data": [
    {
      "id": 1,
      "name": "Abuja",
      "state_code": "FC",
      "country_code": "NG"
    }
  ],
  "message": "Success",
  "status": true,
  "status_code": 200
}

Get Country's Bank List

GET {{BaseUrl}}api/v1/account/signed_banks_country?country_code=NG

Endpoint to get all bank list for a specific aggregator's country. Call this endpoint to get respective banks before processing borrower onboarding and loan application.

Query Parameters

{
    "data": [
        {
            "id": number,
            "name": " string",
            "slug": "string",
            "code": "string",
            "longcode": "string",
            "vigipay_bank_id": "string",
            "country_code": "string"
        },
    "message": "Success",
    "status": true,
    "status_code": 200
}

Get Sectors

GET {{BaseUrl}}/api/v1/misc/sectors

Endpoint to get all sectors.

{
  "data": [
    {
      "category_id": 1,
      "category_name": "agriculture",
      "category_slug": "agriculture",
      "code": "CF23660"
    }
  ],
  "message": "Success",
  "status": true,
  "status_code": 200
}

Get Aggregator Products

GET {{BaseUrl}}/api/v1/misc/query_product_by_aggregator

Headers

{
    "data": [
      {
        "id": 1,
        "product_code": "ABC",
        "product_name": "New Product",
        "maximum_amount": 1000000,
        "pub_date": "01/01/2021 00:00:00",
        "modified_date": "01/01/2021 00:00:00",
        "productCategoryName": "TEST Category",
        "interest_rate": 10,
        "maximum_tenor": 12,
        "aggregator_id": 1,
        "product_category_id": 13,
        ...
      },
      "message": "Products queried successfully",
      "status": true,
      "status_code": 200
  ]
}

Borrower Onboarding and Loan Application

POST {{BaseUrl}}/api/v1/account/loan_application

Endpoint to process borrower onboarding and loan application.

Headers

Request Body

{
    "loan_reference": "ABC123",
    "message": "Your bank account will be credited within 24hours if your application is approved.",
    "status": true,
    "status_code": 201
}

Get Loan by Reference

GET {{BaseUrl}}/api/v1/eco/agg_search_loans

Endpoint to fetch a loan by using either aggregator generated loan reference or Advancly generated loan reference. The loan status can be found in the status field of the response

Query Parameters

{
  "data": {
    "aggregator_details": {
      "aggregator_id": 1,
      "biz_name": "abc",
      "biz_email": "abc@xyz.com",
      "biz_phone": "08045275677",
      "biz_Address": "abc street, lagos Nigeria",
      "biz_category": "manufacturing",
      "is_active": true,
      "photo": "profile/borrowers/2020/10/07/0.jpg",
      "currency": null
    },
    "borrower_details": {
      "first_name": "Abc",
      "request_firstname": null,
      "last_name": "Xyz",
      "request_lastname": null,
      "gender": null,
      "request_gender": null,
      "date_of_birth": "0001-01-01T00:00:00",
      "request_dob": "0001-01-01T00:00:00",
      "personal_phone": "08132307123911",
      "request_phone": null,
      "kyc_score": null,
      "debt_balance": 110500,
      "available_balance": 0,
      "borrower_id": 116,
      "email": "abc@xyz.com",
      "borrower_type": null,
      "borrower_type_value": null,
      "my_biz_name": "",
      "my_biz_rc_num": "",
      "total_loan_collected": 0,
      "total_loan_repaid": 0
    },
    "paid_loans": [],
    "product_detail": {
      "id": 17,
      "product_name": "Asset Finance2",
      "product_code": "AF2",
      "interest_rate": "84"
    },
    "okra_details": {
      "okra_account_id": null,
      "okra_bvn": null,
      "okra_customer_id": null,
      "okra_record_id": null
    },
    "borrower_trust_score": 10,
    "retried_disbursement": [],
    "funder_name": "Test Acc Brymo",
    "disbursement_channel_id": null,
    "disbursement_gateway_request": null,
    "disbursement_gateway_response": null,
    "disbursement_gateway_status_id": null,
    "disbursement_response_date_time": null,
    "disbursement_gateway_reference_no": null,
    "disbursement_gateway_final": 0,
    "disbursement_reference_no": null,
    "disbursement_request_date_time": null,
    "loan_id": 18,
    "maker_checker_reference": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "loan_interest_amount": 10500,
    "loan_outstanding": 110500,
    "loan_due_date": "2021-05-25T00:00:00",
    "loan_status": "overdue",
    "is_active": false,
    "loan_tenure": 3,
    "loan_amount": 100000,
    "currency": null,
    "loan_amount_repay": 110500,
    "settlement_day": "2020-09-01T00:00:00",
    "has_disburse": false,
    "loan_repayment_balance": 0,
    "loan_ref": "xxxxxxxxxx",
    "has_repaid": false,
    "loan_transfer_status": "pending",
    "disbursement_tag": "",
    "loan_effective_date": "2021-05-22T00:00:00",
    "pub_date": "2020-08-31T07:44:29.435076",
    "modified_date": "2020-08-31T07:44:29.435093",
    "repayment_type": null,
    "repayment_schedule": [
      {
        "repay_schedule_id": 21,
        "pay_date": "2020-09-15T00:00:00",
        "repay_amount": 36833.33
      },
      {
        "repay_schedule_id": 22,
        "pay_date": "2020-10-15T00:00:00",
        "repay_amount": 36833.33
      },
      {
        "repay_schedule_id": 23,
        "pay_date": "2020-11-15T00:00:00",
        "repay_amount": 36833.33
      }
    ],
    "repaid_schedule": null,
    "status": "Submitted_and_awaiting_approval",
    "crc_status": "Failed",
    "crc_score": null,
    "crc_message": "no rcnumber record for borrower account exist for loan f2he3fn1vk",
    "xds_status": "Failed",
    "xds_score": null,
    "xds_message": "no rcnumber record for borrower account exist for loan f2he3fn1vk",
    "sf_status": "Cancelled",
    "sf_score": null,
    "prediction": null
  },
  "message": "Success",
  "status": true,
  "status_code": 200
}

Last updated