Salary Advance Loan API Reference
Welcome to the documentation for version 1 of the Salary Advance Loan API, a third-party API provided by Fedacash. This API allows for managing salary advance loan operations with various endpoints designed to handle tasks such as uploading staff data, fetching records, and more.
Postman Collection
-Download JSON Documentation- you can download the documentation and then upload it to your postman collection
How to Get the Access Token
- Join the Salary Advance Platform: Sign up or join the platform as instructed.
- Login with Credentials: Use the login credentials provided in your email to access your account.
- Locate and Copy the Access Token: Once logged in, navigate to your settings. You will find the access token(private key) at the top of the page. Click on it copy it for use in API requests.
Base URLs
- Live:
https://api.fedacash.com/api/salaryadvance/v1/live/ - Development:
https://api.fedacash.com/api/salaryadvance/v1/test/
Available Methods
The API supports the following HTTP methods:
- POST: Create or upload new data.
- PUT: Update existing data.
- GET: Retrieve data using specified query parameters.
Query Parameters for GET Requests
When making a GET request, the following query parameters can be used to filter and sort the data:
| Parameter | Description | Example Value |
|---|---|---|
search | Search term to filter results | "John Doe" |
page_size | Number of records per page | 6 |
page_num | Page number to retrieve | 1 |
sort_by | Field to sort the results by | id |
sort_type | Sort order (ASC for ascending, DESC for descending) | ASC |
added_by | Filter by the entity that added the record | customer |
approval_status | Filter by approval status (0 for pending, 1 for approved) | 0 |
status | Filter by current status (0 for inactive, 1 for active) | 0 |
api_type | Add api_type query to add loggin to your request | live or test |
Setting Up Axios for API Requests
To interact with the Salary Advance Loan API using Axios in a Node.js environment, follow the example setup below:
const axios = require('axios');let data = JSON.stringify({ "amount": 50000, "description": "loan description", "supporting_documents": "documents", "duration": 1, "repayment_amount": 55000, "api_type": "test", "bank_name": "my bank", "bank_code": "123", "recipient_account_name": "account name", "recipient_account_number": "1234567890", "company_name": "ABC Company", "employee_name": "Jon Doe"});
let config = { method: 'post', maxBodyLength: Infinity, url: 'https://apitest.fedacash.com/api/salaryadvance/v1/live/create-loan-request', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Bearer ${token}' }, data : data};
axios.request(config).then((response) => { console.log(JSON.stringify(response.data));}).catch((error) => { console.log(error);});Example CURL Request
For those who prefer using cURL, the following is an example of how to make a POST request to upload staff data via a CSV file:
curl -X POST "https://api.fedacash.com/api/salaryadvance/v1/test/upload-staff" \-H "Content-Type: multipart/form-data" \-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \-F "csv_file=@/path/to/your/file.csv"Salary Advance Loan API - Reference
This documentation outlines the API endpoints available for managing salary advance loans, staff, and loan repayments. Below is a list of endpoints along with links to their detailed documentation.
Endpoints
-
POST /upload-staff
- Onboard staff using a CSV file.
- View Details
-
GET /staff
- Retrieve a list of all staff members.
- View Details
Loan Request Endpoints
List Loan Requests API
GET https://api.fedacash.com/api/salaryadvance/v1/test/loan-request
- Description: Allows users to check all loan requests.
- View Details
Create Loan Request API
POST https://api.fedacash.com/api/salaryadvance/v1/test/create-loan-request
- Description: Allows users to create a new loan request.
- View Details
Loan Request Statistics API
GET http://api.fedacash.com/api/salaryadvance/test/v1/combined-analytics
- Description: Allows admins to fetch their loan statistics information.
- View Details
Update Loan Request (Approve/Decline)
PUT https://api.fedacash.com/api/salaryadvance/v1/test/loan-request/update
- Description: Allows admins to approve or decline a loan request.
- View Details
Loan Repayment Endpoints
Bulk Loan Repayment API
POST http://api.fedacash.com/api/salaryadvance/loan-repayment/bulk
- Description: Allows you to repay loans for all employees in bulk.
- View Details
Loan Repayment API
POST https://api.fedacash.com/api/salaryadvance/v1/test/employee-loan-repayment
- Description: Allows you to repay a loan for a single employee.
- View Details
Staff Management Endpoints
Onboard Staff With CSV
POST https://api.fedacash.com/api/salaryadvance/v1/test/upload-staff
- Description: Allows users to add a list of staff using a CSV file for salary advance.
- View Details
List of Salary Advance Employees
GET https://api.fedacash.com/api/salaryadvance/v1/test/salary-advance-staff-list
- Description: Allows admins to retrieve a list of salary advance employees.
- View Details
Update Salary Advance Employee Status
PUT https://api.fedacash.com/api/salaryadvance/v1/test/user/deactivate
- Description: Allows admins to deactivate or reactivate a staff member.
- View Details