0% found this document useful (0 votes)
107 views6 pages

Erin Loan Repayment API

The document describes two Erin API endpoints: 1) An authentication API that provides a bearer token with 8 hour validity for authorization. 2) A loan repayments API used to update repayment records, requiring the bearer token. It accepts loan details like account, amount, date in the request body and returns a success or failure response.

Uploaded by

Mashfiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views6 pages

Erin Loan Repayment API

The document describes two Erin API endpoints: 1) An authentication API that provides a bearer token with 8 hour validity for authorization. 2) A loan repayments API used to update repayment records, requiring the bearer token. It accepts loan details like account, amount, date in the request body and returns a success or failure response.

Uploaded by

Mashfiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Erin API Document

AVAILABLE API CALLS

1) Authorization API

2) Loan Repayments API

DESCRIPTION OF APIS:-
1) Authentication api will provide a bearer token. This token validity will be 8 hours.

2) Loan Repayments Api used to update the records in emi tables.

1) Get the Authorization Token


Content Type: Application/Json
Request Headers : None

UAT URL: https://devtest.cashealliance.com/callback/authenticate

Query Name Type Length Description


Parameters
username String N/A user name

password String N/A password

PARAMETER VALUES

username = dhakabank

password= $2a$10$zXhzPOz1QJBFSgd1j4xBOebRj21VGBN4dk3JybtImbZ25p.aRIFgG

SAMPLE REQUEST

https://devtest.cashealliance.com/callback/authenticate?username=dhakabank&password=$2a$10
$zXhzPOz1QJBFSgd1j4xBOebRj21VGBN4dk3JybtImbZ25p.aRIFgG
RESPONSE:

SAMPLE SUCCESS RESPONSE:-

"access_token": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiO


iJzaW5nZXItZmluYW5jZS1zZWN1cmUtYXBpIiwiYXVkIjoic2luZ2VyLWZpbmFuY2Utc2Vjd
XJlLWFwcCIsInN1YiI6InNpbmdlcl9maW5hbmNlIiwiZXhwIjoxNTg3MzczOTM0LCJyb2wiO
iJST0xFX1BBUlRORVIifQ.j6rLfhjV2jwNswRrDqpGT1FUZrQdE4QDTBBikWZhV0Enl4mrFu
E0XXXXXXXXXXXXXXXXXXXX",

"status": 200

SAMPLE ERROR RESPONSE:

"entity": "Invalid credentials!!",

"status": 403

2) Update Repayment Details

UAT URL: https://devtest.cashealliance.com/callback/loan/loanRepayments


Authorization : bearer access token (generated from /authenticate API)

Parameter Data Type Description Sample Values


loanAccountNumber String Indicates loan Account Number 2081801220411017
loanStatusId String Indicates loan Status Id 4/8/6
paymentAmount BigDecimal Indicates instalment paid amount 4736.84
paymentDate String Indicates payment date 08/05/2022 00:00:00
paymentReferenceNumber String Indicates payment reference paid1234****
Number
paymentStatus String Indicates Payment status PAID
totalDueAmount BigDecimal Indicates Total due amount 9368.16

emiDetails
loanInstallmentNumber Integer Indicates loan period number 1
installmentAmount BigDecimal Indicates instillment amount 4736.84
dueAmount BigDecimal Indicates due amount in emi 9368.16
installmentDueDate String Indicates payment due date 08/05/2022 00:00:00
installmentDueAmount BigDecimal Indicates installment due amount null
installmentPaymentStatusID Integer Indicates installment loan status 4/8/6
penaltyAmountAccumulated BigDecimal Indicates penalty initial amount null
penaltyAmountPaid BigDecimal Indicates penalty paid amount null

Mandatory point in loanStatusId:-

• After Credit Approved at EOD initial status should be “4” for Customers.
• If customer is paid partial amount/installment amount the status should be “8”.
• After completion of last amount settlement customer total due amount should be “0.00” then
you have to pass loanStatusId “6” in request

Loan Status Id Details


4 Loan disbursement is complete and loan is active. No repayment done
8 Loan is partially repaid
6 Loan is completely repaid

Request Body:

{
"loanAccountNumber":"2081801220411017",
"loanStatusId":"8",
"paymentAmount":4736.84,
"paymentDate":"08/05/2022 00:00:00",
"paymentReferenceNumber":"paid1234",
"paymentStatus":"PAID",
"totalDueAmount":9368.16,
"emiDetails":[
{
"loanInstallmentNumber":1,
"installmentAmount":4736.84,
"dueAmount":9368.16,
"installmentDueDate":"08/05/2022 00:00:00",
"installmentDueAmount":null,
"installmentPaymentStatusID":6,
"penaltyAmountAccumulated":null,
"penaltyAmountPaid":null

},
{
"loanInstallmentNumber":2,
"installmentAmount":4736.84,
"dueAmount":4701.58,
"installmentDueDate":"08/06/2022 00:00:00"
"installmentDueAmount":null,
"installmentPaymentStatusID":4,
"penaltyAmountAccumulated":null,
"penaltyAmountPaid":null

},
{
"loanInstallmentNumber":3,
"installmentAmount":4736.84,
"dueAmount":0.00,
"installmentDueDate":"08/07/2022 00:00:00"
"installmentDueAmount":null,
"installmentPaymentStatusID":4,
"penaltyAmountAccumulated":null,
"penaltyAmountPaid":null

}
]
}

Mandatory points in emiDetails List:-

• If customer doesn’t have any installmentDueAmount, penaltyAmountAccumulated,


penaltyAmountPaid amounts Please send “null” value in these fields.
• ("installmentPaymentStatusID”: 4/8/6)

• After credit approved installmentPaymentStatusID should be “4”.


• If customer is paid partial installment amount the installementStatus should be “8”.
• If customer is paid full Installment amount within date the installementStatus should be “6”.

Installment Status Id Details


4 installment is active and unpaid
8 installment partially paid
6 Installment completely paid
Success Response Body:

"statusType": "OK",
"entity": "Repayment details update successfully in the system",
"entityType": "java.lang.String",
"metadata": {},
"status": 200
}

Failure Response Body :-

{
"statusType": "UNAUTHORIZED",
"entity": "Invalid Token",
"entityType": "java.lang.String",
"metadata": {},
"status": 401
}

You might also like