Request
curl -X POST https://sandbox.api.lendeasy.ai /v1/servicing/admin/hardship-policies/$PROGRAM_CODE/versions \
-H "Authorization: Bearer $TOKEN" \
-H "LendEasy-Tenant: $TENANT" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"definition": {
"programCode": "MEDICAL_LEAVE_DEFERRAL_V1",
"displayName": "Medical Leave Deferral",
"hardshipReasonCode": "MEDICAL_LEAVE",
"scope": {
"productClasses": [
"COVERED_CONSUMER"
],
"jurisdictions": [
"US"
],
"currencies": [
"USD"
],
"repaymentFrequencies": [
"MONTHLY"
],
"requiredNativeCapability": "DEFER_SCHEDULED_INSTALLMENTS_TO_MATURITY"
},
"evidence": {
"requiredEvidenceCode": "DOCTORS_MEDICAL_LEAVE_CERTIFICATE",
"acceptedScreeningResults": [
"SCREENING_PASSED",
"VERIFIED"
],
"humanConfirmationAccepted": true
},
"rules": [
{
"key": "EMPLOYMENT_ACTIVE",
"fact": "employmentActive",
"operator": "EQ",
"value": "true",
"onFail": "INELIGIBLE",
"onMissing": "MISSING_INFORMATION",
"operatorExplanation": "The borrower must still be employed; this program defers payments during leave, it does not address job loss.",
"borrowerSafeReason": "EMPLOYMENT_NOT_ACTIVE"
},
{
"key": "LEAVE_DOCUMENTED",
"fact": "certificateState",
"operator": "EQ",
"value": "COMPLETE",
"onFail": "MISSING_INFORMATION",
"onMissing": "MISSING_INFORMATION",
"operatorExplanation": "The workflow must have confirmed a complete doctor certificate before eligibility is evaluated.",
"borrowerSafeReason": "EVIDENCE_INCOMPLETE"
},
{
"key": "DELINQUENCY_WITHIN_GUARDRAIL",
"fact": "daysOverdue",
"operator": "LTE",
"value": "120",
"onFail": "INELIGIBLE",
"onMissing": "PASS",
"operatorExplanation": "Beyond the lender-configured arrears age this program is not the right instrument.",
"borrowerSafeReason": "ARREARS_TOO_OLD"
}
],
"authority": {
"straightThroughMaximum": 3 ,
"humanApprovalMaximum": 6 ,
"humanApprovalPermission": "APPROVE_SERVICING_HARDSHIP_DEFERRAL_UP_TO_6",
"outsideProgramAbove": 6
},
"terms": {
"reliefType": "DEFER_SCHEDULED_INSTALLMENTS_TO_MATURITY",
"minimumDeferredPayments": 1 ,
"maximumDeferredPayments": 6 ,
"principalForgiveness": false ,
"rateChange": false
},
"communication": {
"agreementTemplateCode": "HARDSHIP_MEDICAL_LEAVE_AGREEMENT",
"invitationTemplateCode": "HARDSHIP_CERTIFICATE_REQUEST",
"replacementTemplateCode": "HARDSHIP_CERTIFICATE_REPLACEMENT",
"reminderTemplateCode": "HARDSHIP_CERTIFICATE_REMINDER",
"ineligibilityTemplateCode": "HARDSHIP_NOT_ELIGIBLE",
"language": "en",
"offerValidityHours": 168 ,
"documentDeadlineHours": 168 ,
"reminderAfterHours": 72
},
"workflow": {
"caseType": "HARDSHIP_ASSISTANCE",
"workflowKey": "MEDICAL_LEAVE_HARDSHIP_V1"
}
},
"reason": "Extends the arrears eligibility rule from 90 to 120 days overdue."
}' await fetch(`https://sandbox.api.lendeasy.ai /v1/servicing/admin/hardship-policies/${programCode}/versions` , {
method: "POST" ,
headers: { Authorization: `Bearer ${token}` , "LendEasy-Tenant" : tenant, "Idempotency-Key" : idempotencyKey, "Content-Type" : "application/json" },
body: JSON.stringify({
"definition": {
"programCode": "MEDICAL_LEAVE_DEFERRAL_V1",
"displayName": "Medical Leave Deferral",
"hardshipReasonCode": "MEDICAL_LEAVE",
"scope": {
"productClasses": [
"COVERED_CONSUMER"
],
"jurisdictions": [
"US"
],
"currencies": [
"USD"
],
"repaymentFrequencies": [
"MONTHLY"
],
"requiredNativeCapability": "DEFER_SCHEDULED_INSTALLMENTS_TO_MATURITY"
},
"evidence": {
"requiredEvidenceCode": "DOCTORS_MEDICAL_LEAVE_CERTIFICATE",
"acceptedScreeningResults": [
"SCREENING_PASSED",
"VERIFIED"
],
"humanConfirmationAccepted": true
},
"rules": [
{
"key": "EMPLOYMENT_ACTIVE",
"fact": "employmentActive",
"operator": "EQ",
"value": "true",
"onFail": "INELIGIBLE",
"onMissing": "MISSING_INFORMATION",
"operatorExplanation": "The borrower must still be employed; this program defers payments during leave, it does not address job loss.",
"borrowerSafeReason": "EMPLOYMENT_NOT_ACTIVE"
},
{
"key": "LEAVE_DOCUMENTED",
"fact": "certificateState",
"operator": "EQ",
"value": "COMPLETE",
"onFail": "MISSING_INFORMATION",
"onMissing": "MISSING_INFORMATION",
"operatorExplanation": "The workflow must have confirmed a complete doctor certificate before eligibility is evaluated.",
"borrowerSafeReason": "EVIDENCE_INCOMPLETE"
},
{
"key": "DELINQUENCY_WITHIN_GUARDRAIL",
"fact": "daysOverdue",
"operator": "LTE",
"value": "120",
"onFail": "INELIGIBLE",
"onMissing": "PASS",
"operatorExplanation": "Beyond the lender-configured arrears age this program is not the right instrument.",
"borrowerSafeReason": "ARREARS_TOO_OLD"
}
],
"authority": {
"straightThroughMaximum": 3 ,
"humanApprovalMaximum": 6 ,
"humanApprovalPermission": "APPROVE_SERVICING_HARDSHIP_DEFERRAL_UP_TO_6",
"outsideProgramAbove": 6
},
"terms": {
"reliefType": "DEFER_SCHEDULED_INSTALLMENTS_TO_MATURITY",
"minimumDeferredPayments": 1 ,
"maximumDeferredPayments": 6 ,
"principalForgiveness": false ,
"rateChange": false
},
"communication": {
"agreementTemplateCode": "HARDSHIP_MEDICAL_LEAVE_AGREEMENT",
"invitationTemplateCode": "HARDSHIP_CERTIFICATE_REQUEST",
"replacementTemplateCode": "HARDSHIP_CERTIFICATE_REPLACEMENT",
"reminderTemplateCode": "HARDSHIP_CERTIFICATE_REMINDER",
"ineligibilityTemplateCode": "HARDSHIP_NOT_ELIGIBLE",
"language": "en",
"offerValidityHours": 168 ,
"documentDeadlineHours": 168 ,
"reminderAfterHours": 72
},
"workflow": {
"caseType": "HARDSHIP_ASSISTANCE",
"workflowKey": "MEDICAL_LEAVE_HARDSHIP_V1"
}
},
"reason": "Extends the arrears eligibility rule from 90 to 120 days overdue."
}),
});requests.post(
f"https://sandbox.api.lendeasy.ai /v1/servicing/admin/hardship-policies/{program_code}/versions" ,
headers={"Authorization" : f"Bearer {token}" , "LendEasy-Tenant" : tenant, "Idempotency-Key" : idempotency_key},
json={
"definition": {
"programCode": "MEDICAL_LEAVE_DEFERRAL_V1",
"displayName": "Medical Leave Deferral",
"hardshipReasonCode": "MEDICAL_LEAVE",
"scope": {
"productClasses": [
"COVERED_CONSUMER"
],
"jurisdictions": [
"US"
],
"currencies": [
"USD"
],
"repaymentFrequencies": [
"MONTHLY"
],
"requiredNativeCapability": "DEFER_SCHEDULED_INSTALLMENTS_TO_MATURITY"
},
"evidence": {
"requiredEvidenceCode": "DOCTORS_MEDICAL_LEAVE_CERTIFICATE",
"acceptedScreeningResults": [
"SCREENING_PASSED",
"VERIFIED"
],
"humanConfirmationAccepted": true
},
"rules": [
{
"key": "EMPLOYMENT_ACTIVE",
"fact": "employmentActive",
"operator": "EQ",
"value": "true",
"onFail": "INELIGIBLE",
"onMissing": "MISSING_INFORMATION",
"operatorExplanation": "The borrower must still be employed; this program defers payments during leave, it does not address job loss.",
"borrowerSafeReason": "EMPLOYMENT_NOT_ACTIVE"
},
{
"key": "LEAVE_DOCUMENTED",
"fact": "certificateState",
"operator": "EQ",
"value": "COMPLETE",
"onFail": "MISSING_INFORMATION",
"onMissing": "MISSING_INFORMATION",
"operatorExplanation": "The workflow must have confirmed a complete doctor certificate before eligibility is evaluated.",
"borrowerSafeReason": "EVIDENCE_INCOMPLETE"
},
{
"key": "DELINQUENCY_WITHIN_GUARDRAIL",
"fact": "daysOverdue",
"operator": "LTE",
"value": "120",
"onFail": "INELIGIBLE",
"onMissing": "PASS",
"operatorExplanation": "Beyond the lender-configured arrears age this program is not the right instrument.",
"borrowerSafeReason": "ARREARS_TOO_OLD"
}
],
"authority": {
"straightThroughMaximum": 3 ,
"humanApprovalMaximum": 6 ,
"humanApprovalPermission": "APPROVE_SERVICING_HARDSHIP_DEFERRAL_UP_TO_6",
"outsideProgramAbove": 6
},
"terms": {
"reliefType": "DEFER_SCHEDULED_INSTALLMENTS_TO_MATURITY",
"minimumDeferredPayments": 1 ,
"maximumDeferredPayments": 6 ,
"principalForgiveness": false ,
"rateChange": false
},
"communication": {
"agreementTemplateCode": "HARDSHIP_MEDICAL_LEAVE_AGREEMENT",
"invitationTemplateCode": "HARDSHIP_CERTIFICATE_REQUEST",
"replacementTemplateCode": "HARDSHIP_CERTIFICATE_REPLACEMENT",
"reminderTemplateCode": "HARDSHIP_CERTIFICATE_REMINDER",
"ineligibilityTemplateCode": "HARDSHIP_NOT_ELIGIBLE",
"language": "en",
"offerValidityHours": 168 ,
"documentDeadlineHours": 168 ,
"reminderAfterHours": 72
},
"workflow": {
"caseType": "HARDSHIP_ASSISTANCE",
"workflowKey": "MEDICAL_LEAVE_HARDSHIP_V1"
}
},
"reason": "Extends the arrears eligibility rule from 90 to 120 days overdue."
},
)200 400 401 403 404 409
{
"resourceId": 9302 ,
"changes": {
"programVersionId": 9302 ,
"operation": "DRAFT"
}
}{
"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": []
}