APY Module - Response

The Data object for a response from the Apy module is defined below, in the order the fields are returned:

🟥 Data

TypeRequired
Objectyes

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, 🔸Interest

Objects: 🟥 Errors[], 🟥 Warnings[],

🔸 Data.Apy

TypeRequiredValues
StringyesNumber 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

TypeRequiredValues
StringyesGeneral, 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

TypeRequiredValues
StringyesDaily, Weekly, BiWeekly, Monthly, BiMonthly, Quarterly, SemiAnnual, Annual

The frequency that interest is compounded.

🔸 Data.CompoundingDays

TypeRequiredValues
StringyesInteger > 0

The value of this field specifies the number of days in each compounding period.

🔸 Data.StatementFreq

TypeRequiredValues
StringyesMonthly, 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

TypeRequiredValues
StringyesInteger > 0

The number of days in each statement period.

🔸 Data.Term

TypeRequiredValues
StringyesInteger > 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

TypeRequiredValues
StringnoYYYY-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

TypeRequiredValues
StringnoYYYY-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

TypeRequiredValues
StringnoYYYY-MM-DD

The number of days between the investment and maturity dates.

🔸 Data.Principal

TypeRequiredValues
StringyesCurrency >= 0

The value of this field specifies the total amount earning interest.

🔸 Data.Interest

TypeRequiredValues
StringyesCurrency

This field holds the value of the Interest field passed into the SCE.


🟥 Data.Errors[]

TypeRequired
Array of Stringyes

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[]

TypeRequired
Array of Stringyes

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."
    ]
  }
}