FinServ API Documentation - Loan Repayment

Loan Repayment API

The Loan Repayment API allows authorized clients to record repayments against loan schedules.

Endpoint

POST /api/loans/repay

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)

{
  "loanId": "LOAN123456",
  "scheduleId": "SCH001",
  "scheduleDate": "2026-02-01",
  "amount": 50000
}

Response

Success (200 OK)

{
  "repaymentId": "REPAY654321",
  "loanId": "LOAN123456",
  "scheduleId": "SCH001",
  "scheduleDate": "2026-02-01",
  "amountPaid": 50000,
  "status": "completed"
}

Error Responses

Example Usage

JavaScript (Client Side)

fetch("https://banking.finserv.com.ng/api/loans/repay", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "YOUR_SECURE_API_KEY"
  },
  body: JSON.stringify({
    loanId: "LOAN123456",
    scheduleId: "SCH001",
    scheduleDate: "2026-02-01",
    amount: 50000
  })
})
.then(response => response.json())
.then(data => {
  console.log("Repayment ID:", data.repaymentId);
  console.log("Loan ID:", data.loanId);
  console.log("Schedule ID:", data.scheduleId);
  console.log("Schedule Date:", data.scheduleDate);
  console.log("Amount Paid:", data.amountPaid);
  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/repay, add headers, and body as shown above.

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