Request
curl -X PUT https://sandbox.api.lendeasy.ai /v1/loanproducts/$PRODUCT_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"fineract": {
"name": "Harbor 18-month personal loan",
"shortName": "HBR18",
"currencyCode": "USD",
"principal": 8400 ,
"numberOfRepayments": 18 ,
"repaymentEvery": 1 ,
"repaymentFrequencyType": 2 ,
"interestRatePerPeriod": 12.75 ,
"interestRateFrequencyType": 3 ,
"amortizationType": 1 ,
"interestType": 0 ,
"interestCalculationPeriodType": 1 ,
"transactionProcessingStrategyCode": "advanced-payment-allocation-strategy",
"loanScheduleType": "PROGRESSIVE",
"isInterestRecalculationEnabled": false ,
"accountingRule": 1 ,
"charges": [
{
"id": 12
}
]
},
"lmsConfig": {
"productClass": "COVERED_CONSUMER",
"aprEnabled": true ,
"aprRounding": "NEAREST_0_01_PERCENT_HALF_UP",
"aprTolerancePolicy": "REGULAR",
"statementEnabled": true ,
"statementLeadDays": 10
}
}' await fetch(`https://sandbox.api.lendeasy.ai /v1/loanproducts/${productId}` , {
method: "PUT" ,
headers: { Authorization: `Bearer ${token}` , "Idempotency-Key" : idempotencyKey, "Content-Type" : "application/json" },
body: JSON.stringify({
"fineract": {
"name": "Harbor 18-month personal loan",
"shortName": "HBR18",
"currencyCode": "USD",
"principal": 8400 ,
"numberOfRepayments": 18 ,
"repaymentEvery": 1 ,
"repaymentFrequencyType": 2 ,
"interestRatePerPeriod": 12.75 ,
"interestRateFrequencyType": 3 ,
"amortizationType": 1 ,
"interestType": 0 ,
"interestCalculationPeriodType": 1 ,
"transactionProcessingStrategyCode": "advanced-payment-allocation-strategy",
"loanScheduleType": "PROGRESSIVE",
"isInterestRecalculationEnabled": false ,
"accountingRule": 1 ,
"charges": [
{
"id": 12
}
]
},
"lmsConfig": {
"productClass": "COVERED_CONSUMER",
"aprEnabled": true ,
"aprRounding": "NEAREST_0_01_PERCENT_HALF_UP",
"aprTolerancePolicy": "REGULAR",
"statementEnabled": true ,
"statementLeadDays": 10
}
}),
});requests.put(
f"https://sandbox.api.lendeasy.ai /v1/loanproducts/{product_id}" ,
headers={"Authorization" : f"Bearer {token}" , "Idempotency-Key" : idempotency_key},
json={
"fineract": {
"name": "Harbor 18-month personal loan",
"shortName": "HBR18",
"currencyCode": "USD",
"principal": 8400 ,
"numberOfRepayments": 18 ,
"repaymentEvery": 1 ,
"repaymentFrequencyType": 2 ,
"interestRatePerPeriod": 12.75 ,
"interestRateFrequencyType": 3 ,
"amortizationType": 1 ,
"interestType": 0 ,
"interestCalculationPeriodType": 1 ,
"transactionProcessingStrategyCode": "advanced-payment-allocation-strategy",
"loanScheduleType": "PROGRESSIVE",
"isInterestRecalculationEnabled": false ,
"accountingRule": 1 ,
"charges": [
{
"id": 12
}
]
},
"lmsConfig": {
"productClass": "COVERED_CONSUMER",
"aprEnabled": true ,
"aprRounding": "NEAREST_0_01_PERCENT_HALF_UP",
"aprTolerancePolicy": "REGULAR",
"statementEnabled": true ,
"statementLeadDays": 10
}
},
)200 400 401 403 404 409
{
"resourceId": 3 ,
"changes": {
"interestRatePerPeriod": 12.75
}
}{
"developerMessage": "Request was understood but rejected; inspect errors for field-level causes.",
"httpStatusCode": "400",
"defaultUserMessage": "The request could not be applied.",
"userMessageGlobalisationCode": "validation.msg.validation.errors.exist",
"errors": []
}{
"developerMessage": "Request was understood but rejected; inspect errors for field-level causes.",
"httpStatusCode": "401",
"defaultUserMessage": "The request could not be applied.",
"userMessageGlobalisationCode": "error.msg.not.authenticated",
"errors": []
}{
"developerMessage": "Request was understood but rejected; inspect errors for field-level causes.",
"httpStatusCode": "403",
"defaultUserMessage": "The request could not be applied.",
"userMessageGlobalisationCode": "error.msg.not.authorized",
"errors": []
}{
"developerMessage": "Request was understood but rejected; inspect errors for field-level causes.",
"httpStatusCode": "404",
"defaultUserMessage": "The request could not be applied.",
"userMessageGlobalisationCode": "error.msg.resource.not.found",
"errors": []
}{
"developerMessage": "Request was understood but rejected; inspect errors for field-level causes.",
"httpStatusCode": "409",
"defaultUserMessage": "The request could not be applied.",
"userMessageGlobalisationCode": "idempotency.request.in.flight",
"errors": []
}