# Create installment loan terms SCRA

Creates a customer payment plan for the borrower in accordance with SCRA regulations.
Only applicable to installment loans.

Endpoint: POST /people/{personId}/loans/{loanId}/payment-plan-scra
Version: 2023-11-29
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:

  - `sync` (boolean)
    Make the process synchronous.

## Request fields (application/json):

  - `annualRate` (number)
    The annual interest rate for the period defined. Format is decimal. For example, 0.01 is 1% annual rate, 0.2 is 20% annual rate.

  - `caseId` (string)
    An identifier for an existing case.

  - `endDate` (string,null, required)
    The end date of the period. The end date is inclusive.

  - `isCancelFees` (boolean)
    When set to true, the system will waive any fees that were charged during the period.

  - `sendNotice` (boolean)
    When set to false, the system will NOT send a loanPaymentScheduleChanged notice to the borrower.

  - `startDate` (string, required)
    The start date of the period. The start date is inclusive.

## Response 200 fields (application/json):

  - `count` (integer)
    Total number of items in this result.

  - `status` (integer)
    HTTP status code.

  - `data` (object)

  - `data.isLocked` (boolean)
    If true, the loan is in the middle of being updated or replayed. The returned data are not consistent. The caller should poll
on the Get loan lock status endpoint. Once isLocked becomes false`, the caller should call this endpoint again to get consistent data.

  - `data.paymentFrequency` (string)
    The expected payments' frequency.
    Enum: "weekly", "everyTwoWeeks", "twiceMonthly", "monthly"

  - `data.schedule` (array)

  - `data.schedule.amount` (number)
    The amount of the expected payment.

  - `data.schedule.date` (string)
    The due date of the expected payment.

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

  - `data.schedule.dynamicFeeDetails.apiName` (string)
    The API name of the dynamic fee. For example: 'lateFee' or 'breatherFee'.

  - `data.schedule.dynamicFeeDetails.displayName` (string)
    The display name of the dynamic fee as shown to the borrower in the UI. For example: Late Fee or Breather Fee.

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

  - `data.schedule.dynamicFeeDetails.loanFeeId` (string)
    The loan fee identifier in the system.

  - `data.schedule.interestAmount` (number)
    The portion of the amount allocated to net interest.
Available only for paymentType=periodicPayment.

  - `data.schedule.interestBeforeDiscountAmount` (number)
    The interest amount that was accrued before promo rate(s) or any discount.
Available only for paymentType=periodicPayment.

  - `data.schedule.isDeferred` (boolean)
    true if the amount of this expected payment has been deferred before.

  - `data.schedule.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.schedule.originalAmount` (number)
    The amount of the expected payment at creation. The amount will change as a result of refreshing
expected payments, but the originalAmount will stay the same.

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

  - `data.schedule.periodId` (string)
    The period identifier.

  - `data.schedule.principalAmount` (number)
    The portion of the amount allocated to principal.
Available only for paymentType=periodicPayment.

  - `data.schedule.status` (string)
    The status of the expected payment.

scheduled  - borrower is expected to make the payment. Only applicable to paymentType=dynamicFee.

booked - borrower is or was expected to make the payment.

modified - the amount was modified at some point and different from the original amount.

canceled - borrower is or was not expected to make the payment.
    Enum: "booked", "modified", "canceled"

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

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

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

  - `data.specificDays` (array,null)
    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.


