Client Management

🏦 Cladfy Member API Documentation

Version: v1.0
Base URL: https://{appname}.cladfy.app/api


🎯 Purpose

For external developers to integrate Cladfy Microlender System features into their mobile apps, websites, or third-party systems.


πŸ‘₯ Who Uses This API

  • πŸ“± Mobile Apps (iOS, Android, Flutter, React Native)
  • 🌐 Web Apps or Websites
  • πŸ”— External Systems & Platforms

πŸ” Authentication

API Keys (for registration & login)

X-API-Key: pk_your_branch_key
X-API-Secret: sk_your_branch_secret

JWT Token (for all other endpoints)

Authorization: Bearer {jwt_token}

Tokens expire in 1 hour and can be refreshed using /auth/refresh.


🌍 Environments

EnvironmentBase URL
Productionhttps://{appname}.cladfy.app/api
Staginghttp://localhost:8000/api

πŸ” 1. Authentication

1.1 Register Member

Endpoint:
POST /auth/register

Headers

X-API-Key: {{api_key}}
X-API-Secret: {{api_secret}}
Content-Type: application/json
Accept: application/json

Body

{
  "first_name": "John",
  "last_name": "Doe",
  "email": "[email protected]",
  "password": "SecurePass123!",
  "password_confirmation": "SecurePass123!",
  "country_code": "+1",
  "mobile": "1234567890",
  "gender": "male",
  "city": "New York",
  "state": "NY",
  "zip": "10001",
  "address": "123 Main Street",
  "credit_source": "salary"
}

Sample Response

{
  "success": true,
  "message": "Member registered successfully. Awaiting approval.",
  "data": {
    "member": {
      "id": 10,
      "member_no": "MBR00010",
      "status": 0
    },
    "user": {
      "id": 45,
      "email": "[email protected]"
    }
  }
}

PHP Example

$ch = curl_init('https://demo.cladfy.app/api/auth/register');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'X-API-Key: '.$apiKey,
  'X-API-Secret: '.$apiSecret,
  'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);

1.2 Login (Get JWT Token)

Endpoint:
POST /auth/login

Body

{
  "email": "[email protected]",
  "password": "SecurePass123!"
}

Sample Response

{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIs...",
    "token_type": "bearer",
    "expires_in": 3600,
    "member": {
      "id": 10,
      "member_no": "MBR00010"
    }
  }
}

πŸ‘€ 2. Profile Management

2.1 Get Profile

Endpoint:
GET /members/profile

Headers

Authorization: Bearer {{jwt_token}}
Accept: application/json

Sample Response

{
  "success": true,
  "data": {
    "member": {
      "id": 10,
      "first_name": "John",
      "last_name": "Doe",
      "business_name": "John's Business Solutions",
      "city": "New York"
    }
  }
}

πŸ’° 3. Loan Products

3.1 Get All Loan Products

Endpoint:
GET /loans/products

Sample Response

{
  "success": true,
  "data": {
    "loan_products": [
      {
        "id": 1,
        "name": "Business Loan",
        "min_amount": 1000,
        "max_amount": 10000,
        "interest_rate": "10%",
        "term": "12 months"
      }
    ]
  }
}

πŸ“ 4. Loan Applications

4.1 Apply for Loan

Endpoint:
POST /loans/apply

Body

{
  "loan_product_id": 1,
  "currency_id": 1,
  "first_payment_date": "2025-02-01",
  "applied_amount": 5000,
  "description": "For inventory expansion"
}

Sample Response

{
  "success": true,
  "data": {
    "loan": {
      "id": 30,
      "loan_number": "LN00030",
      "status": "pending"
    }
  }
}

πŸ’³ 5. Repayments

5.1 Get Upcoming Repayments

Endpoint:
GET /repayments/upcoming

Sample Response

{
  "success": true,
  "data": {
    "upcoming_repayments": [
      {
        "loan_id": 30,
        "due_date": "2025-03-01",
        "amount_due": 550.0
      }
    ]
  }
}

5.2 Make Payment

Endpoint:
POST /repayments/make-payment

Body

{
  "loan_id": 30,
  "repayment_id": 1,
  "principal_amount": 550,
  "account_id": 2
}

Sample Response

{
  "success": true,
  "data": {
    "payment": {
      "id": 101,
      "amount": 550,
      "status": "paid",
      "receipt_no": "PAY000101"
    }
  }
}

βš™οΈ Summary

SectionEndpointsDescription
Authentication7Register, login, logout, refresh
Profile Management5Get/update profile, upload docs
Loan Products2Browse and view products
Loan Applications4Apply, view, and track loans
Repayments5View and make payments