# Update loan

Endpoint: PUT /people/{personId}/loans/{loanId}
Version: 2025-03-26
Security: oauth2, bearerAuth, apiKeyHeader

## Path parameters:

  - `personId` (string, required)
    A Borrower's unique identifier, tied to a person or a business. Can be Peach or a lender's external identifier.

  - `loanId` (string, required)
    The unique identifier of the Loan we wish to retrieve. Can be
Peach or lender's external identifier.

## Query parameters:

  - `validate` (boolean)
    Validate the contact through an external API. This is only used for addresses currently.

  - `force` (boolean)
    Override that enables the update of a borrower's address of a loan.

## Request fields (application/json):

  - `atOrigination` (any)
    This object can only be updated when the loan has `status=pending`.

  - `atOrigination.advanceSchedule` (array)
    The advance schedule of the loan. Total amount of the advances must be equal to `amountFinanced`. If `advanceSchedule` is passed,
the system will calculate the APR based on the special formula provided in
[Appendix J](https://www.ecfr.gov/cgi-bin/text-idx?SID=747961e095035658cdddba8b09d30a6f&mc=true&node=pt12.9.1026&rgn=div5#ap12.9.1026.0000_0nbspnbspnbsp.j)
(see examples of loans with multiple advances).

  - `atOrigination.advanceSchedule.advanceDate` (string, required)
    The date of the advance in the product timezone. The date cannot be in the past or greater than the last due date.
- If the advance is created in `pending` or `settled` status, the advance will be recorded in the ledger with an effective timestamp of
the Create advance call.
- If the advance is created in `scheduled` status, the advance will be recorded in the ledger only when the status changes to `pending` or `settled`.

  - `atOrigination.advanceSchedule.advanceDetails` (object)
    The details of advance.

  - `atOrigination.advanceSchedule.advanceDetails.categoryId` (string)
    The category identifier of the advance.

  - `atOrigination.advanceSchedule.advanceDetails.description` (string)
    The description of the advance. Normally shown in Borrower Portal and on statements. At least one of the attributes, `description`
or `merchantName` must be passed.

  - `atOrigination.advanceSchedule.advanceDetails.merchantId` (string)
    The merchant identifier that the advance was used for.

  - `atOrigination.advanceSchedule.advanceDetails.merchantName` (string)
    The merchant name that the advance was used for. At least one of the attributes, `description` or `merchantName` must be passed.

  - `atOrigination.advanceSchedule.advanceDetails.metadata` (object)
    Store any type of key/value pairs in the form of a JSON dictionary.

  - `atOrigination.advanceSchedule.advanceDetails.pointOfSaleType` (string)
    - `online` - the advance was made online on a website or in a mobile application.
- `physical` - the advance was made in a store with a physical card or instrument.
- `recurring` - the advance was made as part of a subscription service.
    Enum: "online", "physical", "recurring"

  - `atOrigination.advanceSchedule.advanceTimeOfDay` (object)

  - `atOrigination.advanceSchedule.advanceTimeOfDay.hour` (integer, required)
    The hour. Value range is 0-23. 0=Midnight...23=11 PM.

  - `atOrigination.advanceSchedule.advanceTimeOfDay.minute` (integer, required)
    The minute. Value range is 0-59.

  - `atOrigination.advanceSchedule.advanceTimeOfDay.second` (integer)
    The second. Value range is 0-59.

  - `atOrigination.advanceSchedule.amount` (number, required)
    The amount of advance. The amount must be positive.

  - `atOrigination.advanceSchedule.externalId` (string)
    A lender's identifier for a resource.
After the resource is successfully created, a lender can use the Peach assigned ID OR
the `externalId` identifiers to fetch the resource.
### Fetching with `externalId`:
To fetch a resource using an `externalId`, you MUST use the prefix `ext-` in the URL.
For example, a loan with an external identifier of `ABCDE` would be referenced like `/api/people/BO-FAKE-IDNT/loans/ext-ABCDE`.
### Creating with `externalId`:
To create a resource with an external identifer, you MUST NOT use the prefix `ext-`.
For example, if the external identifier should be `ABCDE`, then pass
`{ externalId: "ABCDE", ... }` in the request body.

  - `atOrigination.advanceSchedule.metadata` (object)
    Store any type of key/value pairs in the form of a JSON dictionary.

  - `atOrigination.advanceSchedule.status` (string, required)
    - `scheduled` - the advance was scheduled in the future. If the advance status doesn't change to `pending`, `settled` or `canceled` on the advance due
date, the system will automatically cancel the advance on the following calendar day (aka change the status to `canceled`).
For example: An advance was `scheduled` for May 27, 2021. On May 28, 2021, the advance status was still `scheduled`. The system will cancel the advance.
- `settled` - the advance was settled and/or funded. `settled` advances increase the loan balance.
- `pending` - the advance is pending. `pending` advances increases the loan balance similar to `settled`. `pending` status is used mainly for visuals
and normally shown in Borrower Portal.
- `canceled` - the advance was canceled. `canceled` advances reduce the draw balance. A new advance cannot be created in `canceled` status.
    Enum: "scheduled", "settled", "pending", "canceled"

  - `atOrigination.amountFinanced` (number)
    The amount financed. The amount of money a borrower received from the lender, minus the upfront fees (e.g. origination fee) the lender is charging the borrower.

  - `atOrigination.aprEffective` (number)
    The effective APR of the loan at origination. Pass both `aprNominal` and `aprEffective` even if they are equal.

  - `atOrigination.aprNominal` (number)
    The nominal APR of the loan at origination. Pass both `aprNominal` and `aprEffective` even if they are equal.

  - `atOrigination.bufferToPushOutSchedule` (number)
    The number of calendar days that will be added to the activation date. The resulting date will be used to push out
due dates as if the loan was activated on that date (activation date + buffer). Interest will still be accrued
normally from the activation date. Not valid for the singleTerm frequency.

  - `atOrigination.discountProgramIds` (array)
    The identifiers of the discount programs provided at origination. A discount program
has to be created before it can be applied to loans.

  - `atOrigination.downPaymentAmount` (number)
    The amount of down payment made when the loan was originated. The value should be equal to what a
borrower agreed to and signed at origination.

  - `atOrigination.duration` (number)
    The duration of the loan as a number of `paymentFrequency` periods.
For example:
- if `paymentFrequency=monthly` and `duration=6`, it is a loan with 6 months duration and will have 6 due dates.
- if `paymentFrequency=weekly` and `duration=24`, it is a loan with 24 weeks duration and will have 24 due dates.

  - `atOrigination.enforcedEndDate` (string)
    The enforced end date of the loan in the product timezone. If the `enforcedEndDate` is not provided, it will be set at `activation`.
If `enforcedEndDate` and `expectedPayments` are provided, the last
payment due date MUST match `enforcedEndDate`.

  - `atOrigination.expectedPayments` (array)
    Expected payments schedule for the loan at origination. The dates and amounts
are exactly what a borrower agreed to and signed.

  - `atOrigination.expectedPayments.amount` (number, required)
    The total amount of the payment. The total amount is equal to: `principalAmount` + `interestAmount`

  - `atOrigination.expectedPayments.date` (string, required)
    Due date.

  - `atOrigination.expectedPayments.dynamicFeeDetails` (object)
    When `paymentType`=`dynamicFee` this will contain details of the dynamic fee.

  - `atOrigination.expectedPayments.dynamicFeeDetails.chargeDate` (string)
    **This attribute can be used only during the migration process of loans from another system to Peach. Any value passed for new loans
that are created and activated from day zero (`nonMigrated` loans) on the Peach system will be ignored.**
The effective date on which the fee was charged in the product timezone. In other words, this is when the fee was booked and written to the ledger.
The charge date of the fee is different from the due date of the fee. The due date of the fee is `expectedPayments.date`. The `chargeDate` must be
between the first and last dates (inclusive) of the period represented by `expectedPayments.date` (aka the due date).
If the `chargeDate` is provided, you can also provide the `chargeTimeOfDay`.
If the `chargeDate` is not provided, the system will charge the fee on the first day of the period.

  - `atOrigination.expectedPayments.dynamicFeeDetails.chargeTimeOfDay` (object)
    See description of the `chargeDate`. The value can be provided only if the `chargeDate` attribute is passed. If `chargeTimeOfDay` is not provided,
the Peach system will determine and set the time of day.

  - `atOrigination.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.hour` (integer, required)
    The hour. Value range is 0-23. 0=Midnight...23=11 PM.

  - `atOrigination.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.minute` (integer, required)
    The minute. Value range is 0-59.

  - `atOrigination.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.second` (integer)
    The second. Value range is 0-59.

  - `atOrigination.expectedPayments.dynamicFeeDetails.dynamicFeeTypeId` (string)
    The dynamic fee type identifier in the system.

  - `atOrigination.expectedPayments.interestAmount` (number)
    The portion of `amount` allocated to interest (before any promo date(s) or discount). Required when `paymentType`
is `periodicPayment`

  - `atOrigination.expectedPayments.interestBeforeDiscountAmount` (number)
    The amount of interest discount.

  - `atOrigination.expectedPayments.isForcedAmount` (boolean)
    Only applicable to `paymentType=periodicPayment`.
If set to `true`, the system will honor the amount and will not update it on loan recalculations.
If set to `false` and the amount is less than the `periodicPaymentAmount`, the system can increase the amount when
the loan is being recalculated.
In most of the cases, the lender should set the value to `false` (aka the default value.) If you need more
explanation or advice on your use case, please contact the Peach team.

  - `atOrigination.expectedPayments.paymentType` (string, required)
    The payment type.
    Enum: "periodicPayment", "originationFee", "drawFee", "dynamicFee", "downPayment", "discountCredit"

  - `atOrigination.expectedPayments.principalAmount` (number)
    The portion of the `amount` allocated to principal. Required when `paymentType` is `periodicPayment`

  - `atOrigination.expectedPayments.unroundedInterestAmount` (string)
    The portion of the `amount` allocated to net interest. Available only for `paymentType=periodicPayment`.
This value is unrounded.

  - `atOrigination.expectedPayments.unroundedInterestBeforeDiscountAmount` (string)
    The interest amount that was accrued before promo rate(s) or any discount. Available only for
`paymentType=periodicPayment`. This value is unrounded.

  - `atOrigination.expectedPayments.unroundedPrincipalAmount` (string)
    The portion of the `amount` allocated to principal. Available only for `paymentType=periodicPayment`.
This value is unrounded.

  - `atOrigination.fees` (object)
    The loan fees.

  - `atOrigination.fees.dynamicFees` (array)
    Dynamic fees details.
Applicable if your loan type has dynamic fee(s) pre-defined and fee(s) amount are different among loans.
Also, for a Line of Credit, this configuration is used to set a dynamic fee type on a selected draw when a dynamic fee type is
configured with `appliedToDraws` is `True` and `drawApplicationLogic` is `selectedDraws`.
Currently, the following dynamic fee types are supported: `purchaseFee`, `foreignTransactionFee`, `lateFee`, `serviceFee`, `nsfFee`.
Please note `lateFee` and `nsfFee` can only be configured on a single draw.

  - `atOrigination.fees.dynamicFees.apiName` (string)
    The API name of the dynamic fee. For example: `lateFee` or `breatherFee`.
If applicable, `purchaseFee` or `foreignTransactionFee` `apiName` must be included, so it is applied to a specific draw.
Please confirm configs with the Peach team to ensure purchase fees are correctly configured.
When both `apiName` and `dynamicFeeTypeId` are provided, `apiName` is preferred.

  - `atOrigination.fees.dynamicFees.dynamicFeeTypeId` (string)
    Public ID of the dynamic fee type (for example, `FT-XXXX-XXXX`). Alternative to `apiName`.
When both `apiName` and `dynamicFeeTypeId` are provided, `apiName` is preferred.

  - `atOrigination.fees.dynamicFees.feeAmount` (number)
    The fee amount that will be charged recurrently. Only required if the dynamic fee `amountLogic` is configured as
`type=passedAtOrigination`. In all other cases, the system will calculate the fee based on pre-configured logic.

  - `atOrigination.fees.dynamicFees.feeCapAmount` (number)
    The maximum amount of the dynamic fee that can be charged over the life of the loan or draw. Only required if the dynamic fee
`capLogic` is configured as `type=capPassedAtOrigination`. In all other cases, the system will calculate the fee based on pre-configured
logic.

  - `atOrigination.fees.originationFeeAmount` (number)
    The amount of the origination fee.

  - `atOrigination.fees.serviceFeeAmount` (number)
    **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeAmount`.
The service fee amount that will be charged recurrently. Only required if the service fee `amountLogic` is configured as
`type=passedAtOrigination`. In all other cases, the system will calculate the fee based on pre-configured logic.

  - `atOrigination.fees.serviceFeeCapAmount` (number)
    **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeCapAmount`.
The maximum amount of the service fee that can be charged over the life of the loan or draw. Only required if the service fee
`capLogic` is configured as `type=capPassedAtOrigination`. In all other cases, the system will calculate the fee based on pre-configured
logic.

  - `atOrigination.fees.totalOtherFeesAmount` (number)
    The total amount of non-origination fees that are expected to be charged on the loan. The value should be
equal to what a borrower agreed to and signed at origination.

  - `atOrigination.interestRates` (array)
    Interest rates for the loan or the draw. Can be a single interest rate for the entire duration of the loan/draw.
Or, it can be multiple interest rates for partial periods of the loan/draw. If draw-specific rates are not passed,
the draw will use the LOC rates.

  - `atOrigination.interestRates.days` (integer, required)
    Number of calendar days the interest rate applies to. An entry with `days: null` is required
at the end of the list to indicate that the interest rate applies to the end of the loan duration.
For example:
`{"days": 30, "rate": 0.1},`
`{"days": 60, "rate": 0.2},`
`{"days": null, "rate": 0.25}`
The loan will accrue interest of 10% for the first 30 days. Between days 31-90
the loan will accrue interest of 20%. From day 91 until the end, the loan will accrue
interest of 25%.

  - `atOrigination.interestRates.interestType` (string)
    The interest type. The interest type cannot be changed after the loan or draw status changes to `originated` and onward.
`absolute` - interest rates defined as `absolute` will use the value as provided here without adding the Index Interest Rate.
- Negative interest `rate` value is not allowed.
- If the provided `rate` is outside of the range defined on the loan type, the system will accept the `rate` but will return a warning in the response's object `ratesValidation`.

`spread` - interest rates defined as `spread` will calculate an absolute rate by adding the relative loan rate (aka spread)
provided in the `rate` attribute to the Index Interest Rate effective on the date the interest is accrued.
In case the Index Interest Rate is not set, the system will assume that the Index Interest Rate value is zero on the date the interest is accrued.
- Negative interest spread `rate` value is allowed, but the system will default to zero if the addition of the Index Interest Rate still results in a negative rate.
- If the calculated absolute rate, `rate` (aka spread) plus Index Interest Rate, is outside of the range defined on the loan type, the system will accept the `rate` but will return a warning in the response's object `ratesValidation`.
    Enum: "absolute", "spread"

  - `atOrigination.interestRates.rate` (number, required)
    The annual interest rate for the period defined. The format is decimal.
For example, 0.01 is a 1% annual rate, 0.2 is a 20% annual rate.

  - `atOrigination.investors` (array)
    A list of the investors who owned the loan at origination.
If none are provided, it defaults to the default investor configured for the lender.

  - `atOrigination.investors.investorId` (string, required)
    The Investor's unique identifier, internal or lender's external.

  - `atOrigination.investors.metro2` (object)

  - `atOrigination.investors.metro2.reportK2Segment` (boolean)
    Only applicable to loans that are reported to credit bureaus.
If `true`, the system will report the K2 segment in the Metro2 file
to indicate that the loan has been sold to a new investor. Peach
will continue to report the loan.
If `false`, the system will not report the K2 segment in the Metro2
file. Peach will continue to report the loan.

  - `atOrigination.investors.share` (number, required)
    The ownership percentage of the loan. The format is decimal. For example, 0.01 is 1% ownership and 0.15 is 15% ownership.

  - `atOrigination.investors.effectiveDate` (string)
    The date at which this ownership structure came into effect.

  - `atOrigination.itemsOrServicesFinanced` (string)
    Merchandise, services or other value provided in exchange for the debt. For example: refrigerator
or kitchen renovation. This description is used in communications with the borrower, when needed.

  - `atOrigination.mdr` (object)
    This object represents optional configurations for the MDR (Merchant Discount Rate). When POS (point of sale)
lenders issue loans, the merchant pays some percentage of the financed amount - called the MDR.

  - `atOrigination.mdr.mdrRate` (number)
    The Merchant Discount Rate (MDR). The format is decimal. For example, 0.03 is a 3% annual rate, 0.2 is a
20% annual rate. If `mdrAmount` is not passed, the system will calculate the `mdrAmount` by multiplying
the `amountFinanced` by the `mdrRate`.

  - `atOrigination.mdr.amortizationPeriod` (number)
    Number of calendar days. If a value is passed, the system will amortize the `mdrAmount` over the `amortizationPeriod`
number of calendar days.
If a value is not passed or the value exceeds the loan life, the system will amortize the MDR amount over the life of
the loan. For Line of Credit, it is required to provide the `amortizationPeriod`. For Installment loans, it is
recommended to leave the value empty.

  - `atOrigination.mdr.isAmortized` (boolean)
    `true` to amortize the `mdrAmount` using the straight-line amortization method over the life of the loan.
`false` to recognize the `mdrAmount` as revenue in full on the day when the loan is activated.

  - `atOrigination.mdr.mdrAmount` (number)
    The Merchant Discount Amount.

  - `atOrigination.merchantId` (string)
    A lender's identifier for the merchant.

  - `atOrigination.originatingCreditorName` (string)
    The name of an entity that originated the loan. For example: Bank of Mars. This name will be
used in communications with the borrower when needed.

  - `atOrigination.originationLicense` (string)
    The license that was used to originate the loan.
    Enum: "nationalBank", "stateLicense", "bankSubsidiary", "stateBank"

  - `atOrigination.paymentFrequency` (string)
    The payment frequency of the loan.
`weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly` - are recurring.
`singleTerm` - a single term loan (aka non-recurring). It will create one period only with a desired "duration" of 30,
60, 90, 120, X calendar days or a specific date that should be passed in specificDays. For example [90].
    Enum: "weekly", "everyTwoWeeks", "twiceMonthly", "monthly", "singleTerm"

  - `atOrigination.periodicPaymentAmount` (number)
    The amortized periodic payment amount excluding fees. Keep in mind that the last payment
can be different from the `periodicPaymentAmount`. Required when passing in `expectedPayments`
at origination.

  - `atOrigination.personAddress` (object)
    The mailing address.

  - `atOrigination.personAddress.POBox` (string)
    Post Office Box

  - `atOrigination.personAddress.addressLine1` (string)
    Address line 1.
If `company.allowPartialAddress=false`, then this field is required, else it is not required

  - `atOrigination.personAddress.addressLine2` (string)
    Address line 2.

  - `atOrigination.personAddress.city` (string)
    City.

  - `atOrigination.personAddress.country` (string, required)
    Country. English short name according to
[ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.

  - `atOrigination.personAddress.countyOrRegion` (string)
    County or region.

  - `atOrigination.personAddress.postalCode` (string, required)
    Postal code. Also known as ZIP code.

  - `atOrigination.personAddress.state` (string)
    State/Province. This is a required field if the country is US or CA.

  - `atOrigination.personAddressId` (string)
    This is the existing identifier of a borrower's address contact information (Peach's
unique or lender's external identifier). If passed during origination, the address will be stored
on the loan object as a reference. Alternatively, the address can be directly provided
in `personAddress`, in which case, `personAddressId` should not be sent.

  - `atOrigination.principalAmount` (number)
    The amount of principal at origination. Lenders should only pass this value if `principalAmount` is different from `amountFinanced`.
If a value is provided, the system will use `principalAmount` as the loan principal for interest calculations and amortization. The value should be greater than `amountFinanced`.
If a value is not provided, the system will:
- Set `principalAmount = amountFinanced`.
- Use `amountFinanced` as the loan principal for interest calculations and amortization.

  - `atOrigination.promoRates` (array)
    The promotional interest rates (aka rate discounts) for the loan or the draw.
Can be a single promo rate for the entire duration of the loan/draw.
Or, it can be multiple promo rates for partial periods of the loan/draw.
For example, if the `interestRate` is 20% for the first 90 days and the `promoRate` has value
5% for 30 days, then the effective rate for the first 30 days is 15%.
The promo rates are unconditional and will be applied regardless of the loan status.

  - `atOrigination.promoRates.days` (integer)
    Number of calendar days the promo rate applies to. Use `null` to indicate that
the promo rate applies to the end of the loan duration.
For example:
`{"days": 30 ,"rate": 0.1},`
`{"days": null, "rate": 0.01}`
The loan will receive interest discount of 10% for the first 30 days.
From day 31 until the end, the loan will receive interest discount of 1%.

  - `atOrigination.promoRates.rate` (number)
    The annual promo rate for the period defined. Loans cannot accrue negative interest rate.
If the promo rate is greater than the interest rate, a loan will accrue 0% interest rate.
The format is decimal. For example, 0.01 is a 1% annual rate, 0.15 is a 15% annual rate.

  - `atOrigination.rateCaps` (array)
    Rate caps that should apply to the loan at origination.
When the loan is created these rate caps are created and
applied to the loan. They will be accessible via the `.../rate-caps` endpoint.

  - `atOrigination.rateCaps.days` (number, required)
    Number of calendar days the rate cap applies from loan origination.
If null, the rate cap applies for the entire loan term.
For example:

```
[{"days": 30, "maxRate": 0.1},
{"days": 60, "maxRate": 0.2},
{"days": null, "maxRate": 0.25}]
```
The loan will accrue interest with a rate cap of 10% for the first 30 days.
Between days 31-90 the loan will accrue interest with a rate cap of 20%.
From day 91 until the end, the loan will accrue interest with a rate cap of 25%.

  - `atOrigination.rateCaps.maxRate` (number, required)
    The maximum spread interest rate that can accrue.
If the calculated rate on a given day is greater than `maxRate`, then the system will
cap the rate and accrue a maximum of `maxRate` on the loan. Else, we will use the calculated rate.
Format is decimal. For example, 0.36 is 36% annual rate cap.

  - `atOrigination.rateCaps.rateCapReason` (string, required)
    The reason for `maxRate`. This is not used for any compliance logic, only for informational purposes.
- `MLA` - Military Lending Act (36% cap for active duty military)
- `SCRA` - Servicemembers Civil Relief Act
- `federal` - Other federal regulations
- `state` - State-specific regulations
- `other` - Other regulatory or business reasons
    Enum: "MLA", "SCRA", "federal", "state", "other"

  - `atOrigination.skipCreditReporting` (boolean)
    Set to `true` if the loan should not be reported to the credit agencies when activated.

  - `atOrigination.specificDays` (array)
    Specific days designate the day(s) that due dates will fall on. The allowed values for specific
day(s) depends on the `paymentFrequency`.
`weekly` - provide one number in the valid range 1-7. 1=Monday...7=Sunday.
For example: [1].
`everyTwoWeeks` - provide two inputs. The first input (required) is an integer in the valid range 1-7. 1=Monday...7=Sunday.
The second input is a date that indicates when to start the cycle. If the second input is not passed, the system will default
to the first valid start date based on the first input (the day of week passed in). If this date is provided then it can override
the minimum due date gap specified on the loan type.
For example: [1, "2020-09-16"].
`twiceMonthly` - provide two numbers in the valid range 1-31. 1=first day of a month. Use 31 to
indicate the last day of a month.
For example: [1, 15] or [15, 31].
`monthly` - provide one or two numbers, depending on the loan type `periodCalculationType` configuration:
- If `periodCalculationType=dueDate`, then provide one number in the valid range 1-31. This is the recurring due date. 1=first
day of a month. Use 31 to indicate the last day of a month. For example: [1].
- If `periodCalculationType=statementDate`, then provide one number in the valid range 1-31. This is the recurring statement date.
1=first day of a month. Use 31 to indicate the last day of a month. For example: [1].
- If `periodCalculationType=fixedStatementAndDueDates`, then provide two numbers. First number represents a recurring statement
date and the valid range is 1-31. Use 31 to indicate the last day of a month. Second number represents a recurring due date and
the valid range is 1-28. Two numbers must be different. For example: [1, 15] - statements are on 1st and due dates are on 15th.
Notes:
  - If the due date precedes the statement day, it's pushed to the next month. For example: [20, 10] and today is Oct 1, 2024. The
first statement date is Oct 20, 2024 and the first due date is Nov 10th.
  - For February in non-leap years, if the statement date is ≥ 29 and the due date is 28, the statement date becomes March 1st.

`singleTerm` - provide one number to indicate duration as a number of calendar days or provide a valid calendar date in the
future. This option is only valid for use on the installment type and at loan origination.
For example: [90] or ["2020-09-16"].
For `weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly`:
If specificDays is left null, then the system will calculate due dates according to the paymentFrequency relative
to the origination or activation date (or use existing specific days in the case of change due date).
For `singleTerm`:
The specificDays is mandatory.

  - `atOrigination.totalDiscountAmount` (number)
    The total amount of discount at origination as a result of promo rates. The value should be equal to what
a borrower agreed to and signed at origination.

  - `atOrigination.totalInterestAmount` (number)
    The total amount of interest the loan should accrue. The value should be equal to what a borrower agreed
to and signed at origination. Because of rounding issues, the total of expected payments `interestAmount`
might be different from `totalInterestAmount`.

  - `atOrigination.totalInterestCapAmount` (number)
    The maximum amount of interest the borrower will ever pay.
If not applicable, set to `null`.

  - `atOrigination.aprEffective` (number)
    **DEPRECATED ATTRIBUTE**
The effective APR of the loan at origination. Pass both `aprNominal` and `aprEffective` even if they are equal.
This field is deprecated for Line of Credit and Draw. You can still pass the value, and it will be stored on the object.
However, it will not be used/displayed anywhere. The system will use the interest rate values of Line of Credit and Draws
and show them as the APR (for example, on the statement.)

  - `atOrigination.aprNominal` (number)
    **DEPRECATED ATTRIBUTE**
The nominal APR of the loan at origination. Pass both `aprNominal` and `aprEffective` even if they are equal.
This field is deprecated for Line of Credit and Draw. You can still pass the value, and it will be stored on the object.
However, it will not be used/displayed anywhere. The system will use the interest rate values of Line of Credit and Draws
and show them as the APR (for example, on the statement.)

  - `atOrigination.aprVariableRange` (array)
    The APR range if the loan has variable APR/interest rate. If the loan has a fixed APR/interest rate, keep this attribute empty.
This attribute is only used to be displayed on emails, Borrower Portal, statements and other UI elements. If `aprVariableRange` is
passed, the statement will show `(v) = Variable Rate` next to the APR values. The range should not change after the loan was originated.
The interest rate (also called the current effective APR) can change using Loans Management Rates endpoints. Keep in mind that this range
is applicable to all Draws. Draw object doesn't have its own aprVariableRange attribute.
The format is decimal up to 4 decimal places. First value is minimum rate (inclusive). Second value is maximum rate (inclusive).
For example:
- [0.1999, 0.2999] - is 19.99% - 29.99% APR.
- [0.01, 0.03] - is 1.00% - 3.00% APR.
    Example: [0.1999,0.2999]

  - `atOrigination.creditLimitAmount` (number)
    The credit limit amount.

  - `atOrigination.discountProgramIds` (array)

  - `atOrigination.downPaymentAmount` (number)
    The amount of down payment made when the loan was originated.

  - `atOrigination.gracePeriod` (object)
    The logic to handle the grace period benefit. The grace period benefit allows the borrower not to
accrue interest on the line and its draws as long as they pay the required balance every period.
The loan/line and all draws must meet the grace period repayment requirement. If one of the draws
didn't meet the repayment requirement (in other words the entire line didn't meet the repayment
requirement), all applicable/enrolled draws would lose the grace period benefit and accrue interest.
To configure the grace period benefit:
- You need to pass the `gracePeriod` object with `isGracePeriodApplicable=true` and other attributes
when you create the line/loan.
- You need to pass a draw-level `gracePeriod` object. Please read more details about the `gracePeriod`
object in the Create draw endpoint. If the loan/line `isGracePeriodApplicable=true`, all draws of
the line participate in the evaluation of the loan/line grace period benefit eligibility. But not
all draws have to receive the grace period benefit - you can decide what draws should accrue
interest even if the line is eligible for the benefit. For example, amortized draws can participate
in the grace period benefit eligibility, but are not designed to be eligible for grace period
benefit (in other words, amortized draws are expected to accrue interest if an interest rate
greater than zero was set on the draw).

Important: the grace period attributes cannot be changed after the line is activated.

  - `atOrigination.gracePeriod.isGracePeriodApplicable` (boolean)
    Indicates if the line is enrolled in the grace period benefit.
- `true` - the grace period benefit is eligible on the loan/line level.
  - The loan/line and all draws must meet the grace period repayment requirement. If one of the
draws didn't meet the repayment requirement (in other words the entire line didn't meet the
repayment requirement), all draws eligible for the grace period benefit would lose the grace
period benefit and accrue interest.
  - You need to pass details of how draws are evaluated in the grace period benefit - read more
details about the `gracePeriod` object in the Create draw endpoint.
- `false` - the grace period benefit is not eligible on the loan/line level.
  - You cannot enroll individual draws in the grace period benefit.

  - `atOrigination.gracePeriod.numPeriodsToRestoreGrace` (integer)
    Number of periods to wait after the grace period benefit was revoked before the line/loan can become eligible again.
To take advantage of the grace period, the borrower must pay their account balance according to the grace period benefit requirements on time for the number of billing periods provided.
If this attribute is passed, it will be used to set the draw-level `numPeriodsToRestoreGrace` for any draw that is enrolled in the grace period benefit (aka `isGracePeriodApplicable=true`).
This will ensure that the line and all draws have the same `numPeriodsToRestoreGrace` values.
This attribute is required to be passed if `isGracePeriodApplicable=true` and must be greater than zero.
This attribute is not required and won't be used if the `gracePeriod` object is not passed or `isGracePeriodApplicable=false`.

  - `atOrigination.minPaymentCalculation` (object)
    The logic to calculate the minimum payment amount when a statement is created. All interest accrued in the period and fees are always part
of the minimum payment amount plus a `percentageOfPrincipal` for each draw.
If `includeOverLimitAmount` is set to true at the draw level, the minimum payment amount will include the over limit amount at the time of
statement generation as part of the required minimum payment for each draw. The overlimit amount will be distributed/allocated according to
the `paymentWaterfall.multi.loansOrder` configuration at the loanType level (e.g. `highestInterestRate`).
Statement logic adds up all draws calculated minimum payment amounts (including overlimit amounts, if applicable) and adds all unpaid fees
to set the total statement minimum amount. If the `loanType.statement` object is configured such that `includeOverdueAmountInMinPayment=true`,
the statement minimum payment amount will include the overdue amount as part of the required minimum payment displayed on the statement.

  - `atOrigination.minPaymentCalculation.minAmount` (number)
    The minimum periodic amount. For example: $35.00. The minimum will be only enforced if draws on the line of credit do not have an amortized amount.
Example:
Assume `minAmount` on the loan-level is set to $35.00.
Draw 1 outstanding principal is $100.00.
Draw 1 percentageOfPrincipal=0.01 (aka 1%).
Draw 1 interest rate is 2% per month.
Draw 1 interest amount per month is: $100.00 * 2% = $2.00.
Draw 1 minimum amount is: $2 + $100.00 * 1% = $3.00.
Draw 2 outstanding principal is $200.00.
Draw 2 percentageOfPrincipal=0.02 (aka 2%).
Draw 2 interest rate is 3% per month.
Draw 2 interest amount per month is: $200.00 * 3% = $6.00.
Draw 2 minimum amount is: $6 + $200.00 * 1% = $8.00.
Loan level fees: Fee 1 is $5.00, Fee 2 is $7.50. Both are unpaid.
Loan-level minimum payment calculation is max($35.00, [$3.00 (draw 1 minimum) + $8.00 (draw 2 minimum) + $5.00 (fee 1) + $7.50 (fee 2)]) = max($35, $23.50) = $35
The minimum payment will be set to $35.00 and not $23.50. The split between principal, interest, and fees will be fees=$12.50, interest=$8.00 and principal=$14.50.
Principal will be allocated first according to the `percentageOfPrincipal` on each draw (e.g., $1 for draw 1 and $2 for draw 2 in the example above). The remaining
principal amount ($11.50 in the example) will be allocated to draws based on the `loansOrder` as part of the `multi` waterfall configuration at the loanType level.
In the example above, assuming draw 1 is ordered before draw 2, the $11.50 will be allocated to draw 1. Draw 1 minimum amount will increase to ($3.00 + $11.50) = $14.50.

  - `atOrigination.paymentFrequency` (string)
    Enum: "weekly", "everyTwoWeeks", "twiceMonthly", "monthly"

  - `chargedOffReason` (string)
    The reason for the loan charge off. You can only update the `chargedOffReason` if the loan status is `chargedOff`.
- `term` means the loan was charged off per loan type configuration after X days overdue.
- `fraudulent` means the loan was charged off for fraudulent reason. If the loan is reported to one or more credit bureaus, the system will automatically send a special request to each bureau to delete the tradeline due to confirmed fraud. This is the only reason that the system will automatically trigger a request to delete the tradeline. For other reasons, if you need to delete the tradeline please call the `Delete from credit reporting` endpoint or use an agent tool.
- `bankruptcy` means the loan was charged off because of bankruptcy.
- `legal` means the loan was charged off because of some legal reason.
    Enum: "term", "fraudulent", "bankruptcy", "legal"

  - `externalId` (string)
    The lender's identifier for the loan. Requires the `loan:update.force` permission to change.

  - `metaData` (object)
    Store any type of key/value pairs in the form of a JSON dictionary.

  - `migration` (object)
    Loan migration details. This structure should be used for loans that are migrated from another system to Peach.
To migrate a loan (see migration guidance for full details):
1. Create a new loan in `pending` or `originated` status. The loan must be in `originated` before proceeding to the next step.
2. Call relevant endpoints to create past payments, refunds, etc.
3. Call `Migrate loan` endpoint.

  - `migration.activatedDate` (string)
    The activation date of the migrated loan in the product timezone. The date must be in the past.

  - `migration.activatedTimeOfDay` (object)
    The effective time of day on `activatedDate` in the product timezone.

  - `migration.activatedTimeOfDay.hour` (integer, required)
    The hour. Value range is 0-23. 0=Midnight...23=11 PM.

  - `migration.activatedTimeOfDay.minute` (integer, required)
    The minute. Value range is 0-59.

  - `migration.activatedTimeOfDay.second` (integer)
    The second. Value range is 0-59.

  - `migration.creditReporting` (object)
    Instructions to the Peach system on how to report a migrated account.

  - `migration.creditReporting.dateClosed` (string)
    Legacy-system date the account was closed. If provided, Peach uses this value for Metro2 "Date Closed"; otherwise Peach derives it from Peach close/payoff events.

  - `migration.creditReporting.dateOfFirstDelinquency` (string)
    The date of first delinquency as of the "migration cutoff
date". This attribute is required to accurately report delinquency
data. If the migrated account is delinquent (based on the Metro2
definition) as of the migration cutoff date, then you must pass the
`dateOfFirstDelinquency`. You must also pass it if the
`paymentHistoryProfile` shows a charge-off (`L`), collection (`G`),
foreclosure (`H`), voluntary surrender (`J`), or repossession (`K`),
even if the account has since been paid. If the account only had late
payments in the past (codes `1`-`6`) and is current as of the
migration cutoff date, this attribute is optional.
For more details of how to determine this value, please refer to the
most recent Metro2 Credit Reporting Resource Guide.

  - `migration.creditReporting.dateOpened` (string)
    Legacy-system date the account was opened. If provided, Peach uses this value for Metro2 "Date Opened"; otherwise Peach uses the loan activation date in the product timezone. This value only affects credit reporting; it does not change the loan activation date or interest accrual.

  - `migration.creditReporting.k2Segment` (object)
    The K2 Segment may be used to report the name of the company from
which the account was purchased or the name of the company to which
the account was sold.
If you migrate an account to Peach, and want to include the K2
segment, you need to pass all the applicable attributes in this
object.
Please review the notes below per the Metro2 Credit Reporting Resource Guide:
- If the company that purchased the accounts will not report the
prior history, the seller must report the accounts as sold to
reflect the final status.
- If the account is delinquent or derogatory, it is imperative
that you provide the date of the first delinquency that led to
the account being sold to the debt purchaser.
- If the company that purchased the accounts is converting the
account history to their system, the seller should not report
the accounts as sold. In this situation, the seller and
purchaser should work together with the data representatives at
the consumer reporting agencies, who will assist you with
conversion of the accounts.
- If the lender who sold the accounts reported them as "purchased
by another company" or the history cannot be verified for the
account prior to purchase, report the Base and K2 Segment
fields.
  - If the new lender is unable to obtain the Date of First
Delinquency with the original lender, do not report the
account.
  - Payment history that occurred with the previous lender, which
is already on the consumer's file, must not be reported by the
new lender.
- If the previous lender's account history is being converted to
the new lender's system and the account history can be verified,
report the Base, K2 Segment and L1 Segment fields.
  - If the new lender is unable to obtain the Date of First
Delinquency with the original lender, do not report the
account.
  - Make sure to configure the Identification Number to be the
same as reported by the previous lender.
  - Make sure to pass loan `externalId` as the Account Number
reported by the previous lender.

  - `migration.creditReporting.k2Segment.purchasedFromName` (string, required)
    Contains the name of the company from which the account was purchased.

  - `migration.creditReporting.l1Segment` (any)
    The L1 Segment provides an automated method for changing the
Consumer Account Number and/or Identification Number and should be
reported only one time per record to affect the change.

If you migrate an account to Peach, and want to include the L1
segment, you need to pass all the applicable attributes in this
object.

  - `migration.creditReporting.l1Segment.changeIndicator` (string, required)
    The change indicator field.
- `1` = Consumer Account Number Change ONLY.
- `2` = Identification Number Change ONLY.
- `3` = Consumer Account Number AND Identification Number Change.
    Enum: "1"

  - `migration.creditReporting.l1Segment.oldConsumerAccountNumber` (string, required)
    The old Account Number that was assigned to this account in the other system
(not Peach) prior to migration. The new Account Number that will be reported
is the loan `externalId` or Peach Public ID.
Do not include embedded blanks or special characters. If
`changeIndicator=2`, this field should be left empty or blank filled.

  - `migration.creditReporting.l1Segment.oldIdentificationNumber` (string, required)
    The old Identification Number that was used in the other system (not Peach)
prior to migration. The new Identification Number that will be reported is
as configured in Peach.
Do not include embedded blanks or special characters. If
`changeIndicator=1`, this field should be left empty or blank filled.

  - `migration.creditReporting.paymentHistoryProfile` (string)
    The payment history profile of the account prior to the migration date.
The format of this attribute is a string of exactly 24
characters. Peach will use the provided history profile of the
account to report the history up to 24 months. After the migration
cutoff date, Peach will start reporting "new/current" payment
behavior and use part of the `paymentHistoryProfile` data.
For example:
Migration from date = Jan 11, 2022 (this is also a statement date)
paymentHistoryProfile = `000011000000EEEE0000BBBB`
Data represents, from left to right, 12/31/2021 back through
01/31/2020. The E's indicate that the account was current with a
zero balance in 12/2020, 11/2020, 10/2020 and 09/2020. The B's
indicate that no payment history was available prior to 05/2020,
which was most likely the date account was opened.
Peach will first report the account on Feb 1, 2022:
Date of Account Information = 01/31/2022 (represents the reporting period of 01/01/2022 through 01/31/2022)
Account Status Code = 11
Peach will report the PHP field as is - `000011000000EEEE0000BBBB`.
Peach will report the account again on Mar 1, 2022:
Date of Account Information = 02/31/2022 (represents the reporting period of 02/01/2022 through 02/28/2022)
Peach will use part of the original value passed in the `paymentHistoryProfile` and report the PHP field as `0000011000000EEEE0000BBB`. Note that Peach didn't use the last "B" from the original value that was passed.
For more details of how to determine this value, please refer to the
most recent Metro2 Credit Reporting Resource Guide. The below was
copied from the Metro2 2022 Credit Reporting Resource Guide:
> Contains up to 24 months of consecutive payment activity for the
previous 24 reporting periods prior to the Date of Account
Information (Field 24) being reported. Report one month's payment
history in each byte from the left to right in most recent to
least recent order. The first byte should represent the Account
Status Code reported in the previous reporting period. Refer to
Exhibit 5 for examples of reporting payment history, which
includes examples for month-end reporters, as well as examples
for reporters who submit data on other days of the month (e.g.,
1st, 15th, etc.).
`0` = 0 payments past due (current account)
`1` = 30 - 59 days past due date
`2` = 60 - 89 days past due date
`3` = 90 - 119 days past due date
`4` = 120 - 149 days past due date
`5` = 150 - 179 days past due date
`6` = 180 or more days past due date
`B` = No payment history available prior to this time – either because the account was not open or because the payment history cannot be furnished. A "B" may not be embedded within other values.
`D` = No payment history reported/available this month. "D" may be embedded in the payment history profile.
Note: Code "D" should not be used as a default value or reported to remove accurately-reported history.
`E` = Zero balance and Account Status 11 – Current (0-29 days past the due date)(Applies to Credit Cards and Lines of Credit)
`G` = Collection
`H` = Foreclosure Completed
`J` = Voluntary Surrender
`K` = Repossession
`L` = Charge-off
No other values are acceptable in this field.

If this value is not provided, Peach will report PHP as "unknown"
from the "activation date" until the "migration cutoff date" using a
special code `B` based on the Metro2 Credit Reporting Resource
Guide.

  - `migration.migrationStatus` (string)
    The loan migration status. This attribute can be updated by the Peach system only.
- `nonMigrated` - this is a non-migrated loan. Most loans are expected to be `nonMigrated`.
- `prepMigration` - the lender can add objects to the loan in the past.
- `migrating` - the system is migrating the loan. Objects cannot be modified or added.
- `completed` - the loan was successfully migrated. After a successful migration the loan status will be changed to one of the following statuses: `active`, `accelerated`, `chargedOff` or `paidOff`.
- `failed` - the loan migration attempt failed. The loan will remain in the `pending` status. You can update the loan details and try to migrate again by calling `Migrate loan` endpoint.
    Enum: "nonMigrated", "prepMigration", "migrating", "completed", "failed"

  - `muteLoanNotices` (boolean)
    Indicates whether the system should stop/pause sending loan related notices to the borrower. Set to true if you want to mute all loan related notices (e.g. loanDetails. autopayEnabled, paymentFailed, etc.) Keep in mind that it will also stop all notices related to the loan that are sent from Peach Agent Portal by an agent.
Note: this is not the only attribute that can stop notices from being sent. Compliance Guard and Cases Do Not Interact can also block communications.

  - `nickname` (string)
    A nickname the borrower gave the loan.

  - `status` (string)
    The new loan status. Note that not every value in the enum is settable via this endpoint:
for Peach-managed loans, `declined` cannot be set here (it is set at loan creation, or by
cancelling the loan), and most other transitions go through dedicated endpoints (e.g.
activate, charge-off, close). Sending an unsupported transition returns a 4xx error.
    Enum: "pending", "originated", "declined", "active", "frozen", "accelerated", "chargedOff", "paidOff", "canceled"

## Response 200 fields (application/json):

  - `message` (string)
    Description of the server action or error.

  - `status` (integer)
    HTTP status code.

  - `data` (any)
    Represents a loan. A loan always belongs to a borrower, and most of
the interactions between a lender and a borrower are associated with a
particular loan.

  - `data.id` (string)

  - `data.loanTypeId` (string)
    The loan type identifier. This is created specifically for each lender's loan product by Peach.

  - `data.additionalBorrowers` (array)

  - `data.additionalBorrowers.externalId` (string)
    The borrower's external ID if this related borrower has one, otherwise `null`

  - `data.additionalBorrowers.id` (string)
    ID of the related borrower

  - `data.additionalBorrowers.name` (string)
    The related borrower's full name (or business's name if this is a business).

  - `data.additionalBorrowers.relationType` (string)
    A relation type between a borrower and a loan.
Use `coBorrower` as the value if there are two or more borrowers.
    Enum: "coBorrower", "coSigner", "applicant"

  - `data.assetDisplayName` (string)
    The asset display name. For example: Loan, Line of Credit, Lease, Credit Card.

  - `data.cancellationReason` (string)
    The cancellation reason:
`technicalIssue` - loan was created due to a technical issue.
`wrongLoanTerms` - loan was created with the wrong terms.
`wrongBorrower` - loan was created on the wrong borrower.
`other` - for any other reason requiring cancellation.
    Enum: "technicalIssue", "wrongLoanTerms", "wrongBorrower", "other"

  - `data.declineReason` (object)
    The reason(s) why the loan application or the draw request was declined.

  - `data.declineReason.mainExternalReasonCode` (string)
    A Lender's external main decline reason code.

  - `data.declineReason.mainScriptForRep` (string)
    The main decline reason script that a customer service agent can provide to the borrower.

  - `data.declineReason.mainText` (string)
    The main decline reason text that was shown to the borrower.

  - `data.declineReason.subReasons` (array)

  - `data.declineReason.subReasons.externalReasonCode` (string)
    A Lender's external decline reason code.

  - `data.declineReason.subReasons.reasonText` (string)
    The decline reason text that was shown to the borrower.

  - `data.declineReason.subReasons.scriptForRep` (string)
    The decline reason script that a customer service agent can provide to the borrower.

  - `data.displayId` (string)
    The loan ID to show in the UI (Peach public or external).

  - `data.endDate` (string)
    The end date of the loan in the product timezone, if amortized.

  - `data.externalId` (string)
    A lender's identifier for a loan or a draw.
After the object is successfully created, a lender can use ID or externalId identifiers to fetch the object.
To fetch the object using externalId you need to add `ext-` to the URL.
Note: Don't add ext- to the identifier value. For example: if the external identifier is `ABCDE`, then pass externalId=ACBCE and NOT ext-ABCDE when creating the object.

  - `data.labels` (array)

  - `data.labels.companyId` (string)
    The unique company identifier.

  - `data.labels.description` (string)
    An optional description of the loan label. Typically used to store additional details or
an explanation about the label. Not displayed in any user interfaces.

  - `data.labels.name` (string)
    The name of the label. This is the name that will appear in the agent (and admin, if applicable) portals.

  - `data.metaData` (object)
    Store any type of key/value pairs in the form of a JSON dictionary.

  - `data.timestamps` (object)
    Various loan timestamps.

  - `data.timestamps.acceleratedAt` (string)
    The timestamp of the effective date of the acceleration of a loan or draw. A
previously accelerated loan that has been reversed will be marked as null.

  - `data.timestamps.activatedAt` (string)
    The timestamp when the loan or the draw was activated.

  - `data.timestamps.canceledAt` (string)
    The timestamp of when the loan was canceled

  - `data.timestamps.chargedOffAt` (string)
    The timestamp of the effective date of the charge-off of a loan or draw. A
previously accelerated loan that has been reversed will be marked as null.

  - `data.timestamps.closedAt` (string)
    The date LOC or Draw was closed.

  - `data.timestamps.createdAt` (string)

  - `data.timestamps.deletedAt` (string)

  - `data.timestamps.frozenAt` (string)
    The timestamp of the most recent freeze date of a loan or draw. A previously frozen
loan that has been reversed will be marked as null.

  - `data.timestamps.lastAmortizedAt` (string)
    The most recent date when the loan or the draw was amortized. Due dates schedule change
can cause to re-amortization.

  - `data.timestamps.migratedAt` (string)
    The timestamp of when the loan completed loan migration.

  - `data.timestamps.originatedAt` (string)
    The timestamp when the loan or draw was originated.

  - `data.timestamps.paidOffAt` (string)
    The timestamp of the effective date when a loan or draw is paidOff.

  - `data.timestamps.startedAt` (string)
    The timestamp when the loan or the draw was activated.

  - `data.timestamps.updatedAt` (string)

  - `data.assetType` (string)
    The generic asset types that are supported.
    Enum: "personalClosedEndUnsecured", "personalOpenEndUnsecured", "personalClosedEndSecured", "personalOpenEndSecured", "motorMVRISC", "motorDirect", "motorLease", "businessClosedEndUnsecured", "businessOpenEndUnsecured", "businessClosedEndSecured", "businessOpenEndSecured"

  - `data.chargedOffReason` (string)
    The reason for loan charge off. Can be updated via the Update Loan endpoint when the loan status is `chargedOff`.
`term` means the loan was charged off per loan type configuration after X days overdue.
`fraudulent` means the loan was charged off for fraudulent reason. If the loan is reported to one or more credit bureaus, the system will automatically send a special request to each bureau to delete the tradeline due to confirmed fraud. This is the only reason that the system will automatically trigger a request to delete the tradeline. For other reasons, if you need to delete the tradeline please call the `Delete from credit reporting` endpoint or use an agent tool.
`bankruptcy` means the loan was charged off because of bankruptcy.
`legal` means the loan was charged off because of some legal reason.
    Enum: "term", "fraudulent", "bankruptcy", "legal"

  - `data.companyId` (string)
    The unique company identifier.

  - `data.mainBorrowerId` (string)
    The identifier of the main borrower of the loan

  - `data.migration` (object)
    Loan migration details. This structure should be used for loans that are migrated from another system to Peach.
To migrate a loan (see migration guidance for full details):
1. Create a new loan in `pending` or `originated` status. The loan must be in `originated` before proceeding to the next step.
2. Call relevant endpoints to create past payments, refunds, etc.
3. Call `Migrate loan` endpoint.

  - `data.migration.activatedTimeOfDay` (object, required)
    The effective time of day on `activatedDate` in the product timezone.

  - `data.migration.activatedTimeOfDay.hour` (integer, required)
    The hour. Value range is 0-23. 0=Midnight...23=11 PM.

  - `data.migration.activatedTimeOfDay.minute` (integer, required)
    The minute. Value range is 0-59.

  - `data.migration.activatedTimeOfDay.second` (integer)
    The second. Value range is 0-59.

  - `data.migration.migrationStatus` (string, required)
    The loan migration status. This attribute can be updated by the Peach system only.
- `nonMigrated` - this is a non-migrated loan. Most loans are expected to be `nonMigrated`.
- `prepMigration` - the lender can add objects to the loan in the past.
- `migrating` - the system is migrating the loan. Objects cannot be modified or added.
- `completed` - the loan was successfully migrated. After a successful migration the loan status will be changed to one of the following statuses: `active`, `accelerated`, `chargedOff` or `paidOff`.
- `failed` - the loan migration attempt failed. The loan will remain in the `pending` status. You can update the loan details and try to migrate again by calling `Migrate loan` endpoint.
    Enum: "nonMigrated", "prepMigration", "migrating", "completed", "failed"

  - `data.amountsValidation` (object)
    This object contains information on whether the total of `expectedPayments` match to various amounts of the loan.

  - `data.amountsValidation.amountFinancedMatch` (any)
    `true` if the sum of `amountFinanced + originationFeeAmount` equals to `principalAmount`.
We allow up to 1 cent difference in the match because of potential rounding issues. Only applicable if both
`amountFinanced` and `principalAmount` are passed during origination; null otherwise.

  - `data.amountsValidation.feesMatch` (boolean)
    `true` if the sum of `expectedPayments` fees portion is equal to `originationFeeAmount` + `totalOtherFeesAmount`. Only applicable
when `expectedPayments` was passed during origination; `null` otherwise.

  - `data.amountsValidation.interestMatch` (boolean)
    `true` if the sum of `expectedPayments` interest portion is equal to `totalInterestAmount`. We allow up 1 cent different in
the match because of potential rounding issues. Only applicable when `expectedPayments` was passed during origination; `null`
otherwise.

  - `data.amountsValidation.principalMatch` (boolean)
    `true` if the sum of `expectedPayments` principal portion is equal to `amountFinanced`. We allow up 1 cent different in
the match because of potential rounding issues. Only applicable when `expectedPayments` was passed during origination; `null`
otherwise.

  - `data.amountsValidation.recurringAmountsMatch` (boolean)
    `true` if `atOrigination.periodicPaymentAmount` (aka recurring amount) equals the first expected payment's recurring amount.
Otherwise, `false`. `null` if `atOrigination.periodicPaymentAmount` or expected payments schedule is not passed at origination.

  - `data.amountsValidation.totalAdvancesMatch` (boolean)
    `true` if the sum of `advanceSchedule` amounts is equal to `amountFinanced`. Only applicable when `advanceSchedule` was passed during
origination; `null` otherwise.

  - `data.aprEffectiveAtActivation` (number)
    The APR that was calculated by Peach at loan activation. The format is decimal. For
example, 0.01 is 1%, 0.2 is 20%. If the origination and activation dates are the same,
the `aprEffective` is equal to the `aprEffectiveAtActivation`.
If the origination and activation dates are different, the
`aprEffective` might be different from the `aprEffectiveAtActivation`. `aprEffective` is
`null` if it could not be computed.

  - `data.aprNominalAtActivation` (number)
    The APR that was calculated by Peach at loan activation. The format is decimal. For
example, 0.01 is 1%, 0.2 is 20%. If the origination and activation dates are the same,
the `aprNominal` is equal to the `aprNominalAtActivation`.
If the origination and activation dates are different, the
`aprNominal` might be different from the `aprNominalAtActivation`.`aprEffective` is
`null` if it could not be computed.

  - `data.atActivation` (object)
    This object contains loan details and terms at the time of loan activation.

  - `data.atActivation.expectedPayments` (array)
    Expected payments schedule for the loan at activation.

  - `data.atActivation.expectedPayments.amount` (number, required)
    The total amount of the payment. The total amount is equal to: `principalAmount` + `interestAmount`

  - `data.atActivation.expectedPayments.date` (string, required)
    Due date.

  - `data.atActivation.expectedPayments.dynamicFeeDetails` (object)
    When `paymentType`=`dynamicFee` this will contain details of the dynamic fee.

  - `data.atActivation.expectedPayments.dynamicFeeDetails.chargeDate` (string)
    **This attribute can be used only during the migration process of loans from another system to Peach. Any value passed for new loans
that are created and activated from day zero (`nonMigrated` loans) on the Peach system will be ignored.**
The effective date on which the fee was charged in the product timezone. In other words, this is when the fee was booked and written to the ledger.
The charge date of the fee is different from the due date of the fee. The due date of the fee is `expectedPayments.date`. The `chargeDate` must be
between the first and last dates (inclusive) of the period represented by `expectedPayments.date` (aka the due date).
If the `chargeDate` is provided, you can also provide the `chargeTimeOfDay`.
If the `chargeDate` is not provided, the system will charge the fee on the first day of the period.

  - `data.atActivation.expectedPayments.dynamicFeeDetails.chargeTimeOfDay` (object)
    See description of the `chargeDate`. The value can be provided only if the `chargeDate` attribute is passed. If `chargeTimeOfDay` is not provided,
the Peach system will determine and set the time of day.

  - `data.atActivation.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.hour` (integer, required)
    The hour. Value range is 0-23. 0=Midnight...23=11 PM.

  - `data.atActivation.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.minute` (integer, required)
    The minute. Value range is 0-59.

  - `data.atActivation.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.second` (integer)
    The second. Value range is 0-59.

  - `data.atActivation.expectedPayments.dynamicFeeDetails.dynamicFeeTypeId` (string)
    The dynamic fee type identifier in the system.

  - `data.atActivation.expectedPayments.interestAmount` (number)
    The portion of `amount` allocated to interest (before any promo date(s) or discount). Required when `paymentType`
is `periodicPayment`

  - `data.atActivation.expectedPayments.interestBeforeDiscountAmount` (number)
    The amount of interest discount.

  - `data.atActivation.expectedPayments.isForcedAmount` (boolean)
    Only applicable to `paymentType=periodicPayment`.
If set to `true`, the system will honor the amount and will not update it on loan recalculations.
If set to `false` and the amount is less than the `periodicPaymentAmount`, the system can increase the amount when
the loan is being recalculated.
In most of the cases, the lender should set the value to `false` (aka the default value.) If you need more
explanation or advice on your use case, please contact the Peach team.

  - `data.atActivation.expectedPayments.paymentType` (string, required)
    The payment type.
    Enum: "periodicPayment", "originationFee", "drawFee", "dynamicFee", "downPayment", "discountCredit"

  - `data.atActivation.expectedPayments.principalAmount` (number)
    The portion of the `amount` allocated to principal. Required when `paymentType` is `periodicPayment`

  - `data.atActivation.expectedPayments.unroundedInterestAmount` (string)
    The portion of the `amount` allocated to net interest. Available only for `paymentType=periodicPayment`.
This value is unrounded.

  - `data.atActivation.expectedPayments.unroundedInterestBeforeDiscountAmount` (string)
    The interest amount that was accrued before promo rate(s) or any discount. Available only for
`paymentType=periodicPayment`. This value is unrounded.

  - `data.atActivation.expectedPayments.unroundedPrincipalAmount` (string)
    The portion of the `amount` allocated to principal. Available only for `paymentType=periodicPayment`.
This value is unrounded.

  - `data.atOrigination` (object)
    This object contains loan details and terms as they were shown to a borrower at origination.

  - `data.atOrigination.advanceSchedule` (array)
    The advance schedule of the loan. Total amount of the advances must be equal to `amountFinanced`. If `advanceSchedule` is passed,
the system will calculate the APR based on the special formula provided in
[Appendix J](https://www.ecfr.gov/cgi-bin/text-idx?SID=747961e095035658cdddba8b09d30a6f&mc=true&node=pt12.9.1026&rgn=div5#ap12.9.1026.0000_0nbspnbspnbsp.j)
(see examples of loans with multiple advances).

  - `data.atOrigination.advanceSchedule.advanceDate` (string, required)
    The date of the advance in the product timezone. The date cannot be in the past or greater than the last due date.
- If the advance is created in `pending` or `settled` status, the advance will be recorded in the ledger with an effective timestamp of
the Create advance call.
- If the advance is created in `scheduled` status, the advance will be recorded in the ledger only when the status changes to `pending` or `settled`.

  - `data.atOrigination.advanceSchedule.advanceDetails` (object)
    The details of advance.

  - `data.atOrigination.advanceSchedule.advanceDetails.categoryId` (string)
    The category identifier of the advance.

  - `data.atOrigination.advanceSchedule.advanceDetails.description` (string)
    The description of the advance. Normally shown in Borrower Portal and on statements. At least one of the attributes, `description`
or `merchantName` must be passed.

  - `data.atOrigination.advanceSchedule.advanceDetails.merchantId` (string)
    The merchant identifier that the advance was used for.

  - `data.atOrigination.advanceSchedule.advanceDetails.merchantName` (string)
    The merchant name that the advance was used for. At least one of the attributes, `description` or `merchantName` must be passed.

  - `data.atOrigination.advanceSchedule.advanceDetails.metadata` (object)
    Store any type of key/value pairs in the form of a JSON dictionary.

  - `data.atOrigination.advanceSchedule.advanceDetails.pointOfSaleType` (string)
    - `online` - the advance was made online on a website or in a mobile application.
- `physical` - the advance was made in a store with a physical card or instrument.
- `recurring` - the advance was made as part of a subscription service.
    Enum: "online", "physical", "recurring"

  - `data.atOrigination.advanceSchedule.amount` (number, required)
    The amount of advance. The amount must be positive.

  - `data.atOrigination.advanceSchedule.canceledBy` (string)
    Identifier of the `User` who canceled the advance.

  - `data.atOrigination.advanceSchedule.externalId` (string)
    A lender's identifier for a resource.
After the resource is successfully created, a lender can use the Peach assigned ID OR
the `externalId` identifiers to fetch the resource.
### Fetching with `externalId`:
To fetch a resource using an `externalId`, you MUST use the prefix `ext-` in the URL.
For example, a loan with an external identifier of `ABCDE` would be referenced like `/api/people/BO-FAKE-IDNT/loans/ext-ABCDE`.
### Creating with `externalId`:
To create a resource with an external identifer, you MUST NOT use the prefix `ext-`.
For example, if the external identifier should be `ABCDE`, then pass
`{ externalId: "ABCDE", ... }` in the request body.

  - `data.atOrigination.advanceSchedule.id` (string)
    The unique identifier of the purchase.

  - `data.atOrigination.advanceSchedule.metadata` (object)
    Store any type of key/value pairs in the form of a JSON dictionary.

  - `data.atOrigination.advanceSchedule.originalAmount` (number)
    The original amount of the advance. The amount must be positive.

  - `data.atOrigination.advanceSchedule.status` (string, required)
    - `scheduled` - the advance was scheduled in the future. If the advance status doesn't change to `pending`, `settled` or `canceled` on the advance due
date, the system will automatically cancel the advance on the following calendar day (aka change the status to `canceled`).
For example: An advance was `scheduled` for May 27, 2021. On May 28, 2021, the advance status was still `scheduled`. The system will cancel the advance.
- `settled` - the advance was settled and/or funded. `settled` advances increase the loan balance.
- `pending` - the advance is pending. `pending` advances increases the loan balance similar to `settled`. `pending` status is used mainly for visuals
and normally shown in Borrower Portal.
- `canceled` - the advance was canceled. `canceled` advances reduce the draw balance. A new advance cannot be created in `canceled` status.
    Enum: "scheduled", "settled", "pending", "canceled"

  - `data.atOrigination.advanceSchedule.timestamps` (object)

  - `data.atOrigination.advanceSchedule.timestamps.canceledAt` (string)

  - `data.atOrigination.advanceSchedule.timestamps.createdAt` (string)

  - `data.atOrigination.advanceSchedule.timestamps.updatedAt` (string)

  - `data.atOrigination.amortizationMethod` (string)
    Loan amortization method.
`equalPayments` - the system will amortize the loan or draw making recurring payments equal (except maybe for the last payment).
Most installment loans are expected to use this method.
`interestPaymentsBalloonPrincipal` - the system will amortize the loan or draw making recurring payments equal to interest only
and the last payment will include the entire principal. Keep in mind that if you set `interest.periodAccrualDurationType=actual`,
the recurring payment amounts will be different every period for monthly and twice monthly frequencies. This is because a month
can have 28, 29, 30 or 31 days and interest accrued will vary based on the number of days in the month.
There are additional limitations to be aware for `interestPaymentsBalloonPrincipal`. For installment loans, Autopay can only be
aligned to due dates. It means that `autoPay.allowedFrequency.isDueDatesAvailable` must be set to `false`. This way the system
will only allow Autopay to be aligned to the loan frequency and due dates.
    Enum: "equalPayments", "interestPaymentsBalloonPrincipal", "custom"

  - `data.atOrigination.amountFinanced` (number)
    The amount financed. The amount of money a borrower received from the lender, minus the upfront fees (e.g. origination fee) the lender is charging the borrower.

  - `data.atOrigination.aprEffective` (number)
    The effective APR of the loan at origination. Pass both `aprNominal` and `aprEffective` even if they are equal.

  - `data.atOrigination.aprNominal` (number)
    The nominal APR of the loan at origination. Pass both `aprNominal` and `aprEffective` even if they are equal.

  - `data.atOrigination.bufferToPushOutSchedule` (number)
    The number of calendar days that will be added to the activation date. The resulting date will be used to push out
due dates as if the loan was activated on that date (activation date + buffer). Interest will still be accrued
normally from the activation date. Not valid for the singleTerm frequency.

  - `data.atOrigination.discountProgramIds` (array)
    The identifiers of the discount programs provided at origination. A discount program
has to be created before it can be applied to loans.

  - `data.atOrigination.downPaymentAmount` (number)
    The amount of down payment made when the loan was originated. The value should be equal to what a
borrower agreed to and signed at origination.

  - `data.atOrigination.duration` (number)
    The duration of the loan as a number of `paymentFrequency` periods.
For example:
- if `paymentFrequency=monthly` and `duration=6`, it is a loan with 6 months duration and will have 6 due dates.
- if `paymentFrequency=weekly` and `duration=24`, it is a loan with 24 weeks duration and will have 24 due dates.

  - `data.atOrigination.enforcedEndDate` (string)
    The enforced end date of the loan in the product timezone. If the `enforcedEndDate` is not provided, it will be set at `activation`.
If `enforcedEndDate` and `expectedPayments` are provided, the last
payment due date MUST match `enforcedEndDate`.

  - `data.atOrigination.expectedPayments` (array)
    Expected payments schedule for the loan at origination. The dates and amounts
are exactly what a borrower agreed to and signed.

  - `data.atOrigination.expectedPayments.amount` (number, required)
    The total amount of the payment. The total amount is equal to: `principalAmount` + `interestAmount`

  - `data.atOrigination.expectedPayments.date` (string, required)
    Due date.

  - `data.atOrigination.expectedPayments.dynamicFeeDetails` (object)
    When `paymentType`=`dynamicFee` this will contain details of the dynamic fee.

  - `data.atOrigination.expectedPayments.dynamicFeeDetails.chargeTimeOfDay` (object)
    See description of the `chargeDate`. The value can be provided only if the `chargeDate` attribute is passed. If `chargeTimeOfDay` is not provided,
the Peach system will determine and set the time of day.

  - `data.atOrigination.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.hour` (integer, required)
    The hour. Value range is 0-23. 0=Midnight...23=11 PM.

  - `data.atOrigination.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.minute` (integer, required)
    The minute. Value range is 0-59.

  - `data.atOrigination.expectedPayments.dynamicFeeDetails.chargeTimeOfDay.second` (integer)
    The second. Value range is 0-59.

  - `data.atOrigination.expectedPayments.dynamicFeeDetails.dynamicFeeTypeId` (string)
    The dynamic fee type identifier in the system.

  - `data.atOrigination.expectedPayments.interestAmount` (number)
    The portion of `amount` allocated to interest (before any promo date(s) or discount). Required when `paymentType`
is `periodicPayment`

  - `data.atOrigination.expectedPayments.interestBeforeDiscountAmount` (number)
    The amount of interest discount.

  - `data.atOrigination.expectedPayments.isForcedAmount` (boolean)
    Only applicable to `paymentType=periodicPayment`.
If set to `true`, the system will honor the amount and will not update it on loan recalculations.
If set to `false` and the amount is less than the `periodicPaymentAmount`, the system can increase the amount when
the loan is being recalculated.
In most of the cases, the lender should set the value to `false` (aka the default value.) If you need more
explanation or advice on your use case, please contact the Peach team.

  - `data.atOrigination.expectedPayments.paymentType` (string, required)
    The payment type.
    Enum: "periodicPayment", "originationFee", "drawFee", "dynamicFee", "downPayment", "discountCredit"

  - `data.atOrigination.expectedPayments.principalAmount` (number)
    The portion of the `amount` allocated to principal. Required when `paymentType` is `periodicPayment`

  - `data.atOrigination.expectedPayments.unroundedInterestAmount` (string)
    The portion of the `amount` allocated to net interest. Available only for `paymentType=periodicPayment`.
This value is unrounded.

  - `data.atOrigination.expectedPayments.unroundedInterestBeforeDiscountAmount` (string)
    The interest amount that was accrued before promo rate(s) or any discount. Available only for
`paymentType=periodicPayment`. This value is unrounded.

  - `data.atOrigination.expectedPayments.unroundedPrincipalAmount` (string)
    The portion of the `amount` allocated to principal. Available only for `paymentType=periodicPayment`.
This value is unrounded.

  - `data.atOrigination.fees` (object)
    The loan fees.

  - `data.atOrigination.fees.dynamicFees` (array)
    Dynamic fees details.
Applicable if your loan type has dynamic fee(s) pre-defined and fee(s) amount are different among loans.
Also, for a Line of Credit, this configuration is used to set a dynamic fee type on a selected draw when a dynamic fee type is
configured with `appliedToDraws` is `True` and `drawApplicationLogic` is `selectedDraws`.
Currently, the following dynamic fee types are supported: `purchaseFee`, `foreignTransactionFee`, `lateFee`, `serviceFee`, `nsfFee`.
Please note `lateFee` and `nsfFee` can only be configured on a single draw.

  - `data.atOrigination.fees.dynamicFees.apiName` (string)
    The API name of the dynamic fee. For example: `lateFee` or `breatherFee`.
If applicable, `purchaseFee` or `foreignTransactionFee` `apiName` must be included, so it is applied to a specific draw.
Please confirm configs with the Peach team to ensure purchase fees are correctly configured.
When both `apiName` and `dynamicFeeTypeId` are provided, `apiName` is preferred.

  - `data.atOrigination.fees.dynamicFees.dynamicFeeTypeId` (string)
    Public ID of the dynamic fee type (for example, `FT-XXXX-XXXX`). Alternative to `apiName`.
When both `apiName` and `dynamicFeeTypeId` are provided, `apiName` is preferred.

  - `data.atOrigination.fees.dynamicFees.feeAmount` (number)
    The fee amount that will be charged recurrently. Only required if the dynamic fee `amountLogic` is configured as
`type=passedAtOrigination`. In all other cases, the system will calculate the fee based on pre-configured logic.

  - `data.atOrigination.fees.dynamicFees.feeCapAmount` (number)
    The maximum amount of the dynamic fee that can be charged over the life of the loan or draw. Only required if the dynamic fee
`capLogic` is configured as `type=capPassedAtOrigination`. In all other cases, the system will calculate the fee based on pre-configured
logic.

  - `data.atOrigination.fees.originationFeeAmount` (number)
    The amount of the origination fee.

  - `data.atOrigination.fees.serviceFeeAmount` (number)
    **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeAmount`.
The service fee amount that will be charged recurrently. Only required if the service fee `amountLogic` is configured as
`type=passedAtOrigination`. In all other cases, the system will calculate the fee based on pre-configured logic.

  - `data.atOrigination.fees.serviceFeeCapAmount` (number)
    **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeCapAmount`.
The maximum amount of the service fee that can be charged over the life of the loan or draw. Only required if the service fee
`capLogic` is configured as `type=capPassedAtOrigination`. In all other cases, the system will calculate the fee based on pre-configured
logic.

  - `data.atOrigination.fees.totalOtherFeesAmount` (number)
    The total amount of non-origination fees that are expected to be charged on the loan. The value should be
equal to what a borrower agreed to and signed at origination.

  - `data.atOrigination.interestRates` (array)
    Interest rates for the loan or the draw. Can be a single interest rate for the entire duration of the loan/draw.
Or, it can be multiple interest rates for partial periods of the loan/draw. If draw-specific rates are not passed,
the draw will use the LOC rates.

  - `data.atOrigination.interestRates.days` (integer, required)
    Number of calendar days the interest rate applies to. An entry with `days: null` is required
at the end of the list to indicate that the interest rate applies to the end of the loan duration.
For example:
`{"days": 30, "rate": 0.1},`
`{"days": 60, "rate": 0.2},`
`{"days": null, "rate": 0.25}`
The loan will accrue interest of 10% for the first 30 days. Between days 31-90
the loan will accrue interest of 20%. From day 91 until the end, the loan will accrue
interest of 25%.

  - `data.atOrigination.interestRates.interestType` (string)
    The interest type. The interest type cannot be changed after the loan or draw status changes to `originated` and onward.
`absolute` - interest rates defined as `absolute` will use the value as provided here without adding the Index Interest Rate.
- Negative interest `rate` value is not allowed.
- If the provided `rate` is outside of the range defined on the loan type, the system will accept the `rate` but will return a warning in the response's object `ratesValidation`.

`spread` - interest rates defined as `spread` will calculate an absolute rate by adding the relative loan rate (aka spread)
provided in the `rate` attribute to the Index Interest Rate effective on the date the interest is accrued.
In case the Index Interest Rate is not set, the system will assume that the Index Interest Rate value is zero on the date the interest is accrued.
- Negative interest spread `rate` value is allowed, but the system will default to zero if the addition of the Index Interest Rate still results in a negative rate.
- If the calculated absolute rate, `rate` (aka spread) plus Index Interest Rate, is outside of the range defined on the loan type, the system will accept the `rate` but will return a warning in the response's object `ratesValidation`.
    Enum: "absolute", "spread"

  - `data.atOrigination.interestRates.rate` (number, required)
    The annual interest rate for the period defined. The format is decimal.
For example, 0.01 is a 1% annual rate, 0.2 is a 20% annual rate.

  - `data.atOrigination.investors` (array)
    A list of the investors who owned the loan at origination.
If none are provided, it defaults to the default investor configured for the lender.

  - `data.atOrigination.investors.investorId` (string, required)
    The Investor's unique identifier, internal or lender's external.

  - `data.atOrigination.investors.metro2` (object)

  - `data.atOrigination.investors.metro2.reportK2Segment` (boolean)
    Only applicable to loans that are reported to credit bureaus.
If `true`, the system will report the K2 segment in the Metro2 file
to indicate that the loan has been sold to a new investor. Peach
will continue to report the loan.
If `false`, the system will not report the K2 segment in the Metro2
file. Peach will continue to report the loan.

  - `data.atOrigination.investors.share` (number, required)
    The ownership percentage of the loan. The format is decimal. For example, 0.01 is 1% ownership and 0.15 is 15% ownership.

  - `data.atOrigination.investors.effectiveDate` (string)
    The date at which this ownership structure came into effect.

  - `data.atOrigination.isValidMerchantId` (boolean)
    `true` - if the merchant ID exists in Peach Merchants table.
`false` - if the merchant ID doesn't exist in Peach Merchants table.
Credit card lenders normally should not create merchants details in Peach and `isMerchantIdValid` attribute can be ignored.
Point of sale lenders normally have merchants details in Peach and can use `isMerchantIdValid` attribute as needed.

  - `data.atOrigination.itemsOrServicesFinanced` (string)
    Merchandise, services or other value provided in exchange for the debt. For example: refrigerator
or kitchen renovation. This description is used in communications with the borrower, when needed.

  - `data.atOrigination.mdr` (object)
    This object represents optional configurations for the MDR (Merchant Discount Rate). When POS (point of sale)
lenders issue loans, the merchant pays some percentage of the financed amount - called the MDR.

  - `data.atOrigination.mdr.mdrRate` (number)
    The Merchant Discount Rate (MDR). The format is decimal. For example, 0.03 is a 3% annual rate, 0.2 is a
20% annual rate. If `mdrAmount` is not passed, the system will calculate the `mdrAmount` by multiplying
the `amountFinanced` by the `mdrRate`.

  - `data.atOrigination.mdr.amortizationPeriod` (number)
    Number of calendar days. If a value is passed, the system will amortize the `mdrAmount` over the `amortizationPeriod`
number of calendar days.
If a value is not passed or the value exceeds the loan life, the system will amortize the MDR amount over the life of
the loan. For Line of Credit, it is required to provide the `amortizationPeriod`. For Installment loans, it is
recommended to leave the value empty.

  - `data.atOrigination.mdr.isAmortized` (boolean)
    `true` to amortize the `mdrAmount` using the straight-line amortization method over the life of the loan.
`false` to recognize the `mdrAmount` as revenue in full on the day when the loan is activated.

  - `data.atOrigination.mdr.mdrAmount` (number)
    The Merchant Discount Amount.

  - `data.atOrigination.merchantId` (string)
    A lender's identifier for the merchant.

  - `data.atOrigination.originatingCreditorName` (string)
    The name of an entity that originated the loan. For example: Bank of Mars. This name will be
used in communications with the borrower when needed.

  - `data.atOrigination.originationLicense` (string)
    The license that was used to originate the loan.
    Enum: "nationalBank", "stateLicense", "bankSubsidiary", "stateBank"

  - `data.atOrigination.paymentFrequency` (string)
    The payment frequency of the loan.
`weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly` - are recurring.
`singleTerm` - a single term loan (aka non-recurring). It will create one period only with a desired "duration" of 30,
60, 90, 120, X calendar days or a specific date that should be passed in specificDays. For example [90].
    Enum: "weekly", "everyTwoWeeks", "twiceMonthly", "monthly", "singleTerm"

  - `data.atOrigination.periodicPaymentAmount` (number)
    The amortized periodic payment amount excluding fees. Keep in mind that the last payment
can be different from the `periodicPaymentAmount`. Required when passing in `expectedPayments`
at origination.

  - `data.atOrigination.personAddress` (object)
    The mailing address.

  - `data.atOrigination.personAddress.POBox` (string)
    Post Office Box

  - `data.atOrigination.personAddress.addressLine1` (string)
    Address line 1.
If `company.allowPartialAddress=false`, then this field is required, else it is not required

  - `data.atOrigination.personAddress.addressLine2` (string)
    Address line 2.

  - `data.atOrigination.personAddress.city` (string)
    City.

  - `data.atOrigination.personAddress.country` (string, required)
    Country. English short name according to
[ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.

  - `data.atOrigination.personAddress.countyOrRegion` (string)
    County or region.

  - `data.atOrigination.personAddress.object` (string)
    Enum: "address"

  - `data.atOrigination.personAddress.postalCode` (string, required)
    Postal code. Also known as ZIP code.

  - `data.atOrigination.personAddress.state` (string)
    State/Province. This is a required field if the country is US or CA.

  - `data.atOrigination.personAddress.timezone` (string)
    Timezone for the address.

  - `data.atOrigination.principalAmount` (number)
    The amount of principal at origination. Lenders should only pass this value if `principalAmount` is different from `amountFinanced`.
If a value is provided, the system will use `principalAmount` as the loan principal for interest calculations and amortization. The value should be greater than `amountFinanced`.
If a value is not provided, the system will:
- Set `principalAmount = amountFinanced`.
- Use `amountFinanced` as the loan principal for interest calculations and amortization.

  - `data.atOrigination.promoRates` (array)
    The promotional interest rates (aka rate discounts) for the loan or the draw.
Can be a single promo rate for the entire duration of the loan/draw.
Or, it can be multiple promo rates for partial periods of the loan/draw.
For example, if the `interestRate` is 20% for the first 90 days and the `promoRate` has value
5% for 30 days, then the effective rate for the first 30 days is 15%.
The promo rates are unconditional and will be applied regardless of the loan status.

  - `data.atOrigination.promoRates.days` (integer)
    Number of calendar days the promo rate applies to. Use `null` to indicate that
the promo rate applies to the end of the loan duration.
For example:
`{"days": 30 ,"rate": 0.1},`
`{"days": null, "rate": 0.01}`
The loan will receive interest discount of 10% for the first 30 days.
From day 31 until the end, the loan will receive interest discount of 1%.

  - `data.atOrigination.promoRates.rate` (number)
    The annual promo rate for the period defined. Loans cannot accrue negative interest rate.
If the promo rate is greater than the interest rate, a loan will accrue 0% interest rate.
The format is decimal. For example, 0.01 is a 1% annual rate, 0.15 is a 15% annual rate.

  - `data.atOrigination.rateCaps` (array)
    Rate caps that should apply to the loan at origination.
When the loan is created these rate caps are created and
applied to the loan. They will be accessible via the `.../rate-caps` endpoint.

  - `data.atOrigination.rateCaps.days` (number, required)
    Number of calendar days the rate cap applies from loan origination.
If null, the rate cap applies for the entire loan term.
For example:

```
[{"days": 30, "maxRate": 0.1},
{"days": 60, "maxRate": 0.2},
{"days": null, "maxRate": 0.25}]
```
The loan will accrue interest with a rate cap of 10% for the first 30 days.
Between days 31-90 the loan will accrue interest with a rate cap of 20%.
From day 91 until the end, the loan will accrue interest with a rate cap of 25%.

  - `data.atOrigination.rateCaps.maxRate` (number, required)
    The maximum spread interest rate that can accrue.
If the calculated rate on a given day is greater than `maxRate`, then the system will
cap the rate and accrue a maximum of `maxRate` on the loan. Else, we will use the calculated rate.
Format is decimal. For example, 0.36 is 36% annual rate cap.

  - `data.atOrigination.rateCaps.rateCapReason` (string, required)
    The reason for `maxRate`. This is not used for any compliance logic, only for informational purposes.
- `MLA` - Military Lending Act (36% cap for active duty military)
- `SCRA` - Servicemembers Civil Relief Act
- `federal` - Other federal regulations
- `state` - State-specific regulations
- `other` - Other regulatory or business reasons
    Enum: "MLA", "SCRA", "federal", "state", "other"

  - `data.atOrigination.skipCreditReporting` (boolean)
    Set to `true` if the loan should not be reported to the credit agencies when activated.

  - `data.atOrigination.specificDays` (array)
    Specific days designate the day(s) that due dates will fall on. The allowed values for specific
day(s) depends on the `paymentFrequency`.
`weekly` - provide one number in the valid range 1-7. 1=Monday...7=Sunday.
For example: [1].
`everyTwoWeeks` - provide two inputs. The first input (required) is an integer in the valid range 1-7. 1=Monday...7=Sunday.
The second input is a date that indicates when to start the cycle. If the second input is not passed, the system will default
to the first valid start date based on the first input (the day of week passed in). If this date is provided then it can override
the minimum due date gap specified on the loan type.
For example: [1, "2020-09-16"].
`twiceMonthly` - provide two numbers in the valid range 1-31. 1=first day of a month. Use 31 to
indicate the last day of a month.
For example: [1, 15] or [15, 31].
`monthly` - provide one or two numbers, depending on the loan type `periodCalculationType` configuration:
- If `periodCalculationType=dueDate`, then provide one number in the valid range 1-31. This is the recurring due date. 1=first
day of a month. Use 31 to indicate the last day of a month. For example: [1].
- If `periodCalculationType=statementDate`, then provide one number in the valid range 1-31. This is the recurring statement date.
1=first day of a month. Use 31 to indicate the last day of a month. For example: [1].
- If `periodCalculationType=fixedStatementAndDueDates`, then provide two numbers. First number represents a recurring statement
date and the valid range is 1-31. Use 31 to indicate the last day of a month. Second number represents a recurring due date and
the valid range is 1-28. Two numbers must be different. For example: [1, 15] - statements are on 1st and due dates are on 15th.
Notes:
  - If the due date precedes the statement day, it's pushed to the next month. For example: [20, 10] and today is Oct 1, 2024. The
first statement date is Oct 20, 2024 and the first due date is Nov 10th.
  - For February in non-leap years, if the statement date is ≥ 29 and the due date is 28, the statement date becomes March 1st.

`singleTerm` - provide one number to indicate duration as a number of calendar days or provide a valid calendar date in the
future. This option is only valid for use on the installment type and at loan origination.
For example: [90] or ["2020-09-16"].
For `weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly`:
If specificDays is left null, then the system will calculate due dates according to the paymentFrequency relative
to the origination or activation date (or use existing specific days in the case of change due date).
For `singleTerm`:
The specificDays is mandatory.

  - `data.atOrigination.totalDiscountAmount` (number)
    The total amount of discount at origination as a result of promo rates. The value should be equal to what
a borrower agreed to and signed at origination.

  - `data.atOrigination.totalInterestAmount` (number)
    The total amount of interest the loan should accrue. The value should be equal to what a borrower agreed
to and signed at origination. Because of rounding issues, the total of expected payments `interestAmount`
might be different from `totalInterestAmount`.

  - `data.atOrigination.totalInterestCapAmount` (number)
    The maximum amount of interest the borrower will ever pay.
If not applicable, set to `null`.

  - `data.atOrigination.validAddress` (boolean)
    Identifies the address at origination as valid or invalid.

  - `data.atOrigination.promoPrograms` (array)
    The list of promotional programs that the loan is eligible for.

  - `data.atOrigination.promoPrograms.disqualifyOverdueDays` (integer)
    The number of loan overdue days that would disqualify the
promotional program.
Any occurrence of `disqualifyOverdueDays` or more of number
days overdue during the promotional period would disqualify
(aka cancel) the promotional program.

  - `data.atOrigination.promoPrograms.externalId` (string)
    A lender's unique identifier for a specific promotional
program.

  - `data.atOrigination.promoPrograms.metaData` (object)
    Store any type of key/value pairs in the form of a JSON
dictionary.

  - `data.atOrigination.promoPrograms.promoDurationDays` (integer)
    The promotional program duration as a number of calendar
days.
If `promoDurationDays` is passed, the system will calculate
the `promoEndDate`.
Pass only one of the attributes, `promoEndDate` or
`promoDurationDays`.

  - `data.atOrigination.promoPrograms.promoEndDate` (string)
    The promotional program end-date without a potential grace
period.
If `promoEndDate` is passed, the system will calculate the
`promoDurationDays`.
Pass only one of the attributes, `promoEndDate` or
`promoDurationDays`.
This date field should be in the product timezone.

  - `data.atOrigination.promoPrograms.promoGracePeriodDays` (integer)
    The promotional program grace period as a number of calendar days.
Grace period allows the borrower to exercise the promotional program
for an additional number of days after it expires.

If you don't pass a value, the system will assume zero (aka no grace
period).

  - `data.atOrigination.promoPrograms.promoStartDate` (string)
    The `promoStartDate` date marks the start date from which a
promotional program is valid and will be evaluated to be exercised.
When a promo program is created with `promoDurationDays` specified,
the `promoStartDate` is also used to calculate the `promoEndDate`.
For installment loans:
- The `promoStartDate` can be a date in the future but not after the
loan's last due date.
The promotion is valid and evaluated after it has been activated
and the `promoStartDate` arrived.
- The `promoStartDate` can be a date in the past but not before the
loan's activation date.
- The `promoStartDate` is optional.
If the value is not passed, the system will set the promoStartDate
to the loan activation date.
- For `Same as Cash` promo programs, the waiving of interest benefit
will be added from the loan activation date for the entire life of
the loan for installment loans, regardless of the
`promoStartDate`.

For Line of Credit draws:
- The `promoStartDate` can be a date in the future.
The promotion is valid and evaluated after it has been activated
and the `promoStartDate` arrived.
- The `promoStartDate` cannot be a date in the past.

If a value is not passed, the system will set the `promoStartDate`
to be the date of the activation.
This date value should be in the product timezone.

  - `data.atOrigination.promoPrograms.promoTypeId` (string, required)
    The promotional program type's unique identifier.

  - `data.atOrigination.promoPrograms.status` (string, required)
    The promotional program status.
`pending` - the promotion was created but was not activated yet.
`active` - the promotion is active.
For promo program creation, `installment` loans can be
created in either `pending` or `active` status.
For line of credit / draws, a promo program can only be
created in `pending` status and transitioned to `active`
status via the promo program activate endpoint.
    Enum: "pending", "active"

  - `data.atOrigination.promoPrograms.id` (string)
    The promotional program's unique identifier.

  - `data.current` (object)
    This object contains some loan details that were modified after origination.

  - `data.current.autopayEnabled` (boolean)
    Whether Autopay is enabled for this loan.

  - `data.current.duration` (integer)
    The duration of the loan as a number of `paymentFrequency` periods.
For example:
- if `paymentFrequency=monthly` and `duration=6`, it's a loan with 6 months duration and will have 6 due dates.
- if `paymentFrequency=weekly` and `duration=24`, it's a loan with 24 weeks duration and will have 24 due dates.

  - `data.current.paymentFrequency` (string)
    The payment frequency of the loan.
`weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly` - are recurring.
`singleTerm` - a single term loan (aka non-recurring). It will create one period only with a desired "duration" of 30, 60, 90, 120, X calendar days or a specific date that should be passed in specificDays. For example [90].
    Enum: "weekly", "everyTwoWeeks", "twiceMonthly", "monthly", "singleTerm"

  - `data.current.periodicPayment` (number)
    The most recent amortized periodic payment that was calculated on `lastAmortizedAt`.

  - `data.isClosed` (boolean)
    Indicates whether the loan with multiple advances is closed. If `true` and the loan type installment with multiple advances, new Advances
cannot be created, and the advance schedule cannot be updated.

  - `data.muteLoanNotices` (boolean)
    Indicates whether the system should stop/pause sending loan related notices to the borrower. Set to true if you want to mute all loan related notices (e.g. loanDetails. autopayEnabled, paymentFailed, etc.) Keep in mind that it will also stop all notices related to the loan that are sent from Peach Agent Portal by an agent.
Note: this is not the only attribute that can stop notices from being sent. Compliance Guard and Cases Do Not Interact can also block communications.

  - `data.nickname` (string)
    The loan's nickname. Nickname is a friendly name of the loan and is displayed in the UI.
Nickname is different from loan ID. Nickname can be changed by a borrower.

  - `data.object` (string)
    Enum: "installment"

  - `data.ratesValidation` (object)
    This object contains information on whether actual rates exceed the rate ranges defined on the loan type.

  - `data.ratesValidation.interestRateAtOrigBelowMin` (boolean)
    `true` if the interest rate at origination is below the minimum interest rate.

  - `data.ratesValidation.interestRateAtOrigExceedsMax` (boolean)
    `true` if the interest rate at origination exceeds the maximum interest rate.

  - `data.ratesValidation.aprEffectiveAtActExceedsMax` (boolean)
    `true` if the effective APR at activation exceeds the maximum APR.

  - `data.ratesValidation.aprEffectiveAtOrigExceedsMax` (boolean)
    `true` if the effective APR at origination exceeds the maximum APR.

  - `data.ratesValidation.aprNominalAtActExceedsMax` (boolean)
    `true` if the nominal APR at activation exceeds the maximum APR.

  - `data.ratesValidation.aprNominalAtOrigExceedsMax` (boolean)
    `true` if the nominal APR at origination exceeds the maximum APR.

  - `data.servicedBy` (string)
    The entity type that services the loan.
`creditor`, `thirdPartyServicer` - means that the loan is serviced on the Peach platform.
`debtCollectionAgency` - means that the loan is no longer serviced on the Peach platform. The loan can be still visible in Borrower Portal. To clarify, the loan is not deleted from the Peach platform.
    Enum: "creditor", "thirdPartyServicer", "debtCollectionAgency"

  - `data.status` (string)
    The current status of the loan. New loans must be created in `pending`, `originated` or `declined` status.
`pending` - the loan is in the application stage. Loan `atOrigination` details and terms can be changed (via API).
`originated` - the loan was signed by the borrower and originated by the lender. Loan `atOrigination` details cannot be changed. Originated loans do not start accruing interest until activated.
`declined` - an application was declined. This is a terminal state.
`active` - the loan is active. Most loans are expected to be active.
`frozen` - the loan is temporarily frozen. The loan will not accrue any interest, no payments can be processed, and no notifications are sent to the borrower.
`accelerated` - the loan was accelerated. The loan will not accrue any additional interest and the entire balance is due.
`chargedOff` - the loan was charged off.
`paidOff` - the loan was successfully paid off.
`canceled` - the loan was canceled. Canceled loans are not shown in UI. This is a terminal state.
    Enum: "pending", "originated", "declined", "active", "frozen", "accelerated", "chargedOff", "paidOff", "canceled"

  - `data.type` (string)
    Enum: "installment"

  - `data.current` (object)

  - `data.current.autopayEnabled` (boolean)
    Is autopay enabled for this loan?

  - `data.current.creditLimitAmount` (number)
    The credit limit amount for the line or draw. Only applicable to line of credit or installment loan with multiple
advances. For installment loans with multi-advances, it is the amount financed set at origination.

  - `data.isClosed` (boolean)
    Indicates whether the LOC is closed. If `true`, new Draws or Purchases cannot be created. The system will continue to create
statements as long as there is unpaid balance.

  - `data.newDrawsAllowed` (boolean, required)
    Indicates if the borrower can make additional draws on the line.

  - `data.paymentHoldDays` (object)
    Determines how long the lender wants to wait until a payment affects the openToBuy amount in the
Get balances endpoint.

  - `data.paymentHoldDays.holdDayType` (string, required)
    Determines what type of day should be used to calculate the `holdDaysEndDate` on the transaction.
    Enum: "calendar", "business"

  - `data.paymentHoldDays.numHoldDays` (integer, required)
    The number of days Peach's system will wait until the loan's balance reflects the amount of payment.
For example, if `holdDayType=calendar` and a borrower makes a one time payment on October 10th (and
the payment status is `initiated` or `pending`):
`numHoldDays = 0`, the payment will increase the `openToBuyAmount` on the 10th.
`numHoldDays = 1`, the payment will increase the `openToBuyAmount` on the 11th.
`numHoldDays = 2`, the payment will increase the `openToBuyAmount` on the 12th.
`numHoldDays = 0` means no hold for both `calendar` and `business`: the payment increases the
`openToBuyAmount` on the day it is made, even if that day is a weekend or holiday. With `holdDayType=business`
and `numHoldDays` of 1 or more, a payment made on a weekend or holiday counts its hold days starting from the
next business day.

