Convert an Application to a CL Contract
Description
This web service converts an application in CL Originate to a contract in CL Loan. For detailed information about the configuration and setup of this feature, refer to the Conversion Setup section of this guide.
Definition
POST https://<domain>/services/apexrest/genesis/v2/applications/convertToContract/<applicationId>
Request Parameters
The following table provides details of the request parameters used by this web service:
Field | Type | Description |
---|---|---|
applicationId | String | This is the Salesforce record Id of the application which we want to convert to a contract. This should be provided in the URL. https://<domain>/services/apexrest/genesis/v2/applications/convertToContract/a39F00000006QOW |
Error Messages
When you use this web service you can receive the possible error messages as shown in the following table:
Error Number | Error Code | Error Message | System.Lable | Reason | HTTP Status Code |
---|---|---|---|---|---|
00032 | INVALID_INPUT | Unable to find application. | APPLICATION_NOT_FOUND | There is no valid record for applicationId passed in the URL. | 400 |
00032 | INVALID_INPUT | Application Id is null. | APPLICATION_ID_NULL | The applicationId parameter is null. | 400 |
00054 | INVALID_INPUT | Contract Object Name is not the same for all conversion mappings for <application_product_type> type. | <NA> | “Contract Object Name” in the conversion mappings for the application’s product type is not the same. | 400 |
00050 | INVALID_INPUT | 'Application or Contract field name cannot blank. | <NA> | “Application Field Name” and/or “Contract Field Name in one of the conversion mappings for the application’s product type is not provided. | 400 |
00044 | INVALID_INPUT | All child object’s mapping for type Disbursal Distribution should be from the same object. | <NA> | For child relation type “Disbursal Distribution” the child object of application and/or contract is not the same for the conversion mappings. | 400 |
00052 | INVALID_INPUT | For Other' child relation type when no fields are provided child object names should be the same. | <NA> | For Type 1 child object mapping, “Application Field Name” and “Contract Field Name”, i.e., the child object is not the same. | 400 |
00048 | INVALID_INPUT | Required field <fieldName> cannot be null Or Required field <fieldName> of <childObjectName> cannot be null. | <NA> | <fieldName> is marked as “Required for conversion” in conversion mapping, however the value is not present for the application. <fieldName> can be a field of application or a field of child object. | 400 |
00047 | INVALID_INPUT | Conversion Mapping is not present. | <NA> | Conversion Mappings are not provided. | 400 |
00007 | API_EXCEPTION | <Exception_message> | <NA> | An exception has occurred while converting an application to a contract. | 500 |
00045 | INVALID_INPUT | No object found with name <objectName>. | <NA> | There is no valid child object of application with the name <objectName>. | 400 |
00053 | INVALID_INPUT | Contract Object Name <Contract Object Name> not found. | <NA> | Contract Object Name specified in the conversion mappings for the application’s product. | 400 |
00051 | INVALID_INPUT | Contract child object <objectName>j not found. | <NA> | There is no valid child object of application with the name <objectName>. | 400 |
00049 | INVALID_INPUT | Cannot instantiate the provided implementation : <className>. | <NA> | The <className> provided in a custom setting named custom logic parameter’s “Custom Contract Generation Class” is not valid and hence not able to instantiate the same. | 400 |
00046 | INVALID_INPUT | Implementation for saving contract is not provided. | <NA> | Custom setting named custom logic parameter’s “Custom Contract Generation Class” is not populated with a valid class. For converting an Application to a CL Contract in CL Loan, the valid class name is loan.ContractProcessor. | 400 |
Sample Request
The sample request to be sent is as shown below:
Sample Response
{
"status": "SUCCESS",
"rowNumber": null,
"response": [],
"errorNumber": null,
"errorMessage": null,
"errorCode": "NO_ERROR",
"content": [
{
"attributes": {
"type": "Loan_Account__c",
"url": "/services/data/v36.0/sobjects/Loan_Account__c/a4015000000uOgSAAU"
},
"Id": "a4015000000uOgSAAU",
"Name": "LAI-00094877",
"Contact__c": "0031500001ZtFhzAAF",
"Investment_Product_loan__c": false,
"Actual_Interest_Only_Payments__c": false,
"Principal_Paid__c": 0,
"Interest_Paid__c": 0,
"Principal_Interest_EMI_Generated_On_Req__c": false,
"Recalculate_Interest_Flag__c": false,
"Fees_Paid__c": 0,
"Invalid_Data__c": false,
"Last_Accrual_Date__c": "2016-02-24",
"Payoff_Fee_Indicator__c": false,
"Excess__c": 0,
"Fee_Set__c": "a3P15000000TpgyEAC",
"Expected_Disbursal_Date__c": "2016-02-24",
"Next_Installment_Date__c": "2016-03-24",
"Due_Day__c": 24,
"Disbursal_Date__c": "2016-02-24",
"Index_Rate__c": 0,
"Margin_Rate__c": 0,
"Pre_Bill_Days__c": 0,
"Expected_Repayment_Start_Date__c": "2016-03-24",
"Repayment_Procedure__c": "Equal Monthly Installments",
"Loan_Status__c": "Active - Good Standing",
"Term_Cur__c": 12,
"Maturity_Date_Current__c": "2017-02-24",
"Number_of_Installments__c": 12,
"Frequency_of_Loan_Payment__c": "Monthly",
"Principal_Remaining__c": 10200,
"Principal_Adjustment__c": 0,
"First_Installment_Date__c": "2016-03-24",
"Remaining_Loan_Amount__c": 0,
"Principal_Adjustment_Subtract__c": 0,
"Interest_Rate__c": 10,
"Interest_Calculation_Method__c": "Declining Balance",
"Interest_Remaining__c": 0,
"Interest_estimated__c": 556.82,
"Interest_Waived__c": 0,
"Interest_Only_Period__c": 0,
"Balloon_Payment__c": 0,
"Loan_Amount__c": 10200,
"Loan_Product_Name__c": "a4E15000000TiBREA0",
"Metro2_Account_highest_bal_amount__c": 10200,
"Time_Counting_Method__c": "Actual Days",
"Total_Amount_Overdue__c": 0,
"Branch__c": "a4Y15000000UveSEAS",
"Accrual_Stop_Indicator__c": false,
"Payment_Amount__c": 896.4,
"Pmt_Amt_Cur__c": 896.4,
"APR__c": 0,
"Last_Transaction_Timestamp__c": "2016-02-24T11:12:49.000+0000",
"Last_Transaction_Type__c": "Disbursal Transaction",
"Pay_Off_Amount_As_Of_Today__c": 10200,
"Total_Due_Charges__c": 0,
"Interest_Accrued_Not_Due__c": 0,
"Fees_Remaining__c": 0,
"Accrual_Start_Days__c": 0,
"Next_Due_Generation_Date__c": "2016-03-24",
"Write_off_Tolerance_Amount__c": 0,
"Reserve_Amount_for_Next_Due__c": 0,
"Delinquency_Grace_Days__c": 0,
"Delinquent_Amount__c": 0,
"Last_Payment_Amount__c": 0,
"Rate_Change_Dt_Last__c": "2016-02-24",
"Rate_Change_Dt_Next__c": "3000-12-31",
"Interest_Rate_Last__c": 10,
"Accrual_Start_Date__c": "2016-02-24",
"Repayments_Count__c": 0,
"Product_Type__c": "Loan",
"Credit_Limit_Current__c": 0,
"Minimum_Draw_Amount__c": 0,
"Maximum_Draw_Amount__c": 0,
"Draw_Billing_Method__c": "Interest Only",
"Draw_Term_Payment_Percent__c": 0,
"Minimum_Due_Amount_On_Billing__c": 0,
"Repayment_Billing_Method__c": "Principal Plus Interest",
"Repayment_Term_Payment_Percent__c": 0,
"Cleared_Disbursal_Txn_Count__c": 1,
"Contractual_Interest_Rate__c": 10,
"Pre_Paid_Interest_Amount__c": 0,
"Funding_in_Tranches__c": false,
"Repayment_Start_Basis__c": "Full Disbursal",
"Amortization_Schedule_Generated__c": true,
"Draw_Period_End_Date__c": "2016-02-24",
"Disbursal_Status__c": "Fully Disbursed",
"Disbursal_Amount__c": 10000,
"Total_Amount_Paid__c": 0,
"Disbursed_Amount__c": 10000,
"Last_Disbursal_Amount__c": 10200,
"ACH_On__c": false,
"Change_Recurring_ACH_Terms__c": false,
"Last_Disbursal_Date__c": "2016-02-24",
"Is_Rescheduled__c": false,
"Protect_Enabled__c": false,
"Protect_fee_amount__c": 0,
"la_delinquency_flag__c": false,
"Pre_Paid_Fee__r": {
"totalSize": 1,
"done": true,
"records": [
{
"attributes": {
"type": "Contract_Pre_Paid_Fee__c",
"url": "/services/data/v36.0/sobjects/Contract_Pre_Paid_Fee__c/a3015000000WJZSAA4"
},
"Contract__c": "a4015000000uOgSAAU",
"Id": "a3015000000WJZSAA4",
"Name": "CPP-00000924",
"Amortize_Balance__c": "None",
"Amount__c": 200,
"Loan_Disbursal_Transaction__c": "a4415000000ThQIAA0",
"Fee_Type__c": "a3Q15000000PeV1EAK",
"Add_Fee_to_Loan_Amount__c": true,
"Fee_Type__r": {
"attributes": {
"type": "Fee__c",
"url": "/services/data/v36.0/sobjects/Fee__c/a3Q15000000PeV1EAK"
},
"Id": "a3Q15000000PeV1EAK",
"Name": "test"
}
}
]
},
"Disbursement_Schedule__r": {
"totalSize": 1,
"done": true,
"records": [
{
"attributes": {
"type": "Disbursement_Schedule__c",
"url": "/services/data/v36.0/sobjects/Disbursement_Schedule__c/a3E15000000UwI6EAK"
},
"Loan_Account__c": "a4015000000uOgSAAU",
"Id": "a3E15000000UwI6EAK",
"Name": "DSID-0000000173",
"Bank_Account__c": "a2S15000000Q6DBEA0",
"Name_of_Entity__c": "LAI-00094877",
"Reference__c": "LAI-00094877",
"Split_Calculation_Basis__c": "Amount",
"Prorate_Amount__c": "Yes",
"Active__c": true,
"Value__c": 1000,
"Disbursal_Status__c": "Fully Disbursed",
"Amount_Disbursed__c": 1000
}
]
},
"Repayment_Schedule_Summary__r": {
"totalSize": 1,
"done": true,
"records": [
{
"attributes": {
"type": "Repayment_Schedule_Summary__c",
"url": "/services/data/v36.0/sobjects/Repayment_Schedule_Summary__c/a5215000000TSUTAA4"
},
"RSS_Loan_Account__c": "a4015000000uOgSAAU",
"Id": "a5215000000TSUTAA4",
"Name": "RSS-0000009731",
"RSS_ID__c": "0",
"RSS_No_Of_Pmts__c": 12,
"RSS_Primary_flag__c": true,
"RSS_Repayment_Amt__c": 896.4017393700069,
"RSS_Repayment_Dt__c": "2016-03-24",
"RSS_Seq__c": 1
}
]
},
"Loan_Disbursal_Transactions__r": {
"totalSize": 1,
"done": true,
"records": [
{
"attributes": {
"type": "Loan_Disbursal_Transaction__c",
"url": "/services/data/v36.0/sobjects/Loan_Disbursal_Transaction__c/a4415000000ThQIAA0"
},
"Loan_Account__c": "a4015000000uOgSAAU",
"Id": "a4415000000ThQIAA0",
"Name": "LDTI-0000037985",
"Cleared_Reversal_Txn_Count__c": 0,
"Cleared__c": true,
"Custom_Logic__c": false,
"Disbursal_Date__c": "2016-02-24",
"Disbursed_Amt__c": 10200,
"Financed_Amount__c": 10000,
"Internal_Accounting_Generated__c": false,
"Mode_of_Payment__c": "a4j15000000Ta2xAAC",
"Number_Of_Interest_Only_Payments__c": 0,
"Pre_Paid_Fee__c": 200,
"Receipt_ID__c": "RID-0000037986",
"Refinanced_Amount__c": 0,
"Rejected__c": false,
"Reversed__c": false,
"Sent_To_ACH__c": false
}
]
},
"Contact__r": {
"attributes": {
"type": "Contact",
"url": "/services/data/v36.0/sobjects/Contact/0031500001ZtFhzAAF"
},
"Id": "0031500001ZtFhzAAF",
"Name": "Tim Barr"
},
"Loan_Product_Name__r": {
"attributes": {
"type": "Loan_Product__c",
"url": "/services/data/v36.0/sobjects/Loan_Product__c/a4E15000000TiBREA0"
},
"Id": "a4E15000000TiBREA0",
"Name": "CL Loan Lending Product"
}
}
]
}