# Payment Plans

Payment plans are a specific type of hardship tool that can be used to create a temporary loan schedule for a borrower.
Lenders can create a payment plan by specifying the `paymentPlanType`, `numberOfPeriods` and `amount`. After the `numberOfPeriods`
ends, any remaining periods of the loan will be paid according to the originally scheduled recurring amount and frequency of the
loan at the time when the payment plan was created.

When the agreed upon recurring payment plan `amount` is less than the originally scheduled payment amount, the system uses
`isExtendLoanDuration` to ascertain whether to keep the existing loan `duration` or automatically extend the original loan `duration`.

When the agreed upon recurring payment plan `amount` is more than the originally scheduled recurring amount, the loan `duration`
will be shortened to the point where the remaining balance of the loan is paid off.

Only one active payment plan is allowed at a time. Please note that creating an active payment plan will overwrite changes
made to the loan schedule such as due date deferrals, change due date, and change loan terms. This is because the payment plan by
design creates a new loan schedule.

If a loan is on a payment plan, other hardship tools cannot be used. Lenders must cancel the payment plan and then make any required
loan modifications.

Payment plan is presently for installment only.


## Get payment plans

 - [GET /people/{personId}/loans/{loanId}/custom-payment-plans](https://docs.peachfinance.com/api-docs/api-public/payment-plans/peach.people.loans.handlers.loan_custom_payment_plan_get.md): Returns all payment plans associated with a loan.

## Create payment plan

 - [POST /people/{personId}/loans/{loanId}/custom-payment-plans](https://docs.peachfinance.com/api-docs/api-public/payment-plans/peach.people.loans.expected_payments.handlers.loan_custom_payment_plan_create.md): Creates a custom payment plan for the borrower. numberOfPeriods is required. If paymentPlanType=fixedAmountAndFees,
then the amount is required.

Only applicable to installment loans.

## Get payment plan by id

 - [GET /people/{personId}/loans/{loanId}/custom-payment-plans/{paymentPlanId}](https://docs.peachfinance.com/api-docs/api-public/payment-plans/peach.people.loans.handlers.loan_custom_payment_plan_get_by_id.md): Return a single payment plan.

## Cancel payment plan

 - [POST /people/{personId}/loans/{loanId}/custom-payment-plans/{paymentPlanId}/cancel](https://docs.peachfinance.com/api-docs/api-public/payment-plans/peach.people.loans.handlers.loan_custom_payment_plan_cancel.md): Use this endpoint to cancel a payment plan. Any existing payment plan must be canceled prior to creating a new payment plan.
After canceling a payment plan, Peach's system will revert the loan schedule (from the current period onwards) to the previous
recurring payment amount and frequency prior to creating the payment plan.

As a result of cancellation, the loan duration and loan end date will be adjusted to match with the last non-zero expected payment,
if required.

