FTOS_CB_AddUpdateContract
Adds or updates a record in the FTOS_CB_Contract entity representing a customer's contract. The set of parameters sent via the request body determines the operation performed at the database level.
Syntax
The FTOS_CB_AddUpdateContract custom endpoint is called from within the callAction endpoint. Visit the callAction page for more details.
POST <host_address>/api/openApi/CallAction
Content-Type: application/json
{
"Request":{
"ActionName":"FTOS_CB_AddUpdateContract",
"Data": "{
"ContractInfo":
{"contractId":"<contract_id>",
"customerNo":"<customer_number>",
"productCode":"<banking_product_code>",
"startDate":"<contract_start_date>",
"totalInterestRate":"<total_interest_rate>",
"firstDueDate":"<first_due_date>",
"maturityDate":"<contract_maturity_date>"
}
}",
"ApiInfo":{
"UserName":"<user_name>",
"Token":"<access_token>"
}
}
Here's a list of the available parameters:
| Parameter | Description |
|---|---|
| host_address | URL of the High Productivity Fintech Infrastructure server. |
| access_token | Access token used to connect to the API endpoint. For details, see GetToken. |
| user_name | The username of an existing user account on the High Productivity Fintech Infrastructure, previously used to get the access token. |
| Data | Key-value pairs of any input parameters to be passed to the internal endpoint in JSON format. Double quotes that enclose string parameter values must be escaped with backslash characters, eg.: \"string value\". |
| contractNo | The number of the contract. If you fill and send this parameter, the existing contract is updated. |
| contractId | The identifier of the contract. If you fill and send this parameter, the existing contract is updated. |
| customerNo | Mandatory. The number of the customer, customerNo in the Account entity. |
| productCode | The code of the banking product. |
| startDate | Mandatory. The start date of the contract. |
| totalInterestRate | Mandatory. The total interest rate of the contract. |
| firstDueDate | Mandatory when productType = Term Loan or Mortgage or Overdraft, and if installmentDay and contractPeriod are not sent within the request. The first due date of the contract's repayment schedule. If you select the Due Day, then this field is automatically completed as calculated based on the information within the Due Date, Periodicity Type and Installment Method, and it is not editable. |
| maturityDate | Mandatory only when productType = Term Loan or Mortgage or Overdraft, and if installmentDay and contractPeriod are not sent within the request. The contract's maturity date. |
| bankAccountNo | Mandatory only when productType = Term Loan or Mortgage or Overdraft. The bank account number specified in the contract. |
| amountDue | Mandatory only when productType = Term Loan or Mortgage or Overdraft. The contract's due amount. |
| productInterest | Mandatory only when productType = Term Loan or Mortgage or Overdraft. The banking product's interest rate. |
| referenceRateDate | Mandatory only when interestType = Variable. The interest's reference rate date. |
| referenceRate | Mandatory only when interestType = Variable. The interest's reference rate. |
| margin | Mandatory only when interestType = Variable. The interest's margin. |
| paymentScheduleType | Mandatory only when productType = Term Loan or Mortgage or Overdraft. The contract's repayment schedule type. |
| periodicityType | Mandatory only when productType = Term Loan or Mortgage or Overdraft. The contract's schedule periodicity type. |
| contractPeriod | Mandatory only when productType = Term Loan or Mortgage or Overdraft. The contract period. |
| installmentDay | Mandatory only when productType = Term Loan or Mortgage or Overdraft. The installment day specified in the repayment schedule. |
| installmentMethod | Mandatory only when productType = Term Loan or Mortgage or Overdraft. The installment method specified in the repayment schedule. |
| tenor | Mandatory only when productType = Term Loan or Mortgage or Overdraft, and if installmentDay and contractPeriod are not sent within the request. The length of time remaining before the contract expires. |
| managingBranch | The branch of the bank which manages the contract. |
| destinationBankAccount | The destination bank account number. |
| reviewInterestDate | The date when the interest should be reviewed. This date must be between Activation Date and Maturity Date, otherwise, an error is displayed. |
| maxDisburseDate | The maximum disbursement date for the money. |
| startDateForUnusage | The date when the unused amount starts to be calculated. |
| unusageCommissionPercent | The percent of the commission applicable for unused amount. |
| principalGracePeriod | The principal's grace period. |
| interestGracePeriod | The interest's grace period. |
| minInterestRate | The minimum interest rate applicable for the contract. |
| overdraftLimitAmount | Mandatory only when productType = Bank Account and allowOverdraft = True. The overdraft limit amount of the contract. The minimum value can be 0. |
| expireDateForOverdraft | Mandatory only when productType = Bank Account and allowOverdraft = True. The expiration date of the overdraft functionality for the current account. |
| overdraftReviewInterestDate | Optional, for contracts with productType = Bank Account and allowOverdraft = True, if overdraftLimitAmount >0. The date for reviewing the overdraft interest rate. |
| overdraftInterest | Mandatory only when productType = Bank Account and allowOverdraft = True. The interest applicable to the overdraft amount of the contract. |
| overdraftTotalInterestRate | Mandatory only when productType = Bank Account and allowOverdraft = True. The total interest rate applicable to the overdraft amount of the contract. |
| overdraftMargin | Mandatory only when productType = Bank Account and allowOverdraft = True and InterestTypeId = Variable. The margin of the overdraft. |
| overdraftReferenceRateDate | Mandatory only when productType = Bank Account and allowOverdraft = True and InterestTypeId = Variable. The date of the overdraft reference rate. |
| overdraftReferenceRate | Mandatory only when productType = Bank Account and allowOverdraft = True and InterestTypeId = Variable. The reference rate of the overdraft. |
| startDateForUnusage | Mandatory only when productType = Bank Account and allowOverdraft = True. The date when the unused amount from the overdraft starts to accumulate penalty interest. |
| advanceAmountValue | The advance amount value for a loan contract. If the advance amount is not sent within the request, then at the contract level the advance value is taken from the Minimum Advance field at the banking product level. This parameter is available starting with Core Banking version 21.1.1001. |
| advanceAmountPercentage | The advance percentage for a loan contract. If the advance percentage is not sent within the request, then at the contract level the advance value is taken from the Minimum Advance field at the banking product level. This parameter is available starting with Core Banking version 21.1.1001. |
| autoDisbursement | A boolean value that specifies whether a contract is with automatic disbursement (for True value) or not (for False value). Not mandatory, used for productType = Term Loan or Mortgage or Overdraft. If you don't send a value for this parameter via the request, its value is taken from the contract's banking product level, using the product's autoDisbursement attribute. The parameter's value is automatically set to True for contracts with advanceAmountValue or advanceAmountPercentage >0, regardless of the value you send via the request.This parameter is available starting with Core Banking version 3.1. |
| interestCommissionItem | It represents the interests & commissions item's name attached to the banking product within the Dimensions tab's > Interests & Commissions section. Mandatory if the banking product has more than one such item. This parameter is available starting with Core Banking version 3.1. |
| isCloseAutomatic | A boolean value that specifies whether a contract is with automatic closure or not. This can only be used for contracts based on banking products with closingFlexible - Tue.This parameter is available starting with Core Banking version 3.2. |
| isCloseRealTime | A boolean value that specifies whether a contract should be closed in real-time or not. This can only be used for contracts based on banking products with closingFlexible - Tue.This parameter is available starting with Core Banking version 3.2. |
| bufferDays | The number of days set up as buffer to close the contract. This can only be used for contracts based on banking products with closingFlexible - Tue.This parameter is available starting with Core Banking version 3.2. |
| isManualValue | Not mandatory, used for productType = Term Loan. A boolean value that specifies whether the values are manually entered for royalty or principal, thus overriding the values automatically calculated by Core Banking (for True value) or not (for False value). If the parameter is not sent or sent without value, its value is set to False by default.If isManualValue = True, installmentValue or principalValue must have a value >0, but not greater than the loan amount. If isManualValue = False, don't send any value for installmentValue or principalValue.This parameter is available starting with Core Banking version 3.3. |
Response
The response indicates the result of the code execution, specifically the result of creating or updating a record in the FTOS_CB_Contract entity. If the record is created or updated successfully, the contract number and id are returned.
Example
To create a new record, do not fill or send the contractNo parameter. Also, the value of contractId parameter should not exist in the system as internalId.
If the contractNo is specified or contractId already exists in the system, the existing record is updated.
Request
POST https://FintechOSStudio/api/openApi/CallAction
Content-Type: application/json
{
"Request":{
"ActionName":"FTOS_CB_AddUpdateContract",
"Data": "{
"ContractInfo":
{"contractId":"SomeInternID",
"customerNo":"136",
"productCode":"CA USD",
"startDate":"2021-04-28",
"totalInterestRate":"7",
"firstDueDate":"2021-05-15",
"maturityDate":"2023-12-31"
}
}"
},
"ApiInfo":{
"UserName":"host",
"Token":"5b445502-f776-4e11-8b9b-8562b23b01aa"
}
}
Response
{
"UIResult": {
"NavigateToEntityPage": false,
"NavigateToEntityPageOnEdit": false,
"NavigateToEntityFormName": null,
"NavigateToEntityName": null,
"NavigateToEntityId": null,
"NavigateToEntityInsertDefaults": null,
"NavigateToUrl": null,
"DownloadFile": null,
"ReloadPage": false,
"Message": null,
"IsSuccess": false,
"Data": "{"contractIdentifier":{"name":"3249","id":"5b1ebd64-6deb-4b9d-946c-e850386d9c70"}}",
"NavigateToPageNo": null
},
"Message": null,
"IsSuccess": true,
"ClientScript": null,
"Serialized": null,
"ErrorCode": 0
}
To create a new record, do not fill or send the contractNo parameter. Also, the value of contractId parameter should not exist in the system as internalId.
If the contractNo is specified or contractId already exists in the system, the existing record is updated.
Request
POST https://FintechOSStudio/api/openApi/CallAction
Content-Type: application/json
{
"Request":{
"ActionName":"FTOS_CB_AddUpdateContract",
"Data": "{
"ContractInfo": {
"contractNo": "",
"customerNo": "191",
"productCode": "AG_OVD",
"startDate": "2021-07-22",
"totalInterestRate": "1",
"firstDueDate": "2021-08-09",
"maturityDate": "2022-07-22",
"advanceAmountPercentage": "",
"overdraftLimitAmount": "1000",
"expireDateForOverdraft": "2022-01-01",
"overdraftInterest": "Overdraft Floating BIBOR 6M",
"overdraftReviewInterestDate": "",
"overdraftMargin": "100",
"overdraftReferenceRateDate": "2021-08-01",
"overdraftReferenceRate": "3.2",
"overdraftTotalInterestRate": "5",
"startDateForUnusage": "2021-08-22"
}
}"
},
"ApiInfo":{
"UserName":"host",
"Token":"5b445502-f776-4e11-8b9b-8562b23b01aa"
}
}
Response
{
"UIResult": {
"NavigateToEntityPage": false,
"NavigateToEntityPageOnEdit": false,
"NavigateToEntityFormName": null,
"NavigateToEntityName": null,
"NavigateToEntityId": null,
"NavigateToEntityInsertDefaults": null,
"NavigateToUrl": null,
"DownloadFile": null,
"ReloadPage": false,
"Message": null,
"IsSuccess": false,
"Data": "{"contractIdentifier":{"name":"3249","id":"5b1ebd64-6deb-4b9d-946c-e850386d9c70"}}",
"NavigateToPageNo": null
},
"Message": null,
"IsSuccess": true,
"ClientScript": null,
"Serialized": null,
"ErrorCode": 0
}
To create a new record, do not fill or send the contractNo parameter. Also, the value of contractId parameter should not exist in the system as internalId.
If the contractNo is specified or contractId already exists in the system, the existing record is updated.
Request
POST https://FintechOSStudio/api/openApi/CallAction
Content-Type: application/json
{
"Request":{
"ActionName":"FTOS_CB_AddUpdateContract",
"Data":
"{"ContractInfo":
{"contractId":"",
"customerNo":"197",
"productCode":"TL_EUR",
"startDate":"2021-09-08",
"totalInterestRate":"5",
"firstDueDate":"2021-10-08",
"maturityDate":"2022-09-08",
"bankAccountNo":"FIN000001330",
"amountDue":"13500",
"productInterest":"Fix Eur 5%",
"paymentScheduleType":"Equal Installment Monthly 365",
"periodicityType":"Monthly",
"contractPeriod":"12",
"installmentDay":"8",
"installmentMethod":"NextMonth",
"tenor":"12",
"managingBranch":"root",
"destinationBankAccount":"",
"maxDisburseDate":"2022-10-08",
"advanceAmountValue":"3000",
"autoDisbursement":"true"
}
}"
},
"ApiInfo":{
"UserName":"host",
"Token":"5b445502-f776-4e11-8b9b-8562b23b01aa"
}
}
Response
{
"UIResult": {
"NavigateToEntityPage": false,
"NavigateToEntityPageOnEdit": false,
"NavigateToEntityFormName": null,
"NavigateToEntityName": null,
"NavigateToEntityId": null,
"NavigateToEntityInsertDefaults": null,
"NavigateToUrl": null,
"DownloadFile": null,
"ReloadPage": false,
"Message": null,
"IsSuccess": false,
"Data": "{"contractIdentifier":{"name":"3249","id":"5b1ebd64-6deb-4b9d-946c-e850386d9c70"}}",
"NavigateToPageNo": null
},
"Message": null,
"IsSuccess": true,
"ClientScript": null,
"Serialized": null,
"ErrorCode": 0
}
To create a new record, do not fill or send the contractNo parameter. Also, the value of contractId parameter should not exist in the system as internalId.
If the contractNo is specified or contractId already exists in the system, the existing record is updated.
Request
POST https://FintechOSStudio/api/openApi/CallAction
Content-Type: application/json
{
"Request":{
"ActionName":"FTOS_CB_AddUpdateContract",
"Data": "{
"ContractInfo":{
"contractId":"SomeIntern20",
"customerNo":"136",
"productCode":"FiscoLine",
"startDate":"2021-04-16",
"totalInterestRate":"4.5",
"firstDueDate":"2021-05-15",
"maturityDate":"2023-12-31",
"bankAccountNo":"FIN-000000787",
"amountDue":"20500",
"productInterest":"Euribor 6M",
"paymentScheduleType":"Equal Installment Monthly 360",
"periodicityType":"Monthly",
"contractPeriod":"12",
"installmentDay":"15",
"installmentMethod":"ActualMonth",
"tenor":"60",
"managingBranch":"root",
"destinationBankAccount":"IBD-DEST-09",
"reviewInterestDate":"2021-12-10",
"maxDisburseDate":"2022-04-15",
"startDateForUnusage":"2021-05-15",
"unusageCommissionPercent":"2",
"referenceRateDate":"2021-05-01",
"referenceRate":"2",
"margin":"2.7"
}
}"
},
"ApiInfo":{
"UserName":"host",
"Token":"5b445502-f776-4e11-8b9b-8562b23b01aa"
}
}
Response
{
"UIResult": {
"NavigateToEntityPage": false,
"NavigateToEntityPageOnEdit": false,
"NavigateToEntityFormName": null,
"NavigateToEntityName": null,
"NavigateToEntityId": null,
"NavigateToEntityInsertDefaults": null,
"NavigateToUrl": null,
"DownloadFile": null,
"ReloadPage": false,
"Message": null,
"IsSuccess": false,
"Data": "{"contractIdentifier":{"name":"3249","id":"5b1ebd64-6deb-4b9d-946c-e850386d9c70"}}",
"NavigateToPageNo": null
},
"Message": null,
"IsSuccess": true,
"ClientScript": null,
"Serialized": null,
"ErrorCode": 0
}
To create a new record, do not fill or send the contractNo parameter. Also, the value of contractId parameter should not exist in the system as internalId.
If the contractNo is specified or contractId already exists in the system, the existing record is updated.
Request
POST https://FintechOSStudio/api/openApi/CallAction
Content-Type: application/json
{
"Request":{
"ActionName":"FTOS_CB_AddUpdateContract",
"Data": "{"ContractInfo":
{"contractNo":"",
"contractId":"",
"customerNo":"414",
"productCode":"TD_EUR",
"startDate":"2022-01-10",
"totalInterestRate":"1.1",
"maturityDate":"2032-01-10",
"bankAccountNo":"FIN000002677",
"amountDue":"5000",
"productInterest":"Corporate Fixed Deposit Interest 2",
"contractPeriod":"120"}
}"
},
"ApiInfo":{
"UserName":"{{auth.username}}",
"Token":"{{ftos.auth.accessToken}}"
}
}
Response
{
"UIResult": {
"NavigateToEntityPage": false,
"NavigateToEntityPageOnEdit": false,
"NavigateToEntityFormName": null,
"NavigateToEntityName": null,
"NavigateToEntityId": null,
"NavigateToEntityInsertDefaults": null,
"NavigateToUrl": null,
"DownloadFile": null,
"ReloadPage": false,
"Message": null,
"IsSuccess": false,
"Data": "{"contractIdentifier":
{"name":"4769",
"id":"78be153c-693c-4a15-aa35-2a90fe006494"}}",
"NavigateToPageNo": null
},
"Message": null,
"IsSuccess": true,
"ClientScript": null,
"Serialized": null,
"ErrorCode": 0
}
Error Messages
-
Bad Request - maturity date is before activation date- The deposit contract cannot be created because the request contains astartDatevalue in the past; -
Bad Request - Calculated Maturity Date does not match the Maturity Date sent! Calculated Maturity Date is: <yyyy-mm-dd>- The deposit contract cannot be created because the maturity date calculated based on the sent parameters does not match thematurityDatevalue contained within the request.