41 Appendix H: FTP Web Services

FTP web services (v8.0) provide the capability to query Transfer Pricing results from existing account records and execute Transfer Pricing calculations against ad-hoc instruments in near real-time.  The FTP web service calculations utilize the same transfer pricing methodologies and calculations that are used when running standard transfer pricing processes.  FTP web services apply to all FTP calculations including Transfer Rates (all TP Methods), TP Add-on rates (all methods), and Breakage Charges.  FTP web services are generally available to be called by any 3rd party system within the bank.

FTP web services support the following use cases:

·        Ability to query FTP information for existing instrument records for a specified date.

·        Ability to query FTP Daily Rate Card information for standard products.

·        Ability to execute an existing TP Process in real-time, which can refer to any TP Rule, Prepay­ment Rule, Adjustment Rule, and (optionally) an Alternate Rate Output Mapping assumption for a single ad-hoc instrument record.

·        Ability to calculate an Economic Loss Breakage Charge in real-time, for an ad-hoc instrument record.

Topics:

·        Important Changes in OFSAA Release 8.1

·        How to test/execute the FTP Web Services?

·        Configure the FTP Web Services

·        Use the Web API Testing Tool

·        Description of FTP Web Services

·        Web Service name: getTPRate

·        Web Service name: getEconomicCostWithParameters

·        Web Service name: getPricing

·        Web Service name: getPricingData

·        Payment Schedule Enhanced FTP Web Service

·        Web Service Changes for GDPR

·        Java Programs for Testing the FTP Web Service

·        Additional Configuration Needed for Economic Cost Web Services

Important Changes in OFSAA Release 8.1

Starting in version 8.1, FTP is supporting only Restful services for FTP Web Services. The previous versions were supporting SOAP-based services. OFSAA has decided to move to REST as it is becoming the de facto communication mechanism across various platforms. REST is generally faster and uses less bandwidth. It is also easier to integrate REST with the existing applications with no need to re-factor infrastructure. This enables integration faster.

How to test/execute the FTP Web Services?

All the web services require a JSON template (request.json) to be submitted along with the web service request. The JSON template provides the necessary details to the web service allowing it to perform the requested action.

General steps for testing/executing the web service calls:

1.       Testing of these web services can be done by using any standard web API testing tool like a postman, HTTP Master, or Rest-assured.

2.      We have provided examples of testing these services using postman. This is detailed under Section 'Using web API testing tool'. For other web API testing tools, the process will be similar.

3.      To support the testing of the FTP web services, we provide a sample java program that can be called directly. This jar file allows you to call the FTP web services.  Please ensure the FTPWSclient.jar file is in the same folder as the JSON file(s). To receive a copy of the sample program, please raise a service request with the OFSAA support team. You can also view sample java code at the end of this document. Usage of this test program is detailed under the section Use a Java Client Program.

Configure the FTP Web Services

FTP Web services configuration parameters are given in the ofsaaws.properties file under $FIC_WEB_HOME/WEB-INF/classes directory.

The following parameters must be provided:

infodom= e.g. OFSPFTINFO

userId= e.g. ftpuser1

pollFrequency=1000 [in milliseconds]

pollIterations=3

Instrument_tables=210,230~FSI_D_TERM_DEPOSITS;130~FSI_D_MORTGAGES;110,120,180~FSI_D_LOAN_CONTRACTS;160~FSI_D_CREDIT_LINES;

cpp_component= services

For a full description of how to install and configure FTP web services, see the OFS Funds Transfer Pricing Web Service Configuration section in Oracle Financial Services Profitability Pack Installation and Configuration Guide.

Use the Web API Testing Tool

Testing of these web services can be done by using any standard web API testing tool available on the Internet like Postman, HTTP Master, or Rest-assured.

Please download and install the web API testing tool (example Postman) from its distribution website.

Steps for testing using a web API testing tool are detailed for all the web service methods along with the required configuration, input parameters, and expected response. For more information, see Description of FTP Web Services.

Use a Java Client Program

To use a java client program for web API testing, follow these steps:

1.       Create the required json and populate the appropriate parameters. Save it in a file (Request.json)

2.      Open Command Line and navigate to the location of the json files.

3.      Run the following command mentioning the relevant web service and the json file.

Example: java -jar FTPWSclient.jar <parameter> Request.json <RestURL>

4.     The results will appear in the command line.

Description of FTP Web Services

The following use cases refer to a single java program (FTPWSclient.jar), which is available from the OFSAA Support Team.  If required, please raise a service request to receive a copy of the file. It is assumed that anyone looking to deploy the FTP web services will have some basic knowledge of web service development and will be constructing similar wrapper programs for their specific use cases. This java program can be used for testing purposes.

Web Service name: getTPRate

Ability to query existing instrument records that contain FTP information for a specified date:   A relationship manager may want to retrieve the FTP information for existing account records from the database.  For example, a customer may have multiple accounts with the bank, one is a personal loan, and another is term deposit. The relationship manager can query the transfer rate information for these existing accounts and use the actual margin information (positive or negative) as the basis to offer rates for the new products.  Providing this kind of information in real-time allows the banker to make informed pricing decisions.

Rest URL format:

http://<ServerName>:port/<contextName>/services/OFSAAFTPService/getTPRate

The attributes given with angular brackets must be replaced with the appropriate value in your environment.

·        ServerName: This is the name of the host where these services are deployed

·        port: This is the port number on the server where it is listening for an incoming request.

·        contextname: This is the name of the web archive for the FTP Economic Cost web service (FTP­WebServiceAXIS).

Input JSON format:

The following table provides an example of the required inputs in JSON format:

Table 1:   An example of the required inputs in JSON format

Function Name

JSON FORMAT

getTPRate

{

"ACCOUNT_NUMBER": "TLN1TLN1",

"AS_OF_DATE": "20140920",

"INSTRUMENT_TYPE_CODE":"230"

}

Function parameters (supplied within request.json file):

·        Account Number

·        As of Date

·        Instrument Type Code

Test this service using java command line test program

To test the service using java command line test program, follow these steps:

1.       Create the required JSON and populate the appropriate parameters. Save it in a file (Request.json)

2.      Open Command Line and navigate to the location of the json files.

3.      Run the command mentioning the relevant web service and the json file.

Example: java -jar FTPWSclient.jar Request.json <RestURL>

The results will appear in the command line.

This screen shot illustrates how the web service call is made and what the return information looks like when running from the command line.

Example: java -jar FTPWSClient.jar Request.json <Restful_URL>

NOTE

"TP" in the above command indicates you are calling the getTPRate program for this web service. A value of "EC" would indicate you are calling the getEconomicCost program.

Figure 1:   

FTPWebService_1.png

 

Test using Web API Testing Tool (example Postman)

To test using the Web API Testing Tool (example Postman), follow theses steps:

1.       Create a new request from the tool's New Menu.

2.      Select the request type as POST.

3.      Enter the FTP Rest services URL.

4.     In the headers section set the 'Content-Type= application/json'.

5.      We have detailed the request json format for all the web services.

6.     Please create the Json in the required format.

7.      Please copy the JSON and paste it in the Body 'raw section of the tool.

8.     Press the send button.

9.     The request is submitted to the requested web service.

10.   The service is invoked on the server and the requested/calculated values are shown in the response section of the tool.

11.    The following image shows the above steps:

Figure 2:   

FTPWebService_2.png 

The getTPRate web service works with data from the following tables. The specific table where the instrument record lookup will execute is identified in the request.json based on INSTRUMENT_TYPE_CODE.

·        FSI_D_TERM_DEPOSITS (230)

·        FSI_D_MORTGAGES (130)

·        FSI_D_LOAN_CONTRACTS (180)

·        FSI_D_CREDIT_LINES (160)

This list of tables can be extended by including additional tables in the ofsaaws.properties file.

Return values:

·        TRANSFER_RATE

·        LIQUIDITY_PREMIUM_AMT

·        LIQUIDITY_PREMIUM_RATE

·        BASIS_RISK_COST_AMT

·        BASIS_RISK_COST_RATE

·        PRICING_INCENTIVE_AMT

·        PRICING_INCENTIVE_RATE

·        OTHER_ADJUSTMENTS_AMT

·        OTHER_ADJUSTMENTS_RATE

·        ALL_IN_TP_RATE

Web Service name: getEconomicCostWithParameters

Ability to calculate a breakage charge in real-time, for a specified instrument record: This web service supports the calculation of an economic loss breakage charge. This calculation can be embedded in a front-line application to provide breakage charge quotes to customers. This calculation supports all 3 types of breaks including, full break, partial break, and change in attributes break. A few examples of common break events are as follows:

·        A customer wants to redeem their term deposit before expiry. The bank charges a fee equal to the actual economic loss incurred on the account due to the early redemption of the deposit.

·        A customer approaches the bank to prepay the total outstanding balance on their Mortgage loan and want to know what the penalty will be. The bank can calculate the economic breakage charge to be paid by the customer and advise the customer before the payoff.

·        A customer approaches the bank wanting to convert the interest rate on their loan from fixed to floating or vice versa. The bank can calculate the economic loss (or gain) and advise the cus­tomer on any fees they would incur.

This screenshot illustrates how the web service call is made and what the return information looks like when running from the command line.

Rest URL format:

http://<ServerName>:port/<contextName>/services/OFSAAFTPService/getEconomicCostWithParameters

The attributes given with angular brackets should be replaced with the appropriate value in your environment.

·        Server name is the name of the host where these services are deployed

·        Port: This is the port number on the server where it is listening for the incoming request.

·        Context Name is the name of the web archive for the FTP Economic Cost web service (FTPWeb­ServiceAXIS).

Input JSON format

The following table provides an example of the required inputs in JSON format:

Function Name: getEconomicCostWithParameters

JSON Format:

{"CURRENT":

{

        "ACCOUNT_NUMBER": "TLN1TLN1",

        "AS_OF_DATE": "20140920",

        "CURRENT_NET_RATE": "8",

        "ORIGINAL_TERM_TO_MATURITY": "12",

        "ORIGINAL_TERM_MULTIPLIER": "M",

        "PAYMENT_FREQUENCY": "1",

        "PAYMENT_FREQUENCY_MULTIPLIER": "M",

        "ADJUSTABLE_TYPE_CODE": "0",

        "CURRENT_GROSS_BOOK_BALANCE": "48000",

        "ACCRUAL_BASIS_CODE": "3",

        "AMORTIZATION_TERM": "12",

        "AMORTIZATION_TERM_MULTIPLIER": "M",

        "AMORTIZATION_TYPE_CODE": "100",

        "CURRENT_GROSS_PAR_BALANCE": "48000",

        "CURRENT_PAYMENT_AMOUNT": "6959",

        "INTEREST_RATE_CODE": "7777",

        "LAST_REPRICING_DATE": "20140701",

        "MATURITY_DATE": "20150701",

        "NEXT_PAYMENT_DATE": "20141001",

        "NEXT_REPRICING_DATE": "20150701",

        "ORIGINAL_GROSS_PAR_BALANCE": "80000",

        "ORIGINATION_DATE": "20140701",

        "ISSUE_DATE": "20140701",

        "REMAINING_NO_OF_PAYMENTS": "10",

        "LAST_PAYMENT_DATE": "20140901",

        "INTEREST_TYPE_CODE": "1",

        "COMPOUNDING_BASIS_CODE": "120",

        "REPRICING_FREQUENCY": "0",

        "REPRICING_FREQUENCY_MULTIPLIER": "M",

        "TP_RATE": "5.844472",

        "INSTRUMENT_TYPE_CODE": "",

        "TP_METHOD_CODE": "4"

     },

     "PRIOR": {

        "ACCOUNT_NUMBER": "TLN1TLN1",

        "AS_OF_DATE": "20140920",

        "CURRENT_NET_RATE": "8",

        "ORIGINAL_TERM_TO_MATURITY": "12",

        "ORIGINAL_TERM_MULTIPLIER": "M",

        "PAYMENT_FREQUENCY": "1",

        "PAYMENT_FREQUENCY_MULTIPLIER": "M",

        "ADJUSTABLE_TYPE_CODE": "0",

        "CURRENT_GROSS_BOOK_BALANCE": "68000",

        "ACCRUAL_BASIS_CODE": "3",

        "AMORTIZATION_TERM": "12",

        "AMORTIZATION_TERM_MULTIPLIER": "M",

        "AMORTIZATION_TYPE_CODE": "100",

        "CURRENT_GROSS_PAR_BALANCE": "68000",

        "CURRENT_PAYMENT_AMOUNT": "6959",

        "INTEREST_RATE_CODE": "7777",

        "LAST_REPRICING_DATE": "20140701",

        "MATURITY_DATE": "20150701",

        "NEXT_PAYMENT_DATE": "20141001",

        "NEXT_REPRICING_DATE": "20150701",

        "ORIGINAL_GROSS_PAR_BALANCE": "80000",

        "ORIGINATION_DATE": "20140701",

        "ISSUE_DATE": "20140701",

        "REMAINING_NO_OF_PAYMENTS": "10",

        "LAST_PAYMENT_DATE": "20140901",

        "INTEREST_TYPE_CODE": "1",

        "COMPOUNDING_BASIS_CODE": "120",

        "REPRICING_FREQUENCY": "0",

        "REPRICING_FREQUENCY_MULTIPLIER": "M",

        "TP_RATE": "5.844472",

        "INSTRUMENT_TYPE_CODE": "",

        "TP_METHOD_CODE": "4"

     },

     "MINIMUM_CHARGE": "-999999",

     "INTEREST_ONLY_FLAG": "0",

     "RATE_SPREAD": "0",

     "HOLIDAY_CALENDAR": "0",

     "INTERPOLATION_METHOD": "1",

     "ASSET_LIABILITY": "1",

     "SERVICE_TYPE": "B",

     "EXCLUDE_ACCRUED_INTEREST": "N",

     "PAYMENTSCHEDULE": {

        "SCHEDULE": [

      {

              "AMOUNT": "10000",

              "DATE": "20140715"

       },

           {

              "AMOUNT": "20000",

              "DATE": "20140815"

           },

           {

              "AMOUNT": "25000",

              "DATE": "20140915"

           },

          {

              "AMOUNT": "30000",

              "DATE": "20141015"

           },

           {

              "AMOUNT": "35000",

              "DATE": "20141115"

           }

     ]

 }  

}

Function parameters: The following attributes are passed for both the current period (post break) record and prior period (prior to break) record) via request.json:

·        ACCOUNT_NUMBER

·        AS_OF_DATE

·        CURRENT_NET_RATE

·        ORIGINAL_TERM_TO_MATURITY

·        ORIGINAL_TERM_MULTIPLIER

·        PAYMENT_FREQUENCY

·        PAYMENT_FREQUENCY_MULTIPLIER

·        ADJUSTABLE_TYPE_CODE

·        CURRENT_GROSS_BOOK_BALANCE

·        ACCRUAL_BASIS_CODE

·        AMORTIZATION_TERM

·        AMORTIZATION_TERM_MULTIPLIER

·        AMORTIZATION_TYPE_CODE

·        CURRENT_GROSS_PAR_BALANCE

·        CURRENT_PAYMENT_AMOUNT

·        INTEREST_RATE_CODE (The specified IRC will be used both for Transfer Pricing the record if TP Rate is not given and for looking up current rates to calculate the Breakage Charge)

·        LAST_REPRICING_DATE

·        MATURITY_DATE

·        NEXT_PAYMENT_DATE

·        NEXT_REPRICING_DATE

·        ORIGINAL_GROSS_PAR_BALANCE

·        ORIGINATION_DATE

·        ISSUE_DATE

·        REMAINING_NO_OF_PAYMENTS

·        LAST_PAYMENT_DATE

·        INTEREST_TYPE_CODE

·        COMPOUNDING_BASIS_CODE

·        REPRICING_FREQUENCY

·        REPRICING_FREQUENCY_MULTIPLIER

·        TP_RATE (If provided, the TP Method choice below, is not applicable. This TP rate will be used instead of re-calculating. If TP Rate is not given, then it will be a lookup from a database or calcu­lated using the below method)

·        INSTRUMENT_TYPE_CODE

·        TP_METHOD_CODE (10 - Cash Flow: Zero Discount Factor or 4 - Straight term)

·        INTERPOLATION_METHOD (1- Linear, 2- Cubic spline, 3- Quartic spline)

·        ASSET_LIABILITY (1- Asset, 2- Liability)

·        SERVICE_TYPE (A- Actual or S-Simulated) If "A" is selected (recommended) details will be logged to an audit table, FSI_ECONOMIC_COST_HIST

·        EXCLUDE_ACCRUED_INTEREST (Y - Yes, N - No)

To calculate the Breakage Charge, a Transfer Rate must be available. The transfer rate can be arrived at in any of 3 ways:

·        If the TP_RATE is provided in the request.JSON it will be used

·        If TP_RATE is not provided, then ACCOUNT_NUMBER, AS_OF_DATE, and INSTRUMENT_TYPE_CD, if provided, will be used to lookup the Transfer Rate from the existing instrument record

·        If neither of the above cases is provided, then the Transfer Rate will be calculated using the indi­cated TP Method and Interest Rate Curve

The getEconomicCostWithParameters web service works with data from the following tables. The specific table where the instrument record lookup will execute is identified in the request.json based on INSTRUMENT_TYPE_CODE.

·        FSI_D_TERM_DEPOSITS (230)

·        FSI_D_MORTGAGES (130)

·        FSI_D_LOAN_CONTRACTS (180)

·        FSI_D_CREDIT_LINES (160)

This list of tables can be extended by including additional tables in the "ofsaaws.properties" file.

Test the Service using Java Command line test program

1.       Create the required JSON and populate the appropriate parameters. Save it in a file (Request.json)

2.      Open Command Line and navigate to the location of the JSON files.

3.      Run the command mentioning the relevant web service and the JSON file.

Example: java -jar FTPWSClient.jar Request.json <RESTFUL_URL>

NOTE

"EC" in the above command indicates you are calling the getEconomicCostWithParameters program for this web service. A value of "TP" would indicate you are calling the getTPRate program.

Figure 3:   

FTPWebService_3.png

 

Test using Web API Testing tool (example Postman)

1.       Create a new request from the tool's New Menu.

2.      Select the request type as POST.

3.      Enter the FTP Rest services URL.

4.     In the headers section set the 'Content-Type= application/json'.

5.      We have detailed the request JSON format for all the web services.

6.     Create the JSON in the required format.

7.      Copy the JSON and paste it in the Body -> raw section of the tool.

8.     Press the send button.

9.     The request is submitted to the requested web service.

10.   The service is invoked on the server and the requested/calculated values are shown in the response section of the tool.

This screen shot illustrates how the web service call is made using the tool.

Figure 4:   

FTPWebService_4.png 

Web Service name: getPricing

Ability to execute an existing TP Process which can refer to any TP Rule, Prepayment Rule, Adjustment Rule and (optionally) an Alternate Rate Output Mapping assumption in real time for a single ad-hoc instrument record: This web service supports provisioning of FTP rate quotes for more complicated instrument records, which are not supported by the Daily FTP Rate Card process. For cases where pricing for non-standard products is required, details for the entire data record can be passed through this web service to the TP Engine, and results will be generated in nearly real-time. This web service works in the following way:

·        The data record provided in JSON is inserted by the java web service program getPricing into FSI_PM_GENERATED_INSTRMTS table

·        The Process ID of the TP Process (references TP Rule and Adjustment Rule) given in JSON is executed to generate transfer pricing results for the row of data

·        The Product ID given in the JSON is used to lookup the TP Method and Adjustment assumptions

·        If processing is completed within the time set in ofsaaws.properties, then request ID and results will be returned automatically

·        If processing is not completed within the time set in the ofsaaws.properties, then only the request ID is returned

·        In case the results are not returned due to longer processing time, users can set up a second web service call to re-query the results using the getPricingData web service program bypassing the request ID that was returned by the getPricing call.

Rest URL format:

http://<ServerName>:port/<contextName>/rest-api/ftpPcdRestservice/ v1/getPricing

The attributes given with angular brackets should be replaced with the appropriate value in your environment.

·        ServerName: This is the name of the host where these services are deployed

·        Port: This is the port number on the server where it is listening for an incoming request.

·        contextName: This is the name of the web archive for the FTP Application (OFSAA).

          Input Json format:

The following table provides an example of the required inputs in JSON format.

Table 2:   

Function Name:

JSON FORMAT

getPricing

{"processId" :"510291",

"instrumentParameters" : [{

    "accountNumber" : "NEW_ACCOUNT_1",

       "asOfDate" : "20181031",

       "currentNetRate" : "12",

       "originalTermToMaturity" : "5",

       "originalTermMultiplier" : "Y",

       "paymentFrequency" : "1",

       "paymentFrequencyMultiplier" : "M",

       "adjustableTypeCode" : "0",

       "currentGrosBookBalance" : "250000",

       "accuralBasisCode" : "2",

       "amortizationTerm" : "5",

       "amortizationTermMultiplier" : "Y",

       "amortizationTypeCode" : "100",

       "currentGrossParBalance" : "250000",

       "currentPaymentAmount" : "4167",

       "interestRateCode" : "9999",

       "lastRepricingDate" : "20181031",

       "maturityDate" : "20230711",

       "nextPaymentDate" : "20180812",

       "nextRepricingDate" : "20230711",

       "originalGrossparBanalce" : "250000",

       "originationDate" : "20180503",

       "issueDate" : "20181031",

       "remainingNoOfPayments" : "0",

       "lastPaymentDate" : "20181031",

       "interestTypeCode" : "2",

       "compoundingBasisCode" : "160",

       "repricingFrequency" : "0",

       "repricingFrequencyMultiplier" : "M",

       "productCode" : "1013",

       "currency" : "USD",

       "orgPaymentAmt" : "4167"

     }]

 }

Response

{

   "status": "success",

   "data": {

       "requestId": 61,

       "calculatedData": [

           {

               "requestId": "61",

               "accountNumber": "TestingProdFee",

               "transferRate": "7",

               "liquidityPremiumRate": "1",

               "pricingIncentiveRate": "9",

               "basisRiskCostRate": "9",

               "otherAdjustmentRate": "9",

               "allInTPRate": "28",

               "asOfDate": "2018-11-10 00:00:00.0"

           }

       ]

   },

   "messages": null

}

 

Function parameters (for getPricing):

·        PROCESS_ID

·        ACCOUNT_NUMBER

·        AS_OF_DATE

·        CURRENT_NET_RATE

·        ORIGINAL_TERM_TO_MATURITY

·        ORIGINAL_TERM_MULTIPLIER

·        PAYMENT_FREQUENCY

·        PAYMENT_FREQUENCY_MULTIPLIER

·        ADJUSTABLE_TYPE_CODE

·        CURRENT_GROSS_BOOK_BALANCE

·        ACCRUAL_BASIS_CODE

·        AMORTIZATION_TERM

·        AMORTIZATION_TERM_MULTIPLIER

·        AMORTIZATION_TYPE_CODE

·        CURRENT_GROSS_PAR_BALANCE

·        CURRENT_PAYMENT_AMOUNT

·        ORG_PAYMENT_AMT

·        INTEREST_RATE_CODE

·        LAST_REPRICING_DATE

·        MATURITY_DATE

·        NEXT_PAYMENT_DATE

·        NEXT_REPRICING_DATE

·        ORIGINAL_GROSS_PAR_BALANCE

·        ORIGINATION_DATE

·        ISSUE_DATE

·        REMAINING_NO_OF_PAYMENTS

·        LAST_PAYMENT_DATE

·        INTEREST_TYPE_CODE

·        COMPOUNDING_BASIS_CODE

·        REPRICING_FREQUENCY

·        REPRICING_FREQUENCY_MULTIPLIER

·        PRODUCT_ID

·        ISO_CURRENCY_CD

NOTE

Payment schedules are not currently supported by this web service.

·        

Return values:

·        REQUEST_ID

·        ACCOUNT_NUMBER

·        TRANSFER_RATE

·        LIQUIDITY_PREMIUM_RATE

·        BASIS_RISK_COST_RATE

·        PRICING_INCENTIVE_RATE

·        OTHER_ADJUSTMENTS_RATE

·        ALL_IN_TP_RATE

·        AS_OF_DATE

If the TP Process exceeds the allotted time limit, the web service will return only the REQUEST_ID. In this case, you can re-query the results using the getPricingData web service.

Test this service Using Java Command line test program

1.       Create the required JOSN and populate the appropriate parameters. Save it in a file (Request.json)

2.      Open Command Line and navigate to the location of the JSON files.

3.      Run the command mentioning the relevant web service and the JSON file.

This following screenshot illustrates how the web service call is made when running from the command line.

Example: java -jar PricingClient.jar request.json <RESTFUL_URL> userId password

NOTE

This is a secured service and needs a valid FTP userId and password to be passed in command line. The passed user id must have FTP Process Execution function assigned with the mapped role.

Test using Web API Testing tool (example Postman)

1.       Create a new request from the tool's New Menu.

2.      Select the request type as POST.

3.      Enter the FTP Rest services URL.

4.     In the headers section set the 'Content-Type= application/json'.

5.      We have detailed the request JSON format for all the web services.

6.     Create the JSON in the required format.

7.      Copy the JSON and paste it in the Body 'raw section of the tool.

8.     Press the send button.

9.     The request is submitted to the requested web service.

10.   The service is invoked on the server and the requested/calculated values are shown in the response section of the tool.

11.    This is a secured web service and uses basic authorization. So authorization section of the tool should be populated with valid user Id and password of the FTP application.

12.   The header section of the tool needs additional parameters 'userID' with the value of a valid FTP user Id.

This screen shot illustrates how the web service call is made using the tool.

Figure 5:   

FTPWebService_6.png 

Web Service name: getPricingData

The getPricing service invokes the server process in real-time and waits for the calculated values to be returned by the engine. If the server processing time exceeds the allotted time limit, the web service will return only the REQUEST_ID. In this case, you can re-query the results using the getPricingData web service.

Rest URL format:

http://<ServerName>:port/<contextName>/rest-api/ftpPcdRestservice/ v1/getPricingData

The attributes given with angular brackets should be replaced with the appropriate value in your environment.

·        ServerName: This is the name of the host where these services are deployed

·        Port: This is the port number on the server where it is listening for an incoming request.

·        contextName: This is the name of the web archive for the FTP Application (OFSAA).

Input Format

Function Name: getPricingData

   XML Format:

{

REQUEST_ID: 8

}

Function parameters (for getPricingData):

·        REQUEST_ID

Return values:

·        REQUEST_ID

·        ACCOUNT_NUMBER

·        TRANSFER_RATE

·        LIQUIDITY_PREMIUM_RATE

·        BASIS_RISK_COST_RATE

·        PRICING_INCENTIVE_RATE

·        OTHER_ADJUSTMENTS_RATE

·        ALL_IN_TP_RATE

·        AS_OF_DATE

Test this service using Java command line test program

1.       Create the required JSON and populate the appropriate parameters. Save it in a file (Request.json).

2.      Open Command Line and navigate to the location of the JSON files.

3.      Run the command mentioning the relevant web service and the JSON file.

This screen shot illustrates how the web service call is made when running from the command line.

Example: java -jar PricingClient.jar input1.json <RESTFUL_URL>

Figure 6:   

FTPWebService_11.png 

Test using Web API Testing tool (example Postman)

1.       Create a new request from the tool's New Menu.

2.      Select the request type as GET

3.      Enter the FTP Rest services URL.

4.     In the headers section set the 'Content-Type= text/html'

5.      In param tabs of the request add key as 'requestId' and value as the request data for which I want to retrieve data. Example requestId=8.

6.     Press the send button.

7.      The request is submitted to requested web service.

8.     The service is invoked on the server and the requested/calculated values are shown in the response section of the tool.

9.     This is a secured web service and uses basic authorization. So, the authorization section of the tool should be populated with a valid user Id and password of the FTP application.

10.   The header section of the tool needs additional parameters 'userID' with the value of a valid FTP application user Id.

This screen shot illustrates how the web service call is made using the tool.

Figure 7:   

FTPWebService_7.png

 

Related Topics:

·        See Oracle Financial Services Profitability Pack Installation and Configuration Guide for more information on installing and configuring FTP Web Services.

·        See OFSAA Cash Flow Engine Reference Guide, ch.5 for detailed information on the meaning and possible values of each instrument record data attribute mentioned above.

Debugging

Logs related to the FTP web services are stored in the following path:

<ExeWebservice_deployed_Location>/logs/webservices.logs

Debugging the Command Line Program

Also, if user inputs parameters other than EC/TP, you will be notified as follows:

Figure 8:   

FTPWebService_9.png 

If the user doesn't input any of the EC/TP, the input.json, or the REST URL he will be notified as follows:

Figure 9:   

FTPWebService_10.png 

Payment Schedule Enhanced FTP Web Service

Users have the option to pass payment schedule details with the Economic Cost web service if required.

Backward compatibility is still provided for old payment schedule json tags, but the same Payment Schedule value will be passed for both prior and current records and the engine will not fail.

The following is the Eco_Cost_with_2_Payment_Schedule_tags.json file. While using this web service, note the following points:

·        You need to provide the Payment Schedule for both prior and current periods, else the engine will not process.

·        Backward compatibility is still provided for the old payment schedule json tags, but the same Payment Schedule value will be passed for both prior and current records and the engine will not fail.

·        The amortization code needs to be 800, 801, and 802 to ensure that the engine uses the pro­vided payment schedule. Supported TP methods are only the Straight Term and Cash Flow: Zero Discount Factor.

·        Even if the TP method is Straight Term, the Payment Schedule will be used by Breakage Charge calculation.

Example Json for payment Schedule.

Function Name: getEconomicCostWithParameters

JSON Format:

{

  "CURRENT":{

     "ACCOUNT_NUMBER":"TLN1TLN1",

     "AS_OF_DATE":"20140920",

     "CURRENT_NET_RATE":"8",

     "ORIGINAL_TERM_TO_MATURITY":"12",

     "ORIGINAL_TERM_MULTIPLIER":"M",

     "PAYMENT_FREQUENCY":"1",

     "PAYMENT_FREQUENCY_MULTIPLIER":"M",

     "ADJUSTABLE_TYPE_CODE":"0",

     "CURRENT_GROSS_BOOK_BALANCE":"48000",

     "ACCRUAL_BASIS_CODE":"3",

     "AMORTIZATION_TERM":"12",

     "AMORTIZATION_TERM_MULTIPLIER":"M",

     "AMORTIZATION_TYPE_CODE":"800",

     "CURRENT_GROSS_PAR_BALANCE":"48000",

     "CURRENT_PAYMENT_AMOUNT":"6959",

     "INTEREST_RATE_CODE":"7777",

     "LAST_REPRICING_DATE":"20140701",

     "MATURITY_DATE":"20150701",

     "NEXT_PAYMENT_DATE":"20141001",

     "NEXT_REPRICING_DATE":"20140701",

     "ORIGINAL_GROSS_PAR_BALANCE":"80000",

     "ORIGINATION_DATE":"20140701",

     "ISSUE_DATE":"20140701",

     "REMAINING_NO_OF_PAYMENTS":"10",

     "LAST_PAYMENT_DATE":"20140901",

     "INTEREST_TYPE_CODE":"1",

     "COMPOUNDING_BASIS_CODE":"120",

     "REPRICING_FREQUENCY":"0",

     "REPRICING_FREQUENCY_MULTIPLIER":"M",

     "TP_RATE":"5.844472",

     "INSTRUMENT_TYPE_CODE":"",

     "TP_METHOD_CODE":"10",

     "PAYMENTSCHEDULE":{

        "SCHEDULE":[

           {

              "AMOUNT":"10000",

              "DATE":"20140715"

           },

           {

              "AMOUNT":"20000",

              "DATE":"20140815"

           },

           {

              "AMOUNT":"25000",

              "DATE":"20140915"

           },

           {

              "AMOUNT":"30000",

              "DATE":"20141015"

           },

           {

              "AMOUNT":"35000",

              "DATE":"20141115"

           }

        ]

     }

  },

  "PRIOR":{

     "ACCOUNT_NUMBER":"TLN1TLN1",

     "AS_OF_DATE":"20140920",

     "CURRENT_NET_RATE":"8",

     "ORIGINAL_TERM_TO_MATURITY":"12",

     "ORIGINAL_TERM_MULTIPLIER":"M",

     "PAYMENT_FREQUENCY":"1",

     "PAYMENT_FREQUENCY_MULTIPLIER":"M",

     "ADJUSTABLE_TYPE_CODE":"0",

     "CURRENT_GROSS_BOOK_BALANCE":"68000",

     "ACCRUAL_BASIS_CODE":"3",

     "AMORTIZATION_TERM":"12",

     "AMORTIZATION_TERM_MULTIPLIER":"M",

     "AMORTIZATION_TYPE_CODE":"800",

     "CURRENT_GROSS_PAR_BALANCE":"68000",

     "CURRENT_PAYMENT_AMOUNT":"6959",

     "INTEREST_RATE_CODE":"7777",

     "LAST_REPRICING_DATE":"20140701",

     "MATURITY_DATE":"20150701",

     "NEXT_PAYMENT_DATE":"20141001",

     "NEXT_REPRICING_DATE":"20150701",

     "ORIGINAL_GROSS_PAR_BALANCE":"80000",

     "ORIGINATION_DATE":"20140701",

     "ISSUE_DATE":"20140701",

     "REMAINING_NO_OF_PAYMENTS":"10",

     "LAST_PAYMENT_DATE":"20140901",

     "INTEREST_TYPE_CODE":"1",

     "COMPOUNDING_BASIS_CODE":"120",

     "REPRICING_FREQUENCY":"0",

     "REPRICING_FREQUENCY_MULTIPLIER":"M",

     "TP_RATE":"5.844472",

     "INSTRUMENT_TYPE_CODE":"",

     "TP_METHOD_CODE":"10",

     "PAYMENTSCHEDULE":{

        "SCHEDULE":[

           {

              "AMOUNT":"10000",

              "DATE":"20140715"

           },

           {

              "AMOUNT":"20000",

              "DATE":"20140815"

           },

           {

              "AMOUNT":"25000",

              "DATE":"20140915"

           },

           {

              "AMOUNT":"30000",

              "DATE":"20141015"

           },

           {

              "AMOUNT":"35000",

              "DATE":"20141115"

           }

        ]

     }

  },

  "MINIMUM_CHARGE":"-999999",

  "INTEREST_ONLY_FLAG":"0",

  "RATE_SPREAD":"0",

  "HOLIDAY_CALENDAR":"0",

  "INTERPOLATION_METHOD":"1",

  "ASSET_LIABILITY":"1",

  "SERVICE_TYPE":"B",

  "EXCLUDE_ACCRUED_INTEREST":"N"

}

Web Service Changes for GDPR

A new parameter is introduced for FTP getEconomicCostWithparameters and getTPRate web services that determines the lookup column for account number Field in FSI instrument tables.

Properties Filename: ofsaaws.propertries

ParameterName: accountColumnName

Accepted Value: Actual_Account_Number or Account_Number. (Default is Account_Number)

Both these columns are present in FSI instrument tables. This value is required to be set up in the ofsaaws.properties file present in the WEB-INF folder in your web service deployment location before calling the web service.

Based on your data redaction policy, use the appropriate column configuration.

Java Programs for Testing the FTP Web Service

The following Java programs that call the FTP web services and are referenced in the above examples:

·        EcoCostClient.java

·        PricingClient.java

Additional Configuration Needed for Economic Cost Web Services

Economic cost web services makes Java Native Interface call to invoke the calculation engine. So it expects the calculation engine libraries to be available on same box, where the web service is deployed. In your environment if the webs server and FIC Server are on different boxes, follow these additional setups to use the Economic cost webs ervices:

1.       Copy the $FIC_DB_HOME /bin/ftp to a folder in Webserver. Update the LD_LIBRARY_PATH pointing to this folder.

2.      Update the user profile on webserver box with the following:

§        Update LD_LIBRARY_PATH to point to the Oracle client and Java installations.

§        Add the followings in the NLSPATH=$FIC_DB_HOME/conf/en_US/ofsmsg.cat file.

export NLSPATH

INIPATH=$FIC_DB_HOME/conf

export INIPATH

export LDR_CNTRL=MAXDATA=0x40000000

Upgrade of Economic Cost web service from v8.0.6.x to v8.1

To upgrade of Economic cost web service from the version 8.0.6 to 8.1 requires deletion of few legacy jars from the deployment area. The script ofs_ftp_webservice_clean_up.sh deletes these legacy jars. Copy this script file on the OFSAA server and execute it. You must execute the script before the creation of the web service war file.