APY Module - Response
The Data object for a response from the Apy module is defined below, in the
order the fields are returned:
| Object | Fields |
|---|---|
🟥 Data | 🔸Apy, 🔸Formula, 🔸CompoundingFreq, 🔸CompoundingDays, 🔸StatementFreq, 🔸StatementDays, 🔸Term, 🔹InvestDate, 🔹MaturityDate, 🔹DaysToMaturity, 🔸Principal, 🔸Interest |
🟥 Errors[] | |
🟥 Warnings[] |
🟥 Data
| Type | Required |
|---|---|
| Object | yes |
The Data object encapsulates the response data for a given module, and will
always be present.
Fields:
🔸Apy,🔸Formula,🔸CompoundingFreq,🔸CompoundingDays,🔸StatementFreq,🔸StatementDays,🔸Term,🔹InvestDate,🔹MaturityDate,🔹DaysToMaturity,🔸Principal,🔸InterestObjects:
🟥 Errors[],🟥 Warnings[],
🔸 Data.Apy
| Type | Required | Values |
|---|---|---|
| String | yes | Number in [-99.999...600] |
The APY, as defined in Appendix A to Part 1030 of Truth in Savings, and computed by the SCE.
🔸 Data.Formula
| Type | Required | Values |
|---|---|---|
| String | yes | General, Special |
The Formula field describes the formula used to compute the APY. The General
formula is described in Appendix A to Part 1030, Part I Section A. The Special
forumula is described in Appendix A to Part 1030, Part II Section B. Note that
the Special formula is only used when statements are sent more frequently than
the deposit is compounded.
🔸 Data.CompoundingFreq
| Type | Required | Values |
|---|---|---|
| String | yes | Daily, Weekly, BiWeekly, Monthly, BiMonthly, Quarterly, SemiAnnual, Annual |
The frequency that interest is compounded.
🔸 Data.CompoundingDays
| Type | Required | Values |
|---|---|---|
| String | yes | Integer > 0 |
The value of this field specifies the number of days in each compounding period.
🔸 Data.StatementFreq
| Type | Required | Values |
|---|---|---|
| String | yes | Monthly, BiMonthly, Quarterly, SemiAnnual, Annual |
The value of this field specifies the frequency that statements are sent to the customer by the deposit institution.
🔸 Data.StatementDays
| Type | Required | Values |
|---|---|---|
| String | yes | Integer > 0 |
The number of days in each statement period.
🔸 Data.Term
| Type | Required | Values |
|---|---|---|
| String | yes | Integer > 0 |
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.InvestDate
| Type | Required | Values |
|---|---|---|
| String | no | YYYY-MM-DD |
Returns the investment date which was passed to the SCE. If no investment date was specified, then this field will not appear in the output.
🔹 Data.MaturityDate
| Type | Required | Values |
|---|---|---|
| String | no | YYYY-MM-DD |
Returns the maturity date which was passed to the SCE. If no maturity date was specified, then this field will not appear in the output.
🔹 Data.DaysToMaturity
| Type | Required | Values |
|---|---|---|
| String | no | YYYY-MM-DD |
The number of days between the investment and maturity dates.
🔸 Data.Principal
| Type | Required | Values |
|---|---|---|
| String | yes | Currency >= 0 |
The value of this field specifies the total amount earning interest.
🔸 Data.Interest
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
This field holds the value of the Interest field passed into the SCE.
🟥 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" : "Apy",
"Data" : {
"//" : "This is a comment.",
"Hello" : "Friend!",
"How" : "are you?"
}
}
{
"Result" : 200,
"Module" : "Apy",
"Data" : {
"Errors" : [
"Data.Interest (StringFloat) not found.",
"Data.Principal (StringFloat) not found."
],
"Warnings" : [
"Request field Data.Hello (String) not recognized.",
"Request field Data.How (String) not recognized."
]
}
}