# Add draw rate cap

This endpoint is used for adding rate caps to a draw. If two or
more rate caps overlap on the same date, we will use the lowest value.
This defines the maximum interest rate that can accrue on a draw
to ensure interest accrual never exceeds the cap. You can define the
`startDate` and `endDate` for each rate cap.
If a rate cap is added for past periods and the interest rate exceeds the cap,
we will replay the loan to apply the capped rate. If a rate cap is added for
past periods and the effective interest rate is unchanged, we will not replay the loan.
- Example: A borrower on active duty needs their rate capped at 36% per
MLA regulations. If no `rateCap` is set, an index rate change could increase
the loan rate beyond the regulatory limit.
- Original rate: 28% `spread` + 5% index rate = 33% (under cap)
- Updated rate: 28% `spread` + 9% index rate= 37% (over cap)

Endpoint: POST /people/{personId}/loans/{loanId}/draws/{drawId}/rate-caps
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.

  - `drawId` (string, required)
    The draw identifier.

## Request fields (application/json):

  - `endDate` (string)
    Rate cap end date in product timezone, inclusive. If null, applies until end of loan/draw.

  - `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.

  - `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"

  - `startDate` (string, required)
    Rate cap start date in product timezone, inclusive.

## Response 200 fields (application/json):

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

  - `status` (integer)
    HTTP status code.

  - `data` (object)
    The Rate Cap object represents the rate caps associated with each loan or draw.
Rate caps apply to both `spread` and `absolute` rate types. If two or more rate
caps overlap on the same dates, we will use the lowest value.

  - `data.createdAt` (string)
    When the rate cap was created.

  - `data.endDate` (string)
    Rate cap end date in product timezone, inclusive. If null, applies until end of loan/draw.

  - `data.id` (string)
    The rate cap identifier.

  - `data.maxRate` (number)
    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.rateCapReason` (string)
    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.startDate` (string)
    Rate cap start date in product timezone, inclusive.

  - `data.updatedAt` (string)
    When the rate cap was last updated.

