# Create Promise to Pay Plan

Creates a new `Promise to Pay Plan`.

Endpoint: POST /people/{personId}/loans/{loanId}/promise-to-pay-plans
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.

## Request fields (application/json):

  - `amount` (number)
    Amount required to be fulfilled for each period of the promise to pay plan. Peach's system will use the amount
provided to trigger any required promise `status` transitions.
Note:
- If `amount` is passed to the endpoint, ensure that `frequency` and `duration` are also provided.
- If you are providing an `amount` object, you should not pass the `schedule`. In case both are provided in the
request, a `400 Bad Request error` will be returned.

  - `caseId` (string)
    The ID of the case associated with the promise to pay plan.

  - `duration` (integer)
    The duration of the promise to pay plan as a number of `frequency` periods. For example:
if `frequency=weekly` and `duration=6`, the promise will be created with 6 weeks duration and will have 6
periods all with the same amount.
Note:
- If `duration` is passed to the endpoint, ensure that `frequency` and `amount` are also provided.
- If you are providing a `duration` object, you should not pass the `schedule`. In case both are provided in the
request, a `400 Bad Request error` will be returned.

  - `externalId` (string)
    A lender's identifier for a promise to pay plan.
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.

  - `frequency` (string)
    The agreed payment frequency of the promise. Peach's system will use the desired frequency to create promise to pay period(s) so the lender can monitor progress against promised payment dates and amount paid.
`weekly`, `everyTwoWeeks`, `twiceMonthly`, and `monthly` options create multiple promise to pay periods, according to the `duration`.
`singleTerm` creates a promise with a single period and desired duration of X calendar days or a specific date that should be passed in `specificDays`.
Note:
- If `frequency` is passed to the endpoint, ensure that `duration` and `amount` are also provided.
- If you are providing a `frequency` object, you should not pass the `schedule`. In case both are provided in the
request, a `400 Bad Request error` will be returned.
    Enum: "weekly", "everyTwoWeeks", "twiceMonthly", "monthly", "singleTerm"

  - `previewMode` (boolean)
    In `previewMode=true`, the Promise to Pay Plan and corresponding Promise Period Objects will be
returned for preview without committing the object to database

  - `schedule` (array)
    To create a custom promise to pay schedule with varying amounts or irregular periods, pass a `schedule` when
creating the promise to pay plan.
Note:
Either `schedule` object or schedule descriptor attributes (`startDate`, `frequency`, `specificDays`
, 'duration' and 'amount') can be passed to create a promise to pay plan. In case both are provided in the
request, a `400 Bad Request error` will be returned.

  - `schedule.amount` (number)
    The promised amount.

  - `schedule.dueDate` (string)
    The due date of the promised amount.

  - `sendNotice` (boolean)
    When set to `true`, Peach's system will send a notice to the borrower about the promise to pay plan.
Note: If `sendNotice` is not passed, the system will default to `true`.

  - `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 number 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].
`singleTerm` - provide one number to indicate duration as a number of calendar days or provide a valid calendar date in the
future. 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.

  - `startDate` (string)
    The start date of the promise to pay plan. If `startDate` is not provided upon promise to pay plan creation,
the system will use the created date (i.e. "today") as the `startDate`. If `startDate` is provided, it must be a date in the future.
Notes:
- If you are providing a `schedule` object, you should not pass the `startDate`. In case both are provided in the
request, a `400 Bad Request error` will be returned.
- If Peach's system creates the schedule based on `frequency`,`specificDays` and `duration` passed, the system will
schedule Promise to Pay Periods starting after the `startDate`.

## Response 200 fields (application/json):

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

  - `status` (integer)
    HTTP status code.

  - `data` (object)

  - `data.createdAt` (string)

  - `data.deletedAt` (string)

  - `data.id` (string)
    The promise to pay plan ID.

  - `data.updatedAt` (string)

  - `data.cancellationReason` (string)
    The reason for canceling the promise to pay plan.
`canceledByUser` - Promise to pay plan was canceled by an agent or borrower.
`loanChargedOff` - loan was charged off during the promise period.
`loanAccelerated` - loan was accelerated during the promise period.
`otherPromisePlanOffered` - another promise plan was offered.
`other` - for any other reason requiring cancellation.
    Enum: "canceledByUser", "loanChargedOff", "loanAccelerated", "otherPromisePlanOffered", "other"

  - `data.caseId` (string)
    The ID of the case associated with the promise to pay plan.

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

  - `data.endDate` (string)
    The end date of the promise to pay plan, equal to the `dueDate` of plan's last promise period.

  - `data.externalId` (string)
    A lender's identifier for a promise to pay plan.
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.isOverdue` (boolean)
    The borrower has not met one or more promised amounts by the promised due date.

  - `data.loanId` (string)
    The unique loan identifier that the promise belongs to.

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

  - `data.reasonDetails` (string)
    Additional details about the reason for canceling the promise to pay plan.

  - `data.schedule` (array)
    Promise to pay plan periodId(s) and amount(s).

  - `data.schedule.amount` (number)
    Amount of the promise to pay period.

  - `data.schedule.dueDate` (string)
    The due date of the promised amount.

  - `data.schedule.object` (string)
    Enum: "promisePeriod"

  - `data.schedule.periodId` (string)
    Unique identifier of the period created for the promise to pay plan.

  - `data.schedule.startDate` (string)
    The period start date.

  - `data.startDate` (string)
    The start date of the promise to pay plan, equal to the `startDate` of plan's first promise period.

  - `data.status` (string)
    The status of the promise to pay plan.
`scheduled` - promise to pay has been created but has not yet started. Typically used when the lender wants to
start a promise as of a specific date. Communications will not be triggered and tasks will not be assigned to
agents for promise to pay plans in `scheduled` status. Peach's system will transition the status of the promise
to pay plan to `active` on the `startDate` unless the lender cancels the promise to pay beforehand.
`active` - promise to pay plan is in effect. To check if the borrower is on and behind the schedule, see the ` isOverdue` attribute.
`kept` - promise to pay final period end date has passed and the borrower has met the promised amount(s) by the
promise's final period end date. This status is a terminal state.
`broken` - promise to pay final period end date has passed and the borrower has not met the promised amount(s)
by the promise's final period end date. This status is a terminal state.
`canceled` - promise to pay plan was canceled. This status is a terminal state.
    Enum: "scheduled", "active", "kept", "broken", "canceled"

## Response 201 fields (application/json):

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

  - `status` (integer)
    HTTP status code.

  - `data` (object)

  - `data.createdAt` (string)

  - `data.deletedAt` (string)

  - `data.id` (string)
    The promise to pay plan ID.

  - `data.updatedAt` (string)

  - `data.cancellationReason` (string)
    The reason for canceling the promise to pay plan.
`canceledByUser` - Promise to pay plan was canceled by an agent or borrower.
`loanChargedOff` - loan was charged off during the promise period.
`loanAccelerated` - loan was accelerated during the promise period.
`otherPromisePlanOffered` - another promise plan was offered.
`other` - for any other reason requiring cancellation.
    Enum: "canceledByUser", "loanChargedOff", "loanAccelerated", "otherPromisePlanOffered", "other"

  - `data.caseId` (string)
    The ID of the case associated with the promise to pay plan.

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

  - `data.endDate` (string)
    The end date of the promise to pay plan, equal to the `dueDate` of plan's last promise period.

  - `data.externalId` (string)
    A lender's identifier for a promise to pay plan.
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.isOverdue` (boolean)
    The borrower has not met one or more promised amounts by the promised due date.

  - `data.loanId` (string)
    The unique loan identifier that the promise belongs to.

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

  - `data.reasonDetails` (string)
    Additional details about the reason for canceling the promise to pay plan.

  - `data.schedule` (array)
    Promise to pay plan periodId(s) and amount(s).

  - `data.schedule.amount` (number)
    Amount of the promise to pay period.

  - `data.schedule.dueDate` (string)
    The due date of the promised amount.

  - `data.schedule.object` (string)
    Enum: "promisePeriod"

  - `data.schedule.periodId` (string)
    Unique identifier of the period created for the promise to pay plan.

  - `data.schedule.startDate` (string)
    The period start date.

  - `data.startDate` (string)
    The start date of the promise to pay plan, equal to the `startDate` of plan's first promise period.

  - `data.status` (string)
    The status of the promise to pay plan.
`scheduled` - promise to pay has been created but has not yet started. Typically used when the lender wants to
start a promise as of a specific date. Communications will not be triggered and tasks will not be assigned to
agents for promise to pay plans in `scheduled` status. Peach's system will transition the status of the promise
to pay plan to `active` on the `startDate` unless the lender cancels the promise to pay beforehand.
`active` - promise to pay plan is in effect. To check if the borrower is on and behind the schedule, see the ` isOverdue` attribute.
`kept` - promise to pay final period end date has passed and the borrower has met the promised amount(s) by the
promise's final period end date. This status is a terminal state.
`broken` - promise to pay final period end date has passed and the borrower has not met the promised amount(s)
by the promise's final period end date. This status is a terminal state.
`canceled` - promise to pay plan was canceled. This status is a terminal state.
    Enum: "scheduled", "active", "kept", "broken", "canceled"

