Apr Module - Response
The Data object for a response from the Apr module is defined below, in the
order the fields are returned:
| Object | Fields |
|---|---|
🟥 Data | |
🟥 Errors[] | |
🟥 Warnings[] | |
🟥 Apr | 🔸Value, 🔸Method, 🔹Accrual, 🔹UnitPeriod, 🔹UnitPeriodBase, 🔹UnitPeriodMult, 🔹PeriodsPerYear |
🟦 TestResults | |
🟦 Apr | 🔹LoanType, 🔹MultAdv, 🔹IrregPeriod, 🔹IrregPmt, 🔸Value, 🔸TestValue, 🔸Difference, 🔹Tolerance, 🔹InCompliance, 🔹OnCusp |
🟦 FinChg | 🔸Value, 🔸TestValue, 🔸Difference |
🟦 TotPmt | 🔸Value, 🔸TestValue, 🔸Difference |
🟥 Loan | 🔸TransactionDate, 🔸AmountFinanced, 🔸NumAdvances, 🔹AdvPresBal, 🔸TotPmt, 🔸NumPmts, 🔹TotPmtPresBal |
🟥 AmTable | 🔸Error, 🔸ErrorDown, 🔸ErrorUp |
🟥 AmLines[] | 🔸Idx, 🔸Date, 🔹Adv, 🔹Pmt, 🔹Prem, 🔹Unit, 🔹Frac, 🔹Factor, 🔹PresVal, 🔹PresValSum, 🔹BegBal, 🔹IntPaid, 🔹IntUnPaid, 🔹EndBal |
🟥 Data
| Type | Required |
|---|---|
| Object | yes |
The Data object encapsulates the response data for a given module, and will
always be present.
Fields:
NoneObjects:
🟥 Errors[],🟥 Warnings[],🟥 Apr,🟦 TestResults,🟥 Loan,🟥 AmTable
🟥 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" : "Apr",
"Data" : {
"//" : "This is a comment.",
"Hello" : "Friend!",
"How" : "are you?"
}
}
{
"Result" : 200,
"Module" : "Apr",
"Data" : {
"Errors" : [
"Data.Advances[] (Array) not found.",
"Data.PmtStreams[] (Array) not found."
],
"Warnings" : [
"Request field Data.Hello (String) not recognized.",
"Request field Data.How (String) not recognized."
]
}
}
🟥 Data.Apr
| Type | Required |
|---|---|
| Object | yes |
Fields:
🔸Value,🔸Method,🔹Accrual,🔹UnitPeriod,🔹UnitPeriodBase,🔹UnitPeriodMult,🔹PeriodsPerYearObjects:
None
The APR data is contained in the fields of this object.
🔸 Data.Apr.Value
| Type | Required | Values |
|---|---|---|
| String | yes | Number in [-99.999...600] |
The numeric value of the computed Apr, expressed as a percentage.
🔸 Data.Apr.Method
| Type | Required | Values |
|---|---|---|
| String | yes | Actuarial, USRule, EU_APR, XIRR, XIRR360, IRR, YieldIRR |
This field returns the Apr method used to compute the numeric Apr value.
🔹 Data.Apr.Accrual
| Type | Required | Values |
|---|---|---|
| String | no | Text - See below |
US Rule APR's will disclose the precise method of interest accrual in this element. All of the variation is in regards to "Term factors". All US Rule interest accrual is governed by the following formula: Interest = APR/100 Term Factor Balance. Each accrual method has its own rules for generating these term factors, which represent how many years interest has been accruing.
🔹 Data.Apr.UnitPeriod
| Type | Required | Values |
|---|---|---|
| String | no | Text - See below |
The value in this field concatenates the
Apr.UnitPeriodMult and
Apr.UnitPeriodBase into one value. For instance, when
with "Base : "Month" and "Mult" : "1", this field's value will be is { "UnitPeriod" : "1_Month" }.
This field will only be present when the Apr method is Actuarial, EU, or US Rule with a unit period calendar.
🔹 Data.Apr.UnitPeriodBase
| Type | Required | Values |
|---|---|---|
| String | no | Day, Week, Month, Year |
The Unit Period for Actuarial, EU, and US Rule (using a unit period calendar) APRs have a basic unit of measurement. The value of this field discloses the basic unit of measurement.
This field will only be present when the Apr method is Actuarial, EU, or US Rule with a unit period calendar.
🔹 Data.Apr.UnitPeriodMult
| Type | Required | Values |
|---|---|---|
| String | no | Integer |
The unit multiple composing the Unit Period. For instance, if the unit period
were 6 months, the Base is Month, the Mult is 6.
This field will only be present when the Apr method is Actuarial, EU, or US Rule with a unit period calendar.
🔹 Data.Apr.PeriodsPerYear
| Type | Required | Values |
|---|---|---|
| String | no | Number |
The value of this field holds the number of periods per year.
This field will only be present when the Apr method is Actuarial or US Rule with a unit period calendar.
🟦 Data.TestResults
| Type | Required |
|---|---|
| Object | no |
The TestResults object is present if the calling application has specified one
of the following: (i) TestApr, (ii)
TestFinChg, or (iii)
TestTotPmt. The child fields of this object
descibe the analysis of each of the three possible tests.
Fields:
None
🟦 Data.TestResults.Apr
| Type | Required |
|---|---|
| Object | no |
This object is only present if the request provided a value greater than zero in
for the value of the TestApr field.
Fields:
🔹LoanType,🔹MultAdv,🔹IrregPeriod,🔹IrregPmt,🔸Value,🔸TestValue,🔸Difference,🔹Tolerance,🔹InCompliance,🔹OnCuspObjects:
None
🔹 Data.TestResults.Apr.LoanType
| Type | Required | Values |
|---|---|---|
| String | no | Regular, Irregular |
The LoanType is either Regular or Irregular. All loans are assumed to be
Regular unless they contain multiple advances, an irregular period other than
the first, or an Irregular Payment other than the first or final, all of which
are defined below. Note: Skipped payment loans are irregular loans, because,
though the payments are regular, the periods are not.
This field is only present when the APR method is Actuarial or US Rule.
🔹 Data.TestResults.Apr.MultAdv
| Type | Required | Values |
|---|---|---|
| Boolean | no | true, false |
If a loan has more than one advance, this value of this field will be true;
otherwise, it is false.
This field is only present when the APR method is Actuarial or US Rule.
🔹 Data.TestResults.Apr.IrregPeriod
| Type | Required | Values |
|---|---|---|
| Boolean | no | true, false |
If a loan has an irregular period between payments, this value of this field is
true; otherwise, it is false. An irregular period is any period between
payments not a unit period. (See 12 C.F.R. § 1026.22(a)(3))
This field is only present when the APR method is Actuarial or US Rule.
🔹 Data.TestResults.Apr.IrregPmt
| Type | Required | Values |
|---|---|---|
| Boolean | no | true, false |
If a loan has an irregular payment, this value of this field is true;
otherwise, it is false. First and final payments are not considered in this
assessment. A loan may only have one payment amount from the 2nd through the
N-1st payments. If two or more payment amounts exist for these middle payments,
this field will be true.
This field is only present when the APR method is Actuarial or US Rule.
🔸 Data.TestResults.Apr.Value
| Type | Required | Values |
|---|---|---|
| String | yes | Number in [-99.999...600] |
The APR computed by the SCE.
🔸 Data.TestResults.Apr.TestValue
| Type | Required | Values |
|---|---|---|
| String | yes | Number in [-99.999...600] |
The APR specified by the request which is to be tested for compliance.
🔸 Data.TestResults.Apr.Difference
| Type | Required | Values |
|---|---|---|
| String | yes | Number in [-99.999...600] |
The magnitude of the difference between the test APR and the computed APR.
🔹 Data.TestResults.Apr.Tolerance
| Type | Required | Values |
|---|---|---|
| String | no | Number in [-99.999...600] |
The tolerance permitted by RegZ for the type of loan in question. In the United
States of America, regular loans have a tolerance of 0.125, while irregular
loans have a tolerance of 0.250. See official staff commentary 226.22(a)(1) - (3)
This field is only present when the APR method is Actuarial or US Rule.
🔹 Data.TestResults.Apr.InCompliance
| Type | Required | Values |
|---|---|---|
| Boolean | no | true, false |
This value of this field is true or false depending on whether the
Difference is greater than the
Tolerance or not. If the difference is greater than the
allowed tolerance, this element returns false. Otherwise, the APR is within
compliance and therefore has true returned.
This field is only present when the APR method is Actuarial or US Rule.
🔹 Data.TestResults.Apr.OnCusp
| Type | Required | Values |
|---|---|---|
| Boolean | no | true, false |
If a test apr is exactly equal to the tolerance, the OnCusp field is true;
otherwise, it is false. Though the loan is within compliance, a loan far
enough out of compliance to be on the cusp of acceptability may want to be
flagged for closer scrutiny.
This field is only present when the APR method is Actuarial or US Rule.
🟦 Data.TestResults.FinChg
| Type | Required |
|---|---|
| Object | no |
This object is only present if the request provided a value greater than zero in
for the value of the TestFinChg field.
Fields:
🔸Value,🔸TestValue,🔸DifferenceObjects:
None
🔸 Data.TestResults.FinChg.Value
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The Finance Charge computed by the SCE.
🔸 Data.TestResults.FinChg.TestValue
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The Finance Charge specified by the request which is to be tested for compliance.
🔸 Data.TestResults.FinChg.Difference
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The magnitude of the difference between the test Finance Charge and the computed Finance Charge.
🟦 Data.TestResults.TotPmt
| Type | Required |
|---|---|
| Object | no |
This object is only present if the request provided a value greater than zero in
for the value of the TestTotPmt field.
Fields:
🔸Value,🔸TestValue,🔸DifferenceObjects:
None
🔸 Data.TestResults.TotPmt.Value
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The Total of Payments computed by the SCE.
🔸 Data.TestResults.TotPmt.TestValue
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The Total of Payments specified by the request which is to be tested for compliance.
🔸 Data.TestResults.TotPmt.Difference
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The magnitude of the difference between the test Total of Payments and the computed Total of Payments.
🟥 Data.Loan
| Type | Required |
|---|---|
| Object | yes |
Fields:
🔸TransactionDate,🔸AmountFinanced,🔸NumAdvances,🔹AdvPresBal,🔸TotPmt,🔸NumPmts,🔹TotPmtPresBalObjects:
None
🔸 Data.Loan.TransactionDate
| Type | Required | Values |
|---|---|---|
| String | yes | YYYY-MM-DD |
The Transaction Date is one of three values, depending on the input: The date
entered as the TransactionDate from
the request, the date of the first advance if the
TransactionDate was omitted, or one
unit period before the first payment in the case of loans with odd days
interest.
🔸 Data.Loan.AmountFinanced
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The total amount financed for the loan.
🔸 Data.Loan.NumAdvances
| Type | Required | Values |
|---|---|---|
| String | yes | Integer |
The value of this field represents the number of advances in the specified loan.
🔹 Data.Loan.AdvPresBal
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The value of this field is the present value of all advances made in the specified loan.
This field is only present when the APR method is Actuarial.
🔸 Data.Loan.TotPmt
| Type | Required | Values |
|---|---|---|
| String | yes | Currency |
The total of all payments made in the requested loan.
🔸 Data.Loan.NumPmts
| Type | Required | Values |
|---|---|---|
| String | yes | Integer |
The value of this field represents the number of payments made in the specified loan.
🔹 Data.Loan.TotPmtPresBal
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The value of this field is the present value of all payments made in the specified loan.
This field is only present when the APR method is Actuarial.
🟥 Data.AmTable
| Type | Required |
|---|---|
| Object | yes |
This object holds the amortization table as well as important error function results as fields.
Fields:
🔸Error,🔸ErrorDown,🔸ErrorUpObjects:
🟥AmLines
🔸 Data.AmTable.Error
| Type | Required | Values |
|---|---|---|
| String | yes | Number - Floating |
The balance at the end of amortization using the disclosed APR. The correct APR
is the rate which produces the smallest balance after amortization. Therefore,
the magnitude of both ErrorDown and
ErrorUp fields should be greater than the value of this
field.
🔸 Data.AmTable.ErrorDown
| Type | Required | Values |
|---|---|---|
| String | yes | Number - Floating |
The balance at the end of amortization using the disclosed APR less one rate
unit. As an example, if the disclosed APR is 10.000%, then the ErrorDown
field would contain the error after amortizing the loan with a rate of
9.999%.
The magnitude of this value should never be less than the magnitude of the
Error field, because the rate with a minimum error magnitude
defines the correct APR.
🔸 Data.AmTable.ErrorUp
| Type | Required | Values |
|---|---|---|
| String | yes | Number - Floating |
The balance at the end of amortization using the disclosed APR plus one rate
unit. As an example, if the disclosed RegZAPR is 10.000%, then the ErrorUp
field would contain the error after amortizing the loan with a rate of
10.001%.
The magnitude of this value should never be less than the magnitude of the
Error field, because the rate with a minimum error magnitude
defines the correct APR.
🟥 Data.AmTable.AmLines[]
| Type | Required |
|---|---|
| array of AmLine objects | yes |
This field is an array of AmLine objects, which describe each amortization line in the schedule.
Fields:
🔸Idx,🔸Date,🔹Adv,🔹Pmt,🔹Prem,🔹Unit,🔹Frac,🔹Factor,🔹PresVal,🔹PresValSum,🔹BegBal,🔹IntPaid,🔹IntUnPaid,🔹EndBalObjects:
None
🔸 Data.AmTable.AmLines[].Idx
| Type | Required | Values |
|---|---|---|
| String | yes | Integer |
The index of the amortization event, starting with zero.
🔸 Data.AmTable.AmLines[].Date
| Type | Required | Values |
|---|---|---|
| String | yes | YYYY-MM-DD |
The date of the amortization event.
🔹 Data.AmTable.AmLines[].Adv
| Type | Required | Values |
|---|---|---|
| String | no | Currency |
The amount of the advance.
This field is only present if this AmLine object is an advance event.
🔹 Data.AmTable.AmLines[].Pmt
| Type | Required | Values |
|---|---|---|
| String | no | Currency |
The payment amount.
This field is only present if this AmLine object is a payment event.
🔹 Data.AmTable.AmLines[].Prem
| Type | Required | Values |
|---|---|---|
| String | no | Currency |
The premium amount.
This field is only present if this AmLine object is a premium event.
🔹 Data.AmTable.AmLines[].Unit
| Type | Required | Values |
|---|---|---|
| String | no | Integer |
The number of full unit periods from this event to the transaction date.
See 12 C.F.R. § 1026, Appendix J(b)(5)).
This field is only present when the APR method is Actuarial or US Rule using the Federal Calendar.
🔹 Data.AmTable.AmLines[].Frac
| Type | Required | Values |
|---|---|---|
| String | no | Text |
The number of fractional unit periods from this event to the transaction date.
See 12 C.F.R. § 1026, Appendix J(b)(5)).
This field is only present when the APR method is Actuarial or US Rule using the Federal Calendar.
🔹 Data.AmTable.AmLines[].Factor
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The Term Factor used to compute interest. (APR/100) Term Factor BegBal = New Interest.
This field is only present when the APR method is not Actuarial.
🔹 Data.AmTable.AmLines[].PresVal
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The present value of the event cash at the time of the transaction date.
This field is only present when the APR method is not US Rule.
🔹 Data.AmTable.AmLines[].PresValSum
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The running total present value sum.
This field is only present when the APR method is not US Rule.
🔹 Data.AmTable.AmLines[].BegBal
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The beginning balance before amortizing this event.
This field is only present when the APR method is US Rule.
🔹 Data.AmTable.AmLines[].IntPaid
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The amount of interest paid at this event.
This field is only present when the APR method is US Rule.
🔹 Data.AmTable.AmLines[].IntUnPaid
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The amount of unpaid interest remaining after this event is amortized.
This field is only present when the APR method is US Rule.
🔹 Data.AmTable.AmLines[].EndBal
| Type | Required | Values |
|---|---|---|
| String | no | Number - Floating |
The ending balance after amortizing this event.
This field is only present when the APR method is US Rule.