FinServ API Documentation - Loan Application

Loan Application API

The Loan Application API allows authorized clients to submit loan requests for registered customers.

Endpoint

POST /api/loans/apply

Base URL: https://banking.finserv.com.ng

Authentication

This endpoint requires an API key.

HeaderValue
x-api-keyYour assigned API key

Request

Headers

KeyValue
Content-Typeapplication/json
x-api-keyYOUR_SECURE_API_KEY

Body (JSON)

{
  "customerId": "CUST123456",
  "accountId": "ACCT654321",
  "loanType": "Business Loan",
  "amount": 1000000,
  "repaymentFrequency": "monthly",
  "repaymentPeriod": "6 months"
}

Response

Success (200 OK)

{
  "loanId": "LOAN123456",
  "customerId": "CUST123456",
  "accountId": "ACCT654321",
  "loanType": "Business Loan",
  "amount": 1000000,
  "repaymentFrequency": "monthly",
  "repaymentPeriod": "6 months",
  "status": "pending approval"
}

Error Responses

Example Usage

JavaScript (Client Side)

fetch("https://banking.finserv.com.ng/api/loans/apply", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "YOUR_SECURE_API_KEY"
  },
  body: JSON.stringify({
    customerId: "CUST123456",
    accountId: "ACCT654321",
    loanType: "Business Loan",
    amount: 1000000,
    repaymentFrequency: "monthly",
    repaymentPeriod: "6 months"
  })
})
.then(response => response.json())
.then(data => {
  console.log("Loan ID:", data.loanId);
  console.log("Customer ID:", data.customerId);
  console.log("Account ID:", data.accountId);
  console.log("Loan Type:", data.loanType);
  console.log("Amount:", data.amount);
  console.log("Repayment Frequency:", data.repaymentFrequency);
  console.log("Repayment Period:", data.repaymentPeriod);
  console.log("Status:", data.status);
})
.catch(error => console.error("Error:", error));

Postman

Set method to POST, URL to https://banking.finserv.com.ng/api/loans/apply, add headers, and body as shown above.

Note: Always use HTTPS to protect sensitive data. Rotate API keys regularly for security.