https://{your-domain}.fincode.software/api/v1/services/user/payoff-loan
{
"status": "<string>",
"data": {
"repaymentId": "<string>",
"loanApplicationId": "<string>",
"payoffAmount": 123,
"remainingBalance": 123,
"loanStatus": "<string>",
"transactionReference": "<string>",
"payoffDate": "<string>"
}
}API Endpoints
Payoff Loan
Allows customers to pay off their entire loan balance in a single transaction.
POST
/
api
/
v1
/
services
/
user
/
payoff-loan
https://{your-domain}.fincode.software/api/v1/services/user/payoff-loan
{
"status": "<string>",
"data": {
"repaymentId": "<string>",
"loanApplicationId": "<string>",
"payoffAmount": 123,
"remainingBalance": 123,
"loanStatus": "<string>",
"transactionReference": "<string>",
"payoffDate": "<string>"
}
}Customers can use this endpoint to settle their loan completely by paying the remaining outstanding balance in one transaction.
https://{your-domain}.fincode.software/api/v1/services/user/payoff-loan
Request Headers
string
required
The JWT Access Token obtained from the
/login or /refresh-token endpoint.string
required
Unique idempotency key for the request to prevent duplicate processing.
string
required
The date and time at which the request was initiated (ISO 8601 format).
string
required
The IP address of the customer making the request.
string
required
Unique identifier for the interaction/session.
string
default:"application/json"
required
Must be
application/json.Request Body
string
required
The unique identifier (UUID) of the loan application to pay off.
string
required
Method of payment. Options:
WALLET, BANK_TRANSFER, CARD, etc.string
Transaction PIN for authorization (if required).
number
Optional payoff amount. If not provided, the system will calculate the full outstanding balance.
Response
Returns confirmation of the loan payoff with final settlement details.string
default:"SUCCESS"
Overall status of the API request.
object
Payoff confirmation details.
Show data object
Show data object
string
Unique identifier for the payoff transaction.
string
Identifier of the loan application.
number
The amount that was paid to settle the loan.
number
default:"0"
Remaining balance after payoff (should be 0).
string
default:"PAID_OFF"
Updated status of the loan (should be
PAID_OFF or COMPLETED).string
Reference number for the payoff transaction.
string
Date and time when the loan was paid off.
Code Examples
curl --location --request POST 'https://{your-domain}.fincode.software/api/v1/services/user/payoff-loan' \
--header 'X-Auth-Token: YOUR_JWT_ACCESS_TOKEN' \
--header 'x-idempotency-key: unique-key-12345' \
--header 'x-fapi-auth-date: 2024-01-15T10:30:00Z' \
--header 'x-fapi-customer-ip-address: 192.168.1.1' \
--header 'x-fapi-interaction-id: interaction-12345' \
--header 'Content-Type: application/json' \
--data '{
"loanApplicationId": "123e4567-e89b-12d3-a456-426614174000",
"paymentMethod": "WALLET",
"transactionPin": "1234"
}'
const axios = require('axios');
const BASE_URL = 'https://{your-domain}.fincode.software/api/v1/services/user';
async function payoffLoan(accessToken, payoffData) {
try {
const response = await axios.post(
`${BASE_URL}/payoff-loan`,
{
loanApplicationId: payoffData.loanApplicationId,
paymentMethod: payoffData.paymentMethod,
transactionPin: payoffData.transactionPin,
payoffAmount: payoffData.payoffAmount,
},
{
headers: {
'X-Auth-Token': accessToken,
'x-idempotency-key': `key-${Date.now()}`,
'x-fapi-auth-date': new Date().toISOString(),
'x-fapi-customer-ip-address': '192.168.1.1',
'x-fapi-interaction-id': `interaction-${Date.now()}`,
'Content-Type': 'application/json',
},
}
);
return response.data.data;
} catch (error) {
console.error(
'Failed to payoff loan:',
error.response?.data || error.message
);
throw error;
}
}
// Usage Example
const accessToken = 'YOUR_JWT_ACCESS_TOKEN';
payoffLoan(accessToken, {
loanApplicationId: '123e4567-e89b-12d3-a456-426614174000',
paymentMethod: 'WALLET',
transactionPin: '1234',
});
