Skip to main content
GET
/
api
/
loan-types
Loan Types
curl --request GET \
  --url https://api.example.com/api/loan-types \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "minAmount": 123,
  "maxAmount": 123,
  "defaultInterestRate": 123,
  "minTerm": 123,
  "maxTerm": 123,
  "termUnit": "<string>"
}
'
{
  "loanTypes": [
    {
      "id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "minAmount": 123,
      "maxAmount": 123,
      "defaultInterestRate": 123,
      "minTerm": 123,
      "maxTerm": 123,
      "termUnit": "<string>",
      "isActive": true,
      "createdAt": "<string>"
    }
  ]
}
Manage loan type configurations that define loan products available in the system.

List Loan Types

GET /api/loan-types

Retrieve all available loan types.

Authentication

Required. All authenticated staff can view loan types.

Response

loanTypes
array

Example Request

cURL
curl -X GET "https://api.millenium-potters.com/api/loan-types" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "loanTypes": [
    {
      "id": "clt123abc",
      "name": "Personal Loan",
      "description": "Short-term personal loans for individual needs",
      "minAmount": 10000,
      "maxAmount": 500000,
      "defaultInterestRate": 15.0,
      "minTerm": 1,
      "maxTerm": 12,
      "termUnit": "MONTH",
      "isActive": true,
      "createdAt": "2026-01-01T00:00:00Z"
    },
    {
      "id": "clt456def",
      "name": "Business Loan",
      "description": "Loans for small business operations",
      "minAmount": 50000,
      "maxAmount": 2000000,
      "defaultInterestRate": 18.0,
      "minTerm": 3,
      "maxTerm": 24,
      "termUnit": "MONTH",
      "isActive": true,
      "createdAt": "2026-01-01T00:00:00Z"
    }
  ]
}

Create Loan Type

POST /api/loan-types

Create a new loan type configuration.

Authentication

Required. Only Admin role can create loan types.

Request Body

name
string
required
Loan type name
description
string
Loan type description
minAmount
number
required
Minimum loan amount
maxAmount
number
required
Maximum loan amount
defaultInterestRate
number
required
Default annual interest rate (percentage)
minTerm
number
required
Minimum loan term
maxTerm
number
required
Maximum loan term
termUnit
string
required
Term unit: DAY, WEEK, or MONTH

Example Request

cURL
curl -X POST "https://api.millenium-potters.com/api/loan-types" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Emergency Loan",
    "description": "Quick loans for urgent needs",
    "minAmount": 5000,
    "maxAmount": 100000,
    "defaultInterestRate": 20.0,
    "minTerm": 1,
    "maxTerm": 6,
    "termUnit": "MONTH"
  }'

Update Loan Type

PUT /api/loan-types/:id

Update an existing loan type configuration.

Authentication

Required. Only Admin role can update loan types.

Request Body

All fields are optional. Only provided fields will be updated.

Toggle Loan Type Status

PUT /api/loan-types/:id/toggle-status

Activate or deactivate a loan type.

Authentication

Required. Only Admin role can toggle loan type status.

Response

{
  "id": "clt123abc",
  "isActive": false,
  "message": "Loan type status updated successfully"
}
Deactivating a loan type prevents new loans from being created with this type. Existing loans are not affected.

Delete Loan Type

DELETE /api/loan-types/:id

Delete a loan type. This operation will fail if there are active loans using this type.

Authentication

Required. Only Admin role can delete loan types.
Loan types with active loans cannot be deleted. Deactivate them instead to prevent new loans while preserving historical data.

See Also

Build docs developers (and LLMs) love