Cd Module - Response
The Data object for a response from the Cd module is defined below, in the
order the fields are returned:
| Object | Fields |
|---|---|
🟥 Data | 🔸PV, 🔸Rate, 🔸Term, 🔸TermUnits, 🔸FV, 🔸Maturity, 🔸APY |
🟥 Errors[] | |
🟥 Warnings[] |
🟥 Data
| Type | Required |
|---|---|
| Object | yes |
The Data object for a response from the Cd module is defined below, in the
order the fields and objects are returned:
Fields:
🔸PV,🔸Rate,🔸Term,🔸TermUnits,🔸FV,🔸Maturity,🔸APYObjects:
🟥 Errors[],🟥 Warnings[]
🔸 Data.PV
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The present value of the CD, representing the initial deposit made on the specified deposit date.
🔸 Data.Rate
| Type | Required | Values |
|---|---|---|
| String | yes | Number in [-99.999...600] |
The rate at which interest will accrue during the term of the CD.
🔸 Data.Term
| Type | Required | Values |
|---|---|---|
| String | yes | Integer |
The Term is the number of unit periods (as specified in the
TermUnits field) between the deposit date and the CD's
maturity date.
🔸 Data.TermUnits
| Type | Required | Values |
|---|---|---|
| String | yes | Years, Months, Days |
This field returns the units used for the CD's term. The three
options are: Years, Months, and Days.
🔸 Data.FV
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The future value of the CD at its maturity.
🔸 Data.Maturity
| Type | Required | Values |
|---|---|---|
| String | yes | YYYY-MM-DD |
The date of maturity for the CD. All dates are in the form of YYYY-MM-DD, and
must be 10 characters long.
🔸 Data.Gain
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The gain is the difference between the future value and the present value. It is the amount by which the present value changes over the term of the CD.
🔸 Data.APY
| Type | Required | Values |
|---|---|---|
| String | yes | Number in [-99.999...600] |
The APY (annual percentage yield) is the rate of return on an investment over the term of a year. The APY takes compounding into account, and if the compounding frequency is other than annual, the APY will differ from the interest rate.
🟥 Data.Errors[]
| Type | Required |
|---|---|
| Array of String | yes |
The Errors[] field contains an array of Strings which describe any errors
encountered while handling the request. If the length of the Errors[] Array is
zero (0), then the module processed the request successfully, and the Data
object can be further processed by the calling application for the returned
data.
On the other hand, if the length of the Errors[] Array is greater than zero
(0), then this indicates that an error condition has been detected, and the
calling application should not process the respons Data object further. In
this case, the contents of the Errors[] array will describe the error(s)
encountered.
Typical errors include the omission of 🟥 required fields, invalid field values, etc.
🟥 Data.Warnings[]
| Type | Required |
|---|---|
| Array of String | yes |
The Warnings[] field contains an array of Strings which describe any warnings
generated by the module handling the request. The most common warnings returned
by modules inform the calling application that the module does not recognize a
specified field (which may help to isolate a field name spelling error in the
calling application's code). Note that field names which start with "//" will
bre treated as comment fields by the SCE, and no warnings will be generated
for these unrecognized fields.
Example - Request and response illustrating warnings when passing unrecognized fields:
{
"Module" : "Cd",
"Data" : {
"//" : "This is a comment.",
"Hello" : "Friend!",
"How" : "are you?"
}
}
{
"Result" : 200,
"Module" : "Cd",
"Data" : {
"Errors" : [
"Data.Date (StringDate) not found.",
"Data.PV (StringFloat) not found.",
"Data.Rate (StringFloat) not found.",
"Data.Term (StringFloat) not found."
],
"Warnings" : [
"Request field Data.Hello (String) not recognized.",
"Request field Data.How (String) not recognized."
]
}
}