# Peach Finance API

# Introduction
This API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer).

Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses,
and uses standard HTTP response codes, authentication, and verbs.

You can use the API in test mode, which does not affect your live data. The API key you use to authenticate the
request determines whether the request is in live mode or test mode.

# Versioning

This API is versioned. For more information see [API Versioning Docs](https://docs.peachfinance.com/api-versioning).
For a list of available versions—and the breaking changes associated with them—see
[Breaking Changes](https://docs.peachfinance.com/api-docs/breaking-changes). (Requires Docs Hub login.)

# Pagination
Peach Finance API utilizes cursor-based pagination via the `startingAfter`
and `endingBefore` parameters. Both parameters take an existing Object ID
value and return objects in reverse chronological order. The `endingBefore`
parameter returns objects listed before the named object. The `startingAfter`
parameter returns objects listed after the named object. If both parameters
are provided, only `endingBefore` is used.

The size of the page can be limited using the `limit` parameter.
`limit` is optional; the default is 25 and can be between 1 and 100.
Sending both `startingBefore` and `endingAfter` is not currently supported.

Some endpoints will allow sending a `sortBy` parameter, enumerating the fields that can be used to
sort the results returned by that particular endpoint. For example, if the results can be sorted by
`createdAt` and `updatedAt`, then sending `sortBy=[updatedAt, -createdAt]` will return the results sorted
by `updatedAt` in ascending order and `createdAt` in descending order lexicographically.

# Metadata
Some Peach objects have a `metaData` attribute. You can use this attribute to pass
key-value data as part of an object.

Metadata can be used when you need to store additional information on an object. Metadata
is not used by Peach. It is stored as part of an object and returned to you.

Do not store any personal identifiable information (such as SSN) as metadata. Use dedicated
attributes for PII as these attributes are encrypted.

Note: Metadata attribute can hold up to 50 keys, with key names up to 100 characters long and values
up to 500 characters long.

# Attributes Formats
Some Peach attributes use common formats.
1. **Interest rate, promo rate and APR** - Rates are annual. Format is decimal. For example, 0.005 is 0.5% annual rate, 0.01 is 1% annual rate, 0.2 is 20% annual rate.
2. **Dates** - Dates are in format `YYYY-MM-DD`. Dates are computed relative to either
    - the company timezone, which is configured on the company config, or
    - the product timezone, which is configured on the Loan Type.  Note: it is possible for a company to have multiple products with different timezones.
3. **Date-times** - Timestamps are in ISO-8601 format expressed either in UTC like `2001-01-01T12:00:00Z` or with UTC offset like
    `2001-01-01T12:00:00-07:00`. Some date-times will include subsecond precision to an arbitrary number of digits like `2001-01-01T12:00:00.123Z`.
4. **Amount** - Amounts are in decimal format with 2 places after the decimal point. For example, 32.45 is thirty-two dollars and forty-five cents.

# Identifiers
Peach objects always have unique identifiers created by Peach. Some objects support external IDs. If external ID is supported, the object will have `externalId` attribute. You can fetch objects using external ID (only objects that support external IDs).
Peach IDs have the same format XX-YYYY-YYYY.

XX - is a prefix from the list below.

YYYY-YYYY - is a random set of numbers and letters (capital characters A-Z and digits 1-9). The digit zero is not used to avoid confusion with capital letter O.

## External IDs
External IDs allows avoiding the need to map IDs between your system and Peach. You can pass your IDs when creating various objects at Peach and then use the same IDs to fetch
the information back.

When fetching data with external IDs or when sending a request that requires a reference to an object using its external ID (for example, inside a body of a POST request), there is
a need to add a `ext-` in front of the ID. This will make sure Peach knows these are external IDs being used.

For example, fetching a borrower using the external ID would look like `GET /api/people/ext-MY_EXTERNAL_BORROWER_ID`.

When creating objects with external IDs, the `ext-` prefix is not needed.
For example, when creating a new borrower the body would look like:
```
POST /api/people
{
  "externalId" : "MY_EXTERNAL_BORROWER_ID"
  ...
}
```

## List of Prefixes

| Prefix | Object |
| --- | ----------- |
| UR | User |
| BO | Borrower |
| BN | Person Name |
| BI | Person Identity |
| CT | Contact |
| LT | Loan Type |
| IR | Investor |
| LN | Loan |
| LN | Loan Draw |
| LA | Installment Advances |
| CP | Company |
| TX | Transaction |
| EV | Event |
| EM | Event Message |
| PT | Payment Instrument |
| PA | Payment ID |
| DD | Document Descriptor |
| FT | Fee Type |
| MS | Person Monitoring Status |
| CS | Case |
| CE | Case Type |
| AP | Autopay |
| IN | Interaction |
| DT | Do Not Interact Type |
| DN | Do Not Interact |
| NT | Notification Type |
| NO | Notification |
| TD | Template Descriptor |
| TV | Template Version |
| CO | Code |
| CR | Compliance Rule |
| SR | Service |
| FD | FEMA Disaster Details |
| NT | Note |
| CN | Consent |
| LR | Legal Representative |
| RL | Role |
| PM | Permission |
| WT | Workflow Type |
| ST | Workflow Step Type |
| IT | Workflow Item Type |
| WF | Workflow |
| WS | Workflow Step |
| WI | Workflow Workitem |
| VT | Verification Type |
| VE | Verification |
| VA | Verification Attempt |
| OB | Obligation |
| RE | Repayment Notification Descriptor  |
| LP | Loan People |
| RA | InterestRate |
| PE | Period (loan)  |
| IA | Loan Investor Association |
| SE | Settlement |
| RF | Loan Refund |
| SM | Statement |
| SA | Statement Activity |
| SD | Statement Draw Info |
| LF | Loan Fee |
| AE | Autopay Expected Payment |
| FE | FEMA Disaster |
| TY | Loan Tape Type |
| TA | Loan Tape |
| MR | Merchant |
| LS | Loan Reporting Status |
| CA | Credit Agency |
| CL | Collection Agency |
| CI | Card Issuer |
| WH | Webhook |
| AF | ACHFile Upload Monitoring |
| FB | Funding Account Balance |
| BC | Borrower Campaign |
| RN | Campaign Run |
| CX | Contact  Exporter|
| TC | Transaction Chargeback |
| PS | Promise to Pay Plan |
| P2 | Promise to Pay Period |
| LL | Loan Label |
| AK | API Key    |
| AT | AI Call Transcription Result |
| SU | AI Call Summary Result |
| RC | Rate Cap |

# Events
Our system supports pull events via our REST API.
You can see more information <a href="/api-docs/api-public/events">here</a>.

# Compliance Guard
Compliance Guard covers core regulatory obligations related to servicing and
collections. It does not cover rules required for debt collection agencies
(though some of them are applicable to creditors and servicers as a best
practice.)

Compliance Guard allows you to:
  - Run real-time regulatory checks before initiating an outbound communication
  with a borrower. Rules cover laws on the federal level and 50 states + DC. The
  system runs appropriate rules based on loan type, loan status, location of a borrower,
  borrower status, and past communications.
  - Monitor for bankruptcy, deceased, active military, and FEMA (disasters). You can
  monitor for all four or any combination of the four. On hits, we automatically create "cases"
  with all details, block future outbound communications (if needed), and notify
  you about the cases.

## Configuring Compliance Guard
- Peach will configure an appropriate loan type for you. It allows us to select a
predefined set of regulatory rules
- Peach will work with you to override regulatory rules based on your risk appetite. You
can "mute" rules. You can add rules. This is typically done with your legal
and compliance teams.
- Peach will work with you to add business rules based on your needs. For example, don't
allow outbound debt collection calls on Sundays. This is typically done with your
operations and product teams.

## Implementing Compliance Guard in your system
- You need to create borrower and loan objects in the Peach system. For more details
see <a href="/api-docs/api-public/borrowers">Borrower Management</a> and <a href="/api-docs/api-public/loans">Loans Management</a>.
- You need to report all communications with a borrower. Not required for monitoring.
This way Peach can track all interactions with the borrower. For more details see
<a href="/api-docs/api-public/communicator">Communicator & Interactions</a>.
- When sending a communication through Peach it will automatically check Compliance
  Guard rules to determiend if the communication is compliant. If it is not compliant,
  the communication will not be rejected. (Some send endpoints do not perform
  Compliance Guard checks, but they should be clearly marked.)
- You can also manually check if a communication is compliant by using the
  <a href="/api-docs/api-public/compliance-guard/peach.people.handlers.can_interact">Can interact</a> endpoint.

# Locks
Peach ensures consistency of the loan's ledger and balances. In order to make sure that
multiple operations are not writing to the ledger at the same time, Peach uses locks to protect
the consistency of the loan.

In situations where an API call affects a loan's ledger, the system will lock the
loan to protect its consistency. Subsequent calls that affect that loan's ledger might
return a `423 Locked` status if the loan is still locked. In these cases, you can make
a call to <a href="/api-docs/api-public/loans/peach.people.loans.handlers.get_lock_status">Lock Status</a>
to check if the loan is still locked.

If you are trying to make a call and get `423 Locked`, consider polling on the <a href="/api-docs/api-public/loans/peach.people.loans.handlers.get_lock_status">Lock Status</a>
to check when the lock is released. Most locks are short.
Some API calls (e.g. retroactive interest adjustment or payment backdate)
can trigger a loan replay. Loan replays can last several minutes, during which the loan will
be locked.

# Sync calls
Most of the API endpoints are asynchronous by design. There are situations in which you
might want to wait until the API call/operation finishes. Some API endpoints have
a special query parameter called `sync`.

For example:
- <a href="/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_create">Create Payment Instrument</a>
- <a href="/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.draw_purchases_create">Create Purchase</a>

When `sync=true`, the call will be blocked until the async operation has finished.
If the operation takes too long, you will get a `408 Request Timeout` response.
In that case, you need to poll on that specific operations' result.
For example: if you make a call to add a Payment Instrument, and it times out, you can poll
the `/payment-instruments` endpoint to see if the new payment instrument has been added.

# Errors

**BETA** - Standardization of error response bodies is in progress.

Peach uses conventional HTTP response codes to indicate the success or failure of an API request.
In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that
resulted from the provided information (e.g., a required parameter was missing), and codes in the 5xx
range indicate an error with the Peach service.
Error response bodies have the following JSON format:
```json
{
    "statusCode": 400,
    "message": "A description of the error.",
    "errorType": "TheErrorType"
}
```
For a list of error types, see the <a href="/api-docs/api-public/errors">Errors</a> section.


Version: 2023-11-29
License: Proprietary

## Servers

```
https://sandboxapi.peach.finance/api
```

## Security

### apiKeyHeader

Type: apiKey
In: header
Name: X-API-KEY

### bearerAuth

Type: http
Scheme: bearer
Bearer Format: JWT

### bearerAuthQuery

Type: apiKey
In: query
Name: token

### oauth2

Type: oauth2

## Download OpenAPI description

[Peach Finance API](https://docs.peachfinance.com/_bundle/API%20Docs/@2023-11-29/api-public.yaml)

## Frontend

Endpoints for use in configuring the frontend before and after authentication.


### Get bootstrap data

 - [GET /bootstrap](https://docs.peachfinance.com/api-docs/api-public/frontend/peach.security.handlers.bootstrap.md): Get pre-auth app metadata and settings.

Fetch metadata and settings for a Peach application. This endpoint is public readable
because this information is necessary to properly render the frontend even for
users who are not yet logged-in — i.e., the login page needs to have the right
company name and color scheme.

Since multiple frontend application are supported by the backend you must specify
for which frontend application this bootstrap request is intended. The best way
to do this is by specifying domain. e.g., domain=myappdomain.com. (Please note
that a "Company App Domain" must already be configured for your environment for
this to work. There is no public API for this yet, so contact support.)

You may also specify the companyId and appDomainType instead of the domain,
but this is discouraged and mostly intended for development / debugging.

## Auth

Authentication and authorization related endpoints.


### Takes a user ID and returns a temporary token that can be exchanged for a real auth token.

 - [POST /auth/exchange-token](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.exchange_token_create.md)

### Change password

 - [POST /auth/password](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.password_post.md)

### Get all permissions for the requesting user

 - [GET /auth/permissions](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.permissions_get.md)

### End login session, invalidating current login token.

 - [DELETE /auth/token](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.logout.md)

### Exchange username and password for JWT token

 - [POST /auth/token](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.validate_and_send_token.md)

### Exchange current token for a new one

 - [PUT /auth/token](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.renew_jwt_token.md)

### Create a short-lived token

 - [POST /auth/token/short-lived](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.short_lived_token.md)

### Get logged-in user's info.

 - [GET /auth/user](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.user_info_get.md)

### SAML callback endpoint

 - [POST /companies/{companyId}/auth/saml/callback](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.saml_sp_auth.idp_initiated.md)

### Display IdP setup help

 - [GET /companies/{companyId}/auth/saml/help](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.saml_sp_auth.idp_setup_help.md)

### Redirect to the SAML login endpoint

 - [GET /companies/{companyId}/auth/saml/login](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.saml_sp_auth.sp_initiated.md)

### Display Peach SP Metadata

 - [GET /companies/{companyId}/auth/saml/metadata.xml](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.saml_sp_auth.sp_metadata_xml.md): Peach acts as the service provider

### Send one time code.

 - [POST /companies/{companyId}/auth/send-one-time-code](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.send_one_time_code.md): Send a one time code to a phone number or email address. For phone numbers, the code
can be sent via text or voice.

### End login session, invalidating current login token.

 - [DELETE /compliance/auth/token](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.compliance_logout.md)

### Exchange username and password for JWT token

 - [POST /compliance/auth/token](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.compliance_validate_and_send_token.md)

### Exchange current token for a new one

 - [PUT /compliance/auth/token](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.compliance_renew_jwt_token.md)

### Replace user's auth based on configured company auth type

 - [PUT /users/{userId}/auth](https://docs.peachfinance.com/api-docs/api-public/auth/peach.security.handlers.user_auth_replace.md): Replace the user's authentication values from scratch. The
authentication type is derived from the company config.

## API Keys

API Keys can be managed with these endpoints.


### Get all API keys

 - [GET /keys](https://docs.peachfinance.com/api-docs/api-public/api-keys/peach.security.api_keys.handlers.company_api_keys_get_all.md)

### Create an API key

 - [POST /keys](https://docs.peachfinance.com/api-docs/api-public/api-keys/peach.security.api_keys.handlers.company_api_key_create.md)

### Delete an API key

 - [DELETE /keys/{keyId}](https://docs.peachfinance.com/api-docs/api-public/api-keys/peach.security.api_keys.handlers.company_api_key_delete.md)

### Get an API key

 - [GET /keys/{keyId}](https://docs.peachfinance.com/api-docs/api-public/api-keys/peach.security.api_keys.handlers.company_api_key_get.md)

### Update an API key

 - [PUT /keys/{keyId}](https://docs.peachfinance.com/api-docs/api-public/api-keys/peach.security.api_keys.handlers.company_api_key_update.md)

## Borrowers

The Borrower object represents a borrower.
It allows you to maintain different statuses that are associated with the same borrower.
The API allows you to create, delete and update your borrowers. You can retrieve
an individual borrower as well as a list of all your borrowers.


### Get borrowers

 - [GET /people](https://docs.peachfinance.com/api-docs/api-public/borrowers/peach.people.handlers.borrowers_list.md): Get borrowers filtering with optional parameters.

### Create borrower

 - [POST /people](https://docs.peachfinance.com/api-docs/api-public/borrowers/peach.people.handlers.borrower_create.md): Create a new borrower.

### Search borrowers

 - [GET /people/search](https://docs.peachfinance.com/api-docs/api-public/borrowers/peach.people.handlers.borrower_search.md): Search for borrowers. Returns same resources
as /people.

### Get borrower by ID

 - [GET /people/{personId}](https://docs.peachfinance.com/api-docs/api-public/borrowers/peach.people.handlers.borrower_get.md): Get an existing borrower by ID.

### Update borrower

 - [PUT /people/{personId}](https://docs.peachfinance.com/api-docs/api-public/borrowers/peach.people.handlers.borrower_update.md): Update an existing borrower.

## Identity

Identity objects represent various forms of identification that a borrower may have.
We allow one primary identity per borrower, and any number of secondary identities.
The identity sent when creating a borrower is the primary identity, and cannot be
deleted/archived or changed to be a secondary identity.


### Get identities

 - [GET /people/{personId}/identities](https://docs.peachfinance.com/api-docs/api-public/identity/peach.people.handlers.list_identities.md)

### Create identity

 - [POST /people/{personId}/identities](https://docs.peachfinance.com/api-docs/api-public/identity/peach.people.handlers.create_identity.md)

### Archive identity

 - [DELETE /people/{personId}/identities/{personIdentityId}](https://docs.peachfinance.com/api-docs/api-public/identity/peach.people.handlers.delete_identity.md): Primary identities cannot be archived.

### Get identity by ID

 - [GET /people/{personId}/identities/{personIdentityId}](https://docs.peachfinance.com/api-docs/api-public/identity/peach.people.handlers.get_identity.md)

### Update identity

 - [PUT /people/{personId}/identities/{personIdentityId}](https://docs.peachfinance.com/api-docs/api-public/identity/peach.people.handlers.update_identity.md): For primary identities, the isArchived field cannot be changed.

### Get primary identity

 - [GET /people/{personId}/identity](https://docs.peachfinance.com/api-docs/api-public/identity/peach.people.handlers.get_primary_identity.md)

## Contact Information

This object allows you to add and manage a Borrower's contact information. A Borrower can
have an "unlimited" number of contacts. However, it is important to properly create key contact objects.

Peach Borrower Portal (if used by the lender), shows the following contacts only:

`EMAIL` contactType=email, label=personal or work, affiliation=self, status=primary.

`MOBILE PHONE` contactType=phone, label=personal, affiliation=self, status=primary.

`HOME PHONE` contactType=phone, label=home, affiliation=self, status=secondary.

`HOME ADDRESS` contactType=address, label=home, affiliation=self, status=primary.


The Peach system sends notices (e.g. payment reminder) to borrowers (if configured by the lender).
In order for a notice to be sent successfully, both contact object and template must exist.
If a contact cannot be found, the system will not send a notice.
The system will try to find the following contact objects:


Email notices:
contactType=email, valid=true, affiliation=self, status=primary
(if "primary" is not found, the system searches for "secondary" and then for "additional")


Text message/SMS notices:
contactType=phone, valid=true, affiliation=self, receiveTextMessages=true, label=personal, status=primary
(if "primary" is not found, the system searches for "secondary" and then for "additional")


### List contact for borrower

 - [GET /people/{personId}/contacts](https://docs.peachfinance.com/api-docs/api-public/contact-information/peach.people.contact.handlers.list_contacts_for_borrower.md): List contacts for a borrower.

### Create contact

 - [POST /people/{personId}/contacts](https://docs.peachfinance.com/api-docs/api-public/contact-information/peach.people.contact.handlers.create_contact_for_borrower.md): Create contact for a borrower.

### Delete contact

 - [DELETE /people/{personId}/contacts/{contactId}](https://docs.peachfinance.com/api-docs/api-public/contact-information/peach.people.contact.handlers.delete_contact.md): Delete a borrower's contact.

### Get contact by ID

 - [GET /people/{personId}/contacts/{contactId}](https://docs.peachfinance.com/api-docs/api-public/contact-information/peach.people.contact.handlers.get_contact_for_borrower.md)

### Update contact

 - [PUT /people/{personId}/contacts/{contactId}](https://docs.peachfinance.com/api-docs/api-public/contact-information/peach.people.contact.handlers.update_contact_for_borrower.md): Update contact of a borrower.

### Clone contact

 - [POST /people/{personId}/contacts/{contactId}/clone](https://docs.peachfinance.com/api-docs/api-public/contact-information/peach.people.contact.handlers.clone_contact.md): Clones the borrower's contact information. 

This copies all properties from the existing contact and applies 
the passed properties. Sets externalId of the existing contact to null. 
Sets the status of the existing contact to archived.

Returns the new contact with a new Peach ID.

## Payment Instruments

This object represents a payment method (e.g. bank account, credit card, debit card, etc.) belonging to a borrower.


### Get payment instruments

 - [GET /people/{personId}/payment-instruments](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_get_all.md)

### Create payment instrument

 - [POST /people/{personId}/payment-instruments](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_create.md): Create a payment instrument.

When creating a payment instrument using the Plaid Account option, two flows are supported:

1) Pass only accessToken and accountIds. This will create a payment instrument with status=inactive.
You can then use Update payment instrument
endpoint to set the accountHolderType, and accountHolderName fields, and set the status to active.

2) Pass the required fields as well as accountHolderType, and accountHolderName. This will create a payment
instrument with status=active. The payment instrument will then be ready to use.

Note: This endpoint returns an array containing a single payment instrument to allow future support for Plaid multi-account select.

### Delete payment instrument

 - [DELETE /people/{personId}/payment-instruments/{paymentInstrumentId}](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_delete.md)

### Get payment instrument by ID

 - [GET /people/{personId}/payment-instruments/{paymentInstrumentId}](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_get.md)

### Update payment instrument

 - [PUT /people/{personId}/payment-instruments/{paymentInstrumentId}](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_update.md)

### Delete account link

 - [DELETE /people/{personId}/payment-instruments/{paymentInstrumentId}/account-link](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.account_link_delete.md): Retrieve the data vendor link details for this payment instrument.

### Create account link

 - [POST /people/{personId}/payment-instruments/{paymentInstrumentId}/account-link](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.account_link_post.md): Add a data vendor link for this payment instrument. If one is already present, it is replaced.

### Update account link

 - [PUT /people/{personId}/payment-instruments/{paymentInstrumentId}/account-link](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.account_link_put.md): Update record keeping details about the account link. This can not be used to set up a new account link.

### Get balance data

 - [GET /people/{personId}/payment-instruments/{paymentInstrumentId}/balance](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.balances_get.md): Get stored balance data for the account associated with the payment instrument.

### Refresh balance data

 - [POST /people/{personId}/payment-instruments/{paymentInstrumentId}/balance](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.balances_post.md): Fetch updated balance data from the account link associated with this payment instrument.

### Verify amounts of microdeposits

 - [POST /people/{personId}/payment-instruments/{paymentInstrumentId}/verify](https://docs.peachfinance.com/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_verify.md)

## Consent

Explicit consent to receive certain kinds of communications.


### Get consents

 - [GET /people/{personId}/consents](https://docs.peachfinance.com/api-docs/api-public/consent/peach.people.handlers.consent_get.md): Get all consent associated with a borrower.

### Update consents

 - [PUT /people/{personId}/consents](https://docs.peachfinance.com/api-docs/api-public/consent/peach.people.handlers.consent_update.md): Update the consents

## Documents

This object allows you to add or create documents related to a borrower. There are multiple ways to use document object:
  - Render a document from a Peach template. For example, loan terms or Autopay agreement.
  - Upload any type of file. For example, a PDF copy of borrower's driver license.
  - Documents can also be used to render a legal disclosure from Peach template.

To create a new document there are two steps:
  1. Create a document descriptor.
  2. Upload document content/file.

When a new document is rendered from the template you just need to complete step #1.


### Create new document via link

 - [POST /document-uploads/{documentUploadLinkKey}/documents](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.documents_via_links.create_document_via_link.md)

### Upload document content via link

 - [POST /document-uploads/{documentUploadLinkKey}/documents/{documentDescriptorId}/content](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.documents_via_links.upload_document_content_via_link.md)

### Get document upload links

 - [GET /people/{personId}/document-upload-links](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.document_upload_links.get_document_upload_links.md)

### Create document upload link

 - [POST /people/{personId}/document-upload-links](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.document_upload_links.create_document_upload_link.md)

### Get doc upload link by ID

 - [GET /people/{personId}/document-upload-links/{documentUploadLinkId}](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.document_upload_links.get_document_upload_link.md)

### Get document descriptors

 - [GET /people/{personId}/documents](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.list_person_documents.md)

### Create new document descriptor

 - [POST /people/{personId}/documents](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.create_person_document.md)

### Delete document

 - [DELETE /people/{personId}/documents/{documentDescriptorId}](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.delete_document.md)

### Get document descriptor by ID

 - [GET /people/{personId}/documents/{documentDescriptorId}](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.get_person_document.md)

### Update document descriptor

 - [PUT /people/{personId}/documents/{documentDescriptorId}](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.update_person_document.md)

### Download document content

 - [GET /people/{personId}/documents/{documentDescriptorId}/content](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.download_person_document_content.md)

### Upload document content

 - [POST /people/{personId}/documents/{documentDescriptorId}/content](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.upload_person_document_content.md)

### Convert document to the specified format

 - [POST /people/{personId}/documents/{documentDescriptorId}/convert](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.convert_person_document.md)

### Digitally sign document

 - [POST /people/{personId}/documents/{documentDescriptorId}/sign](https://docs.peachfinance.com/api-docs/api-public/documents/peach.docustore.handlers.sign_person_pdf_document.md)

## Legal Representation

If a borrower is represented by a legal entity you can add the legal entity details.
Normally, if a borrower is represented by a status=`active` legal entity we block
future debt collection related communications.


### Get representatives

 - [GET /people/{personId}/legal-representatives](https://docs.peachfinance.com/api-docs/api-public/legal-representation/peach.people.legal.handlers.legal_representative_get_all.md)

### Create representative

 - [POST /people/{personId}/legal-representatives](https://docs.peachfinance.com/api-docs/api-public/legal-representation/peach.people.legal.handlers.legal_representative_add.md)

### Get representative by ID

 - [GET /people/{personId}/legal-representatives/{legalRepresentativeId}](https://docs.peachfinance.com/api-docs/api-public/legal-representation/peach.people.legal.handlers.legal_representative_get_by_id.md)

### Update representative

 - [PUT /people/{personId}/legal-representatives/{legalRepresentativeId}](https://docs.peachfinance.com/api-docs/api-public/legal-representation/peach.people.legal.handlers.legal_representative_update.md)

## Verifications

A borrower verification session represents the
question and response flow for an agent to verify the identity of a human
who purports to be a particular borrower. For instance, upon receiving a phone
call, an agent would initiate a borrower verification, ask the questions to the
borrower, and enter their responses. A set of responses are either correct (thus
verifying the human as the borrower) or they are incorrect.

The agent is never shown the correct answers, so privacy risks are
minimized and socially engineered security attacks are mitigated.


### Get verifications

 - [GET /people/{personId}/verifications](https://docs.peachfinance.com/api-docs/api-public/verifications/peach.people.borrower_verification.handlers.borrower_verification_get_all.md): Retrieve all verifications—optionally filtering. Note that unlike most Peach "get all" endpoints,
the verifications get all endpoint returns items in a reverse chronological list, since almost
all interesting verifications are those which happened in the recent past.

### Start verification

 - [POST /people/{personId}/verifications](https://docs.peachfinance.com/api-docs/api-public/verifications/peach.people.borrower_verification.handlers.borrower_verification_create.md): Start a borrower verification session. Newly created verifications
include randomly selected questions about the borrower. The human must attempt
to provide correct answers to these questions in order for the borrower verification
to be successful.

To check if a verification can be started now without actually starting a verification,
add the query parameter dryRun=true to the URL. If a verification could be started now
return successful (204), otherwise return an error response with
nextVerificationOkAt indicating when the next verification can start.

### Get verification by ID

 - [GET /people/{personId}/verifications/{verificationId}](https://docs.peachfinance.com/api-docs/api-public/verifications/peach.people.borrower_verification.handlers.borrower_verification_get.md)

### Answer verification questions

 - [POST /people/{personId}/verifications/{verificationId}/attempts](https://docs.peachfinance.com/api-docs/api-public/verifications/peach.people.borrower_verification.handlers.borrower_verification_answer_attempt_create.md)

## Verification Types

This object represents configurations describing how new borrower verifications
should behave.


### Get questions

 - [GET /verification-questions](https://docs.peachfinance.com/api-docs/api-public/verification-types/peach.borrower_verification.handlers.borrower_verification_questions_get_all.md): Retrieve all the questions which are available for use with verification types—i.e., the question bank.

### Get verification types

 - [GET /verification-types](https://docs.peachfinance.com/api-docs/api-public/verification-types/peach.borrower_verification.handlers.borrower_verification_types_get_all.md)

### Create verification type

 - [POST /verification-types](https://docs.peachfinance.com/api-docs/api-public/verification-types/peach.borrower_verification.handlers.borrower_verification_types_create.md): Create a new borrower verification type.

This represents one configuration of
how to perform borrower verifications. Later, when starting a new borrower verification,
you can then specify a particular verification type to use. This done by POST-ing to the
/people/{personId}/verifications endpoint with a body like:

json
{
  "verificationTypeId": "VT-7RKX-OKQZ"
}

### Using with CRM App UI

In order to specify that the CRM application should make use a particular
verification type you must set the company config value: config.borrowerVerification.crmDefaultTypeId
to the ID of the verification type ID of the verification type you wish to use.

e.g., config.borrowerVerification.crmDefaultTypeId = "VT-7RKX-OKQZ"

### Get verification type by ID

 - [GET /verification-types/{verificationTypeId}](https://docs.peachfinance.com/api-docs/api-public/verification-types/peach.borrower_verification.handlers.borrower_verification_types_get_one.md)

### Update verification type

 - [PUT /verification-types/{verificationTypeId}](https://docs.peachfinance.com/api-docs/api-public/verification-types/peach.borrower_verification.handlers.borrower_verification_types_update.md)

## Campaigns

This object allows you to create custom Campaigns. A Campaign is characterized by a set of rules, defined
as a SQL query created in Redash and associated with the Campaign. A Campaign can be triggered at predefined
intervals. For example, a Campaign can be triggered every day to add borrowers who are 30 days past due. Campaigns
can also be manually triggered.
When a Campaign is triggered by schedule or manually, a query is executed against the lender's replica data and
returns a list of person IDs. The output is sent to the configured Contact Exporter to be written as a configurable
CSV file with contact information required by auto dialers and other systems.


### Get campaigns

 - [GET /campaigns](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers.campaign_get_all.md): Get a list of all campaigns.

### Create campaign

 - [POST /campaigns](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers.campaign_create.md): Create a new campaign by associating a Redash query that returns a single column containing
borrower IDs labeled "id". The campaign can also be scheduled.

### Get campaign by ID

 - [GET /campaigns/{borrowerCampaignId}](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers.campaign_get.md): Get a campaign by ID.

### Update campaign

 - [PUT /campaigns/{borrowerCampaignId}](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers.campaign_update.md): Update a campaign by ID.

### Get campaign runs

 - [GET /campaigns/{borrowerCampaignId}/runs](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers_runs.campaign_run_list.md): Get a list of campaign runs.

### Run campaign

 - [POST /campaigns/{borrowerCampaignId}/runs](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers_runs.campaign_run_create.md): Start a new borrower campaign run and save results.

The behavior of the campaign run is controlled by configured settings on
the campaign object and via the associated BulkSender and ContextExporter objects.

By default when the campaign runs, it executes the Redash query referenced in the
redashQueryUrl and feeds the query results as input to the campaign run.

Optionally, you can override this by specifing a queryResultsOverride field
as input.

### Get campaign run

 - [GET /campaigns/{borrowerCampaignId}/runs/{borrowerCampaignRunId}](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers_runs.campaign_run_read.md): Get campaign run data by ID.

### Update campaign run

 - [PUT /campaigns/{borrowerCampaignId}/runs/{borrowerCampaignRunId}](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers_runs.campaign_run_update.md): Update campaign run data.

### Download all files

 - [GET /campaigns/{borrowerCampaignId}/runs/{borrowerCampaignRunId}/download](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers_runs.campaign_run_download.md): Download files generated by a campaign run.

### Get campaign runs

 - [GET /companies/{companyId}/campaigns/{borrowerCampaignId}/runs](https://docs.peachfinance.com/api-docs/api-public/campaigns/peach.people.campaigns.handlers_runs.internal_campaign_run_list.md): Get a list of campaign runs.

## Contact Exporters

This object allows you to create custom Contact Exporters. The Contact Exporter defines how and where the
contacts generated by the Campaign are delivered.


### List contact exporters

 - [GET /campaign-workers/contact-exporters](https://docs.peachfinance.com/api-docs/api-public/contact-exporters/peach.people.contact_exporters.handlers.contact_exporter_list.md): Get a list of all contact exporters.

### Create contact exporter

 - [POST /campaign-workers/contact-exporters](https://docs.peachfinance.com/api-docs/api-public/contact-exporters/peach.people.contact_exporters.handlers.contact_exporter_create.md): Create a new Contact Exporter by defining the contact matching criteria and the exportable columns. If
desired, designate an SFTP setting and/or screen through Compliance Guard.

When contacts are screened, the exporter calls Compliance Guard with the checkAtCompanyNoon flag enabled.
See the checkAtCompanyNoon field on the Can Interact Endpoint for
further information. In other words, regardless of the time of day that the exporter runs, compliance is
checked as of noon in the company's time zone. This does not override other reasons a check can fail:
the borrower having a Do Not Interact in place, having reached the interaction frequency limit, etc.

Where possible, it's always advised to check compliance right before an action. Many things can change
(payments are made, other automated interactions are sent, consents/addresses can be updated)
from when you plan something to happen to when it actually happens. Lenders are responsible for ensuring
it is still permissible to conduct the interaction.

### Delete contact exporter

 - [DELETE /campaign-workers/contact-exporters/{contactExporterId}](https://docs.peachfinance.com/api-docs/api-public/contact-exporters/peach.people.contact_exporters.handlers.contact_exporter_delete.md): Delete a contact exporter by ID.

### Get contact exporter by ID

 - [GET /campaign-workers/contact-exporters/{contactExporterId}](https://docs.peachfinance.com/api-docs/api-public/contact-exporters/peach.people.contact_exporters.handlers.contact_exporter_get_by_id.md): Get a contact exporter by ID.

### Update contact exporter

 - [PUT /campaign-workers/contact-exporters/{contactExporterId}](https://docs.peachfinance.com/api-docs/api-public/contact-exporters/peach.people.contact_exporters.handlers.contact_exporter_update.md): Update a contact exporter by ID.

## Bulk Senders

A bulk sender object represents a campaign worker which sends messages
to the borrowers returned by a campaign's query results.

For each row returned by the campaign in its query result a message is sent via the
<a href="/api-docs/api-public/communicator/peach.communicator.handlers.handle_send">Send endpoint</a>.

Some of the query results columns are automatically mapped to the request body of the Send endpoint,
these columns are:
- `caseId`
- `contactId`
- `context`
- `interactionExternalId`
- `isTransactional`
- `loanId`
- `previousInteractionId`
- `statementId`
- `sendAt`
- `useTemplate`

In order for a bulk sender to function, at a minimum the
campaign's query results must return at least the column
`borrowerId`.

Note that bulk senders send with `{ strictUndefined: true }` so any missing context variables 
will cause the send request to fail rather than sending with a default (empty) value, which is
the standard behavior for the `/communicator/send` endpoint.

For more details on required columns see
per-`InteractionSubject` documentation for&nbsp;
<a href="/api-docs/api-public/campaigns/peach.people.campaigns.handlers_runs.campaign_run_create">Campaign run</a>.


### List bulk senders

 - [GET /campaign-workers/bulk-senders](https://docs.peachfinance.com/api-docs/api-public/bulk-senders/peach.people.campaigns.handlers_workers.bulk_sender_list.md): Get a list of all bulk senders.

### Create bulk sender

 - [POST /campaign-workers/bulk-senders](https://docs.peachfinance.com/api-docs/api-public/bulk-senders/peach.people.campaigns.handlers_workers.bulk_sender_create.md): Create a new bulk sender.

### Delete bulk sender

 - [DELETE /campaign-workers/bulk-senders/{bulkSenderId}](https://docs.peachfinance.com/api-docs/api-public/bulk-senders/peach.people.campaigns.handlers_workers.bulk_sender_delete.md): Delete a bulk sender by ID.

### Get bulk sender by ID

 - [GET /campaign-workers/bulk-senders/{bulkSenderId}](https://docs.peachfinance.com/api-docs/api-public/bulk-senders/peach.people.campaigns.handlers_workers.bulk_sender_get.md): Get a bulk sender by ID.

### Update bulk sender

 - [PUT /campaign-workers/bulk-senders/{bulkSenderId}](https://docs.peachfinance.com/api-docs/api-public/bulk-senders/peach.people.campaigns.handlers_workers.bulk_sender_update.md): Update the existing bulk sender

## Cases

This object allows you to add cases to a borrower that are relevant to servicing
or collections. For example, a bankruptcy case. A borrower can have multiple
cases. If you enabled Compliance Guard monitoring feature, we'll create a new case
every time a borrower matches to one of the external data sources we use. For example,
if you monitor for active military, and we match one of your borrowers to
the SCRA (https://scra.dmdc.osd.mil/scra/) database we'll create a new case
with type=`militaryDuty`.


### List active case escalations for a company

 - [GET /active-escalations](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.escalations.handlers.case_open_escalations_get_by_company.md): List active case escalations for a company

### Get all cases

 - [GET /cases](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.list_cases_by_company.md): Get all cases. Returns only borrower-bound cases by default.

### Get borrower cases

 - [GET /people/{personId}/cases](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.list_cases_by_borrower.md): Get all cases associated with a borrower.

### Create borrower case

 - [POST /people/{personId}/cases](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.create_case.md): Create a new case and associate it with a borrower using their ID.

### Remove association

 - [DELETE /people/{personId}/cases/{caseId}](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.remove_case_association.md): Remove association of an existing case, interaction, loan, or file objects from the case.

### Get borrower case by ID

 - [GET /people/{personId}/cases/{caseId}](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.get_case_by_id.md)

### Add association

 - [POST /people/{personId}/cases/{caseId}](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.add_case_association.md): Associate an existing case, interaction, loan, or file objects to the case.
This way you can create comprehensive view of the case.

### Update case

 - [PUT /people/{personId}/cases/{caseId}](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.update_case.md): Update a case associated with a borrower.

### List case escalations

 - [GET /people/{personId}/cases/{caseId}/escalations](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.escalations.handlers.case_escalations_get.md): List case escalations

### Escalate or de-escalate a case

 - [POST /people/{personId}/cases/{caseId}/escalations](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.escalations.handlers.case_escalations_create.md): Escalate or de-escalate a case

### List case escalation by ID

 - [GET /people/{personId}/cases/{caseId}/escalations/{caseEscalationId}](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.escalations.handlers.case_escalation_get_by_id.md): List case escalations

### Snooze case

 - [POST /people/{personId}/cases/{caseId}/snooze](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.snooze_case.md): Snooze the case or cancel the case snooze.

### Mark a case as viewed

 - [POST /people/{personId}/cases/{caseId}/views](https://docs.peachfinance.com/api-docs/api-public/cases/peach.cases.handlers.view_case.md): Mark a case as viewed by the current user

## Case Types

This object allows you to create custom case types. You then can create case instances from a case type.
Peach has a predefined collection of special case types,
such as `bankruptcy`, `identityTheft`, and more. You can use any of the special types
as your base case type. To customize your case type you can:
- Add additional custom fields
- Add and remove automatic `Do Not Interact Types`
- Add custom name
- Add custom description

If you don't want to use any of the special predefined case types, then use `generic` as your base type.


### Get case types

 - [GET /case-types](https://docs.peachfinance.com/api-docs/api-public/case-types/peach.cases.case_types.handlers.list_case_type.md)

### Create type

 - [POST /case-types](https://docs.peachfinance.com/api-docs/api-public/case-types/peach.cases.case_types.handlers.create_case_type.md)

### Get type by ID

 - [GET /case-types/{caseTypeId}](https://docs.peachfinance.com/api-docs/api-public/case-types/peach.cases.case_types.handlers.get_case_type_by_id.md)

### Update type

 - [PUT /case-types/{caseTypeId}](https://docs.peachfinance.com/api-docs/api-public/case-types/peach.cases.case_types.handlers.update_case_type.md): A PUT request is used to update an existing type configuration. While the type is in draft status requests
can move it to active. Setting the status to deprecated will immediately hide it from future GET
all requests, and spawn a draft replica which can be edited and published in its place.

### Remove association

 - [DELETE /case-types/{caseTypeId}/associations](https://docs.peachfinance.com/api-docs/api-public/case-types/peach.cases.case_types.handlers.case_type_remove_association.md)

### Add association

 - [POST /case-types/{caseTypeId}/associations](https://docs.peachfinance.com/api-docs/api-public/case-types/peach.cases.case_types.handlers.case_type_add_association.md)

### Create case type review tasks for ID

 - [POST /case-types/{caseTypeId}/create-smart-review-tasks](https://docs.peachfinance.com/api-docs/api-public/case-types/peach.cases.case_types.handlers.create_smart_review_tasks.md)

## Supercases

This object allows for the management of many cases across a number of borrowers. That is
to say that a supercase can create, manage, and close many cases at once.

This is particularly useful if an issue occurs which affects a large group of borrowers.

- Cases created by a supercase are called `subcases`
- A supercase can only manage cases it has created (i.e., NOT cases created via the `/cases` endpoint)

Managing "who" is affected by a supercase is an important aspect of supercases:

- A `member` of a supercase is one "borrower-loan" pairing.
- A `population` is a set of members added at once.
  - A supercase might have many populations if different members are
    added at different times.
  - It's useful to keep track of sets of members like this because different
    actions might need to be taken on different members depending on when
    they're added to a supercase.
  - A `population`'s membership may be changed until it is "committed" by setting
    `isDraft: false`, at which time the memberships are locked and subcases are created.


### List supercases

 - [GET /supercases](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_list.md)

### Create supercase

 - [POST /supercases](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_create.md): Creates a new supercase.

### Get supercase members.csv template

 - [GET /supercases/members-template.csv](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_members_template_csv.md)

### Get supercase by ID

 - [GET /supercases/{supercaseId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_get.md)

### Update supercase

 - [PUT /supercases/{supercaseId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_update.md)

### Create Do Not Interact instances on all subcases

 - [POST /supercases/{supercaseId}/bulk-create-do-not-interact](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_bulk_create_dni.md)

### Delete supercase related Do Not Interact instances on all subcases

 - [POST /supercases/{supercaseId}/bulk-delete-do-not-interact](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_bulk_delete_dni.md)

### List bulk operations on this supercase

 - [GET /supercases/{supercaseId}/bulk-operations](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_bulk_operation_list.md)

### Search bulk operations on this supercase

 - [GET /supercases/{supercaseId}/bulk-operations/search](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_bulk_operation_search.md)

### Get supercase bulk operation by ID

 - [GET /supercases/{supercaseId}/bulk-operations/{supercaseBulkOperationId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_bulk_operation_get.md)

### Get member bulk operation results by operation

 - [GET /supercases/{supercaseId}/bulk-operations/{supercaseBulkOperationId}/member-bulk-operation-results](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.get_member_bulk_operation_results_by_operation.md): Returns a list of member bulk operation results for the supercase bulk operation. Each member bulk operation result represents a member that was affected by the operation.

### Get target populations for the supercase bulk operation

 - [GET /supercases/{supercaseId}/bulk-operations/{supercaseBulkOperationId}/target-populations](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.get_bulk_operation_target_populations.md): Returns a list of target populations for the supercase bulk operation. Each target population represents a set of members that will be affected by the operation.

### Send a message to the borrowers on all subcases

 - [POST /supercases/{supercaseId}/bulk-send](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_bulk_send_message.md)

### Update all subcases

 - [POST /supercases/{supercaseId}/bulk-update](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_bulk_update.md)

### Get the number of cases associated with the supercase

 - [GET /supercases/{supercaseId}/case-count](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.supercase_case_count.md)

### Get the list of supercase documents

 - [GET /supercases/{supercaseId}/documents](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.documents.get_supercase_documents.md)

### Associate documents with the supercase

 - [POST /supercases/{supercaseId}/documents](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.documents.add_supercase_documents.md)

### Set the documents associated with the supercase

 - [PUT /supercases/{supercaseId}/documents](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.documents.set_supercase_documents.md)

### Get global notes

 - [GET /supercases/{supercaseId}/global-notes](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.notes.global_note_list.md)

### Create global note

 - [POST /supercases/{supercaseId}/global-notes](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.notes.global_note_create.md)

### Get global note by ID

 - [GET /supercases/{supercaseId}/global-notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.notes.global_note_get.md)

### Update global note

 - [PUT /supercases/{supercaseId}/global-notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.notes.global_note_update.md)

### Get private notes

 - [GET /supercases/{supercaseId}/notes](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.notes.private_note_list.md)

### Create private note

 - [POST /supercases/{supercaseId}/notes](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.notes.private_note_create.md)

### Get private note by ID

 - [GET /supercases/{supercaseId}/notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.notes.private_note_get.md)

### Update private note

 - [PUT /supercases/{supercaseId}/notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.notes.private_note_update.md)

### List populations

 - [GET /supercases/{supercaseId}/populations](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.population_list.md)

### Get draft population

 - [GET /supercases/{supercaseId}/populations/draft](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.draft_population_get.md)

### Commit draft population

 - [POST /supercases/{supercaseId}/populations/draft/commit](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.draft_population_commit.md): Creates subcases for all members of the draft population and moves the population to the committed state.

### Get the draft population members

 - [GET /supercases/{supercaseId}/populations/draft/members](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.draft_population_members_list.md)

### Add to the draft population membership

 - [POST /supercases/{supercaseId}/populations/draft/members](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.draft_population_members_add.md): Add to the current population membership the members in this request.

### Set the draft population membership

 - [PUT /supercases/{supercaseId}/populations/draft/members](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.draft_population_members_set.md): Set the draft population membership to the population in this request.
(Removing all current members if they exist.)

### Get membership as CSV

 - [GET /supercases/{supercaseId}/populations/draft/members.csv](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.draft_population_members_list_csv.md)

### Add to membership with CSV

 - [POST /supercases/{supercaseId}/populations/draft/members.csv](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.draft_population_members_add_csv.md): Add to the current population membership with the population in this request.
Format is a CSV document.

### Set membership with CSV

 - [PUT /supercases/{supercaseId}/populations/draft/members.csv](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.draft_population_members_set_csv.md): Set the current population membership to the population in this request. (Removing
all current members if they exist.) Format is a CSV document.

### Get committed membership as CSV

 - [GET /supercases/{supercaseId}/populations/members.csv](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.committed_members_list_csv.md)

### Get population by ID

 - [GET /supercases/{supercaseId}/populations/{populationId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.population_get.md)

### Update population

 - [PUT /supercases/{supercaseId}/populations/{populationId}](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.population_update.md): Update the population.

### Send a message to the borrowers on all subcases of the population

 - [POST /supercases/{supercaseId}/populations/{populationId}/bulk-send](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.population_bulk_send_message.md)

### Get population membership

 - [GET /supercases/{supercaseId}/populations/{populationId}/members](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.population_members_list.md)

### Get membership as CSV

 - [GET /supercases/{supercaseId}/populations/{populationId}/members.csv](https://docs.peachfinance.com/api-docs/api-public/supercases/peach.supercases.handlers.population_members_list_csv.md)

## Do Not Interact

This object allows you to block interactions on a borrower; and must be connected with a case. You can
create multiple Do Not Interact instances on a borrower but only one instance on a case. There are two ways
to create Do Not Interacts:

1. Manually - after a case is created, you can manually create Do Not Interact objects on any borrower case.

2. In bulk on a Supercase, on the related subcases. See [Create Do Not Interact instances on all subcases](#tag/Supercases/operation/peach.supercases.handlers.supercase_bulk_create_dni)
for more details.


### Get case do not interacts

 - [GET /people/{personId}/cases/{caseId}/do-not-interacts](https://docs.peachfinance.com/api-docs/api-public/do-not-interact/peach.cases.events.handlers.do_not_interact.do_not_interact_get_all.md): Get the all DoNoInteract instances associated with a case.

### Create do not interact

 - [POST /people/{personId}/cases/{caseId}/do-not-interacts](https://docs.peachfinance.com/api-docs/api-public/do-not-interact/peach.cases.events.handlers.do_not_interact.do_not_interact_create.md)

### Remove do not interact

 - [DELETE /people/{personId}/cases/{caseId}/do-not-interacts/{doNotInteractId}](https://docs.peachfinance.com/api-docs/api-public/do-not-interact/peach.cases.events.handlers.do_not_interact.do_not_interact_delete.md): Update a DoNotInteract instance to have inactive status, and set the end date.

### Get do not interact by ID

 - [GET /people/{personId}/cases/{caseId}/do-not-interacts/{doNotInteractId}](https://docs.peachfinance.com/api-docs/api-public/do-not-interact/peach.cases.events.handlers.do_not_interact.do_not_interact_get_by_id.md): Get a single DoNotInteract object instance for the borrower using a unique ID.

### Update do not interact

 - [PUT /people/{personId}/cases/{caseId}/do-not-interacts/{doNotInteractId}](https://docs.peachfinance.com/api-docs/api-public/do-not-interact/peach.cases.events.handlers.do_not_interact.do_not_interact_update.md): Update a DoNotInteract instance with new information.

### Get all do not interacts

 - [GET /people/{personId}/do-not-interacts](https://docs.peachfinance.com/api-docs/api-public/do-not-interact/peach.people.do_not_interact.handlers.do_not_interact_get_all.md): Get the all DoNoInteract instances associated with a borrower.

## Do Not Interact Types

This object allows you to create custom `Do Not Interact Types` which will create
`Do Not Interact` instances automatically when case conditions are met. For example,
when a new `bankruptcy` case is `initiated`, the system can automatically create `Do Not Interact`
to block debt collection related interactions for 30 calendar days.

The conditions are set in the following way. There are two triggers and one condition fields that you can configure:
1. `onStatus` - triggered based on the case status.
2. `onOutcome` - triggered based on the case outcome.
3. `onCondition` - condition(s) based on case fields values.

You must provide at least one trigger, `onStatus` or `onOutcome`, when creating a new `Do Not Interact Type` object.

Few examples:
- `onStatus=processing`, `onOutcome=null`, `onCondition=null` - the `Do Not Interact`
instance will be created when the case status is changed to `processing`.
- `onStatus=completed`, `onOutcome=approved`, `onCondition=null` - the `Do Not Interact`
instance will be created when the case status is changed to `completed` and the outcome is `approved`.

`Do Not Interact Types` must be associated with `Case Types`. A `Do Not Interact Type` object can
be associated with multiple `Case Types`.


### Get types

 - [GET /do-not-interact-types](https://docs.peachfinance.com/api-docs/api-public/do-not-interact-types/peach.cases.events.handlers.do_not_interact_type.do_not_interact_type_get_all.md)

### Create type

 - [POST /do-not-interact-types](https://docs.peachfinance.com/api-docs/api-public/do-not-interact-types/peach.cases.events.handlers.do_not_interact_type.do_not_interact_type_create.md)

### Get type by ID

 - [GET /do-not-interact-types/{doNotInteractTypeId}](https://docs.peachfinance.com/api-docs/api-public/do-not-interact-types/peach.cases.events.handlers.do_not_interact_type.do_not_interact_type_get_by_id.md)

### Update type

 - [PUT /do-not-interact-types/{doNotInteractTypeId}](https://docs.peachfinance.com/api-docs/api-public/do-not-interact-types/peach.cases.events.handlers.do_not_interact_type.do_not_interact_type_update.md): Change the triggering conditions and settings of a draft type, or update the status of an active
type to deprecated. Doing the later will create a new draft version of the configuration unless
explicitly told not to.

## Notification Types

This object allows you to create custom `Notification Types` which will create
`interaction` instances (such as emails, text messages, etc.) automatically when case conditions are met. For example,
when a new `bankruptcy` case is `initiated`, the system can automatically send an email notification
and ask the borrower to provide supporting documents.

The conditions are set in the following way. There are two triggers and one condition fields that you can configure:
1. `onStatus` - triggered based on the case status.
2. `onOutcome` - triggered based on the case outcome.
3. `onCondition` - condition(s) based on case fields values.

You must provide at least one trigger, `onStatus` or `onOutcome`, when creating a new `Notification Type` object.

Few examples:
- `onStatus=processing`, `onOutcome=null`, `onCondition=null` - the `interaction`
instance will be created when the case status is changed to `processing`.
- `onStatus=completed`, `onOutcome=approved`, `onCondition=null` - the `interaction`
instance will be created when the case status is changed to `completed` and the outcome is `approved`.

`Notification Types` must be associated with `Case Types`. A `Notification Type` object can
be associated with multiple `Case Types`.


### Get types

 - [GET /notification-types](https://docs.peachfinance.com/api-docs/api-public/notification-types/peach.cases.events.handlers.notifications.notification_type_get_all.md)

### Create type

 - [POST /notification-types](https://docs.peachfinance.com/api-docs/api-public/notification-types/peach.cases.events.handlers.notifications.notification_type_create.md): Create a new type configuration for triggering notifications.

### Get type by ID

 - [GET /notification-types/{notificationTypeId}](https://docs.peachfinance.com/api-docs/api-public/notification-types/peach.cases.events.handlers.notifications.notification_type_get_by_id.md)

### Update type

 - [PUT /notification-types/{notificationTypeId}](https://docs.peachfinance.com/api-docs/api-public/notification-types/peach.cases.events.handlers.notifications.notification_type_update.md): Change the triggering conditions and settings of a draft type, or update the status of an active
type to deprecated.

## Notes

### Get notes

 - [GET /interactions/{interactionId}/notes](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.list_interaction_notes.md)

### Create note

 - [POST /interactions/{interactionId}/notes](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.create_interaction_note.md)

### Get note by ID

 - [GET /interactions/{interactionId}/notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.get_interaction_note.md)

### Update note

 - [PUT /interactions/{interactionId}/notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.update_interaction_note.md)

### Get notes

 - [GET /people/{personId}/cases/{caseId}/notes](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.list_case_notes.md)

### Create note

 - [POST /people/{personId}/cases/{caseId}/notes](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.create_case_note.md)

### Get note by ID

 - [GET /people/{personId}/cases/{caseId}/notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.get_case_note.md)

### Update note

 - [PUT /people/{personId}/cases/{caseId}/notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.update_case_note.md)

### Get interaction notes for a person

 - [GET /people/{personId}/interaction-notes](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.list_borrower_interaction_notes.md)

### Get notes

 - [GET /people/{personId}/notes](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.list_borrower_notes.md)

### Create note

 - [POST /people/{personId}/notes](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.create_borrower_note.md)

### Get note by ID

 - [GET /people/{personId}/notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.get_borrower_note.md)

### Update note

 - [PUT /people/{personId}/notes/{noteId}](https://docs.peachfinance.com/api-docs/api-public/notes/peach.notes.handlers.update_borrower_note.md)

## Workflows

### Get case workflow

 - [GET /companies/{companyId}/people/{personId}/cases/{caseId}/workflow](https://docs.peachfinance.com/api-docs/api-public/workflows/peach.workflows.handlers.get_case_workflow.md)

### Update workflow step status

 - [PUT /companies/{companyId}/people/{personId}/cases/{caseId}/workflow/steps/{workflowStepId}](https://docs.peachfinance.com/api-docs/api-public/workflows/peach.workflows.handlers.update_workflow_step.md)

### Update workflow workitem status

 - [PUT /companies/{companyId}/people/{personId}/cases/{caseId}/workflow/steps/{workflowStepId}/workitems/{workflowWorkitemId}](https://docs.peachfinance.com/api-docs/api-public/workflows/peach.workflows.handlers.update_workflow_workitem.md)

## Workflow Types

### Get workflow step types

 - [GET /companies/{companyId}/workflow-step-types](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.get_workflow_step_types.md)

### Create workflow step type

 - [POST /companies/{companyId}/workflow-step-types](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.create_workflow_step_type.md)

### Delete workflow step type

 - [DELETE /companies/{companyId}/workflow-step-types/{workflowStepTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.delete_workflow_step_type.md)

### Get workflow step type

 - [GET /companies/{companyId}/workflow-step-types/{workflowStepTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.get_workflow_step_type_by_id.md)

### Update workflow step type

 - [PUT /companies/{companyId}/workflow-step-types/{workflowStepTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.update_workflow_step_type.md)

### Get workflow types

 - [GET /companies/{companyId}/workflow-types](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.get_workflow_types.md)

### Create workflow type

 - [POST /companies/{companyId}/workflow-types](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.create_workflow_type.md)

### Export workflow, step and work item types.

 - [POST /companies/{companyId}/workflow-types/export](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.export_workflow_types.md)

### Restore previously exported workflow, step and work item types.

 - [POST /companies/{companyId}/workflow-types/import](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.import_workflow_types.md)

### Delete workflow type

 - [DELETE /companies/{companyId}/workflow-types/{workflowTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.delete_workflow_type.md)

### Get workflow type by ID

 - [GET /companies/{companyId}/workflow-types/{workflowTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.get_workflow_type_by_id.md)

### Update workflow type

 - [PUT /companies/{companyId}/workflow-types/{workflowTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.update_workflow_type.md)

### Get work item types

 - [GET /companies/{companyId}/workflow-workitem-types](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.get_workitem_types.md)

### Create work item type

 - [POST /companies/{companyId}/workflow-workitem-types](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.create_workitem_type.md)

### Delete work item type

 - [DELETE /companies/{companyId}/workflow-workitem-types/{workflowWorkitemTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.delete_workitem_type.md)

### Get work item type

 - [GET /companies/{companyId}/workflow-workitem-types/{workflowWorkitemTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.get_workitem_type_by_id.md)

### Update work item type

 - [PUT /companies/{companyId}/workflow-workitem-types/{workflowWorkitemTypeId}](https://docs.peachfinance.com/api-docs/api-public/workflow-types/peach.workflows.handlers.update_workitem_type.md)

## Tasks

Tasks are used to track work that needs to be done by agents in the CRM. Tasks
are automatically assigned to agents based on configurable characteristics of
the agents and the tasks.


### Get information on Twilio task queues

 - [GET /companies/{companyId}/twilio-queues](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.get_all_queues.md): Get information on task queues such as friendly name and task statistics.

### List Terminated Tasks

 - [GET /companies/{companyId}/twilio-terminated-tasks](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers_task_history.task_history_list.md)

### Get Terminated Task by ID

 - [GET /companies/{companyId}/twilio-terminated-tasks/{taskHistoryId}](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers_task_history.task_history_get.md)

### Clone Terminated Task by ID

 - [POST /companies/{companyId}/twilio-terminated-tasks/{taskHistoryId}/clone](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers_task_history.task_history_clone.md)

### Bulk Delete Unterminated Tasks

 - [DELETE /companies/{companyId}/twilio-unterminated-tasks](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.delete_unterminated_tasks.md): Bulk delete unterminated tasks from Twilio API. (this proxy's Twilio's
Task API).

An "unterminated" task is an "active" task—or any task which has yet to have its
task assignment status set to completed or canceled. See: https://www.twilio.com/docs/taskrouter/lifecycle-task-state

### List Unterminated Tasks

 - [GET /companies/{companyId}/twilio-unterminated-tasks](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.list_unterminated_tasks.md): Reads unterminated task from Twilio API. (This essentially proxies Twilio's
Task API).

Note that paging works differently on this endpoint in order for compatibility
with the Twilio API—but you can still use nextUrl and previousUrl

An "unterminated" task is an "active" task—or any task which has yet to have its
task assignment status set to completed or canceled. See: https://www.twilio.com/docs/taskrouter/lifecycle-task-state

### Deletes Unterminated Task by SID

 - [DELETE /companies/{companyId}/twilio-unterminated-tasks/{taskSid}](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.delete_unterminated_task.md): Delete the unterminated task from Twilio API (this proxy's Twilio's
Task API).

The deleted task immediately has its assignment status transition to canceled.
This also generates the Twilio event task.deleted.

An "unterminated" task is an "active" task—or any task which has yet to have its
task assignment status set to completed or canceled. See: https://www.twilio.com/docs/taskrouter/lifecycle-task-state

### Read Unterminated Task by SID

 - [GET /companies/{companyId}/twilio-unterminated-tasks/{taskSid}](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.read_unterminated_task.md): Read's the specified unterminated task from Twilio API (this proxy's Twilio's
Task API).

An "unterminated" task is an "active" task—or any task which has yet to have its
task assignment status set to completed or canceled. See: https://www.twilio.com/docs/taskrouter/lifecycle-task-state

### Abandon Unterminated Task by SID

 - [POST /companies/{companyId}/twilio-unterminated-tasks/{taskSid}/abandon](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.abandon_accepted_task.md): Abandon an unterminated, accepted task. i.e., Mark the task as "Unable to Complete"
and create a duplicate task.

An "unterminated" task is an "active" task—or any task which has yet to have its
task assignment status set to completed or canceled. See: https://www.twilio.com/docs/taskrouter/lifecycle-task-state

### List Taskrouter Workers

 - [GET /companies/{companyId}/twilio-workers](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers_workers.list_workers.md): List all Taskrouter Workers.

Note that this endpoint returns all Twilio workers up to 10,000—i.e., there
is no paging. It may suffer from poor performance for large numbers of workers.

### Get task availability

 - [GET /twilio/tasktype-availability](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.get_tasktype_availability.md)

### Update task type availability

 - [PUT /twilio/tasktype-availability](https://docs.peachfinance.com/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.update_tasktype_availability.md)

## Task-Worker Pairing Configs

Task-Worker Pairing Configs are used to configure the behavior of tasks in the CRM. A TWPC
is used to define the rules for how tasks are assigned to agents (i.e., workers).

In order to configure a TWPC you need to understand the contents of task and worker
objects. See the
<a href="/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.list_unterminated_tasks">List Unterminated Task</a>
endpoint and the
<a href="/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers_workers.list_workers">List Workers</a>
endpoint for more details.


### List task-worker pairing configs

 - [GET /companies/{companyId}/task-worker-pairing-configs](https://docs.peachfinance.com/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_list.md): List the task-worker pairing configs for a company.

### Create task-worker pairing config

 - [POST /companies/{companyId}/task-worker-pairing-configs](https://docs.peachfinance.com/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_create.md): Create a new task-worker pairing config.

Changes here will not take effect until synchronization is run. See:
Sync task-worker pairing configs to Twilio

### Sync task-worker pairing configs to Twilio

 - [POST /companies/{companyId}/task-worker-pairing-configs/sync](https://docs.peachfinance.com/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_sync.md): Perform synchronization of task-worker pairing config to Twilio. 

API changes to task-worker pairing configs will have no effect until this synchronization is run.

### Delete task-worker pairing config

 - [DELETE /companies/{companyId}/task-worker-pairing-configs/{taskWorkerPairingConfigId}](https://docs.peachfinance.com/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_delete.md): Delete a task-worker pairing config.

Changes here will not take effect until synchronization is run. See:
Sync task-worker pairing configs to Twilio

### Get task-worker pairing config

 - [GET /companies/{companyId}/task-worker-pairing-configs/{taskWorkerPairingConfigId}](https://docs.peachfinance.com/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_get.md)

### Update task-worker pairing config

 - [PUT /companies/{companyId}/task-worker-pairing-configs/{taskWorkerPairingConfigId}](https://docs.peachfinance.com/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_update.md): Update a task-worker pairing config.

Changes here will not take effect until synchronization is run. See:
Sync task-worker pairing configs to Twilio

## Loans

Borrowers typically have loans. We support multiple loan types and each loan type
comes with its set of federal and state compliance rules. You can maintain different statuses of a loan.
A borrower can have multiple loans. A loan can belong to multiple people, but
only one borrower can be defined as a `mainBorrower`. A loan is always created using
the `mainBorrower` borrower identifier. Other people can be added as part of the loan
details.

All loan attributes can be updated as long as the loan is in `pending` status. Once the
loan status changes to `originated` attributes of `atOrigination` object become read only and
cannot be updated.

A Loan doesn't start accruing interest until it is activated. To activate the loan, call `Activate a loan`.
On activation the loan can use the due dates and payments schedule from the `atOrigination` object
or the loan can be re-amortized using the activation date as the loan start date.


### Get loans

 - [GET /loans](https://docs.peachfinance.com/api-docs/api-public/loans/peach.loans.handlers.loans_get_by_company.md): Get all loans associated with a company.

### Get borrower's loans

 - [GET /people/{personId}/loans](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loans_get.md)

### Create loan

 - [POST /people/{personId}/loans](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loans_add.md): Add a new loan.

### Get loan by ID

 - [GET /people/{personId}/loans/{loanId}](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_get.md)

### Update loan

 - [PUT /people/{personId}/loans/{loanId}](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_update.md)

### Accelerate loan

 - [POST /people/{personId}/loans/{loanId}/accelerate](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_accelerate.md): The accelerate endpoint will change the status of an active loan to accelerated,
and trigger any acceleration-related logic and accounting treatment.

Acceleration is only valid for installment and line of credit loans.

### Activate loan

 - [POST /people/{personId}/loans/{loanId}/activate](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_activate.md)

### Cancel loan

 - [POST /people/{personId}/loans/{loanId}/cancel](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_cancel.md): The cancel loan endpoint will change the status of a loan to canceled, and
trigger any cancellation-related logic, such as removing a loan from active monitoring
and handling the accounting treatment for canceled loans.

An installment loan must be in originated or pending status to be canceled.

A line of credit loan can be canceled if it has no draws with active purchases.

Special permission is required to cancel active loans.

The metro2 details may optionally be sent with the accountStatusCode to indicate
what should be reported to credit agencies.

### Charge-off loan

 - [POST /people/{personId}/loans/{loanId}/charge-off](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_charge_off.md): The charge-off endpoint will change the status of a loan to chargedOff, and trigger any
charge-off-related logic and accounting treatment.

A loan must be in accelerated status before being moved to chargedOff. If an active loan
is being charged off, this endpoint will handle moving the loan status to acceleration
before charging off. Charge-off is only valid for installment and line of credit loans.

### Close loan

 - [POST /people/{personId}/loans/{loanId}/close](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_close.md): Closing a loan
  - For line of credit - Prevents new draws from being opened and closes existing draws to block new purchases.
  - For installment loan with multiple advances - Prevents new advances from being created and cancels existing scheduled advances.
  - Stops further credit extension while maintaining existing balances and payment obligations.

### Get loan credit limit

 - [GET /people/{personId}/loans/{loanId}/credit-limit](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_get_credit_limit.md)

### Update loan credit limit

 - [POST /people/{personId}/loans/{loanId}/credit-limit](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_update_credit_limit.md)

### Freeze loan

 - [POST /people/{personId}/loans/{loanId}/freeze](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_freeze.md): Freeze loan will change the status of an active loan to frozen effective as of the
current date. The loan will remain in a frozen status until the Unfreeze endpoint is
called.

### Get loan lock status

 - [GET /people/{personId}/loans/{loanId}/lock-status](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.get_lock_status.md)

### Migrate loan

 - [POST /people/{personId}/loans/{loanId}/migrate](https://docs.peachfinance.com/api-docs/api-public/loans/peach.loans.migration.handlers.loan_migrate.md)

### Refresh loan

 - [POST /people/{personId}/loans/{loanId}/refresh](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_refresh.md): In the case that a loan is out of sync, the refresh endpoint will make sure that
obligations, expected payments, and interest accrual is brought into sync.

Refresh loan is only valid for the statuses of active, accelerate, paidOff, and chargedOff.

### Reimburse

 - [POST /people/{personId}/loans/{loanId}/reimburse](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_reimburse.md): The reimburse endpoint should be used when the lender owes money to a borrower on a given loan.
The endpoint will execute a reimbursement according to the specified reimbursementAmount. If the reimbursementAmount is greater than the amount owed to the borrower, the system will not process the reimbursement and return an error. Funds are reimbursed to a specified payment instrument. The endpoint will update the ledger and create a new transaction.

If the loan type is installment, the loan must be in paidOff status to process reimbursement.
If the loan type is line of credit, the loan can be in active, accelerated, chargedOff or paidOff status to process reimbursement.

If paymentInstrumentId is isExternal=true, the payment method can be of any type (e.g. bank account, card, etc.)
If paymentInstrumentId is isExternal=false and Peach is processing payments (per company configuration), the payment method must be a bank account.

Please note for external reimbursements, the lender is responsible for transitioning the transaction status.

### Reopen a closed loan

 - [POST /people/{personId}/loans/{loanId}/reopen](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_reopen.md): Reopen a closed loan. This will allow new draws to be added to a line of credit. Draws in paidOff status will not be reopened.

### Reverse accelerate

 - [POST /people/{personId}/loans/{loanId}/reverse-accelerate](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_accelerate_reverse.md): A loan must be in accelerated status to be reversed.

The reverse accelerate endpoint will reverse a loan in accelerated status, and roll back any acceleration-related
logic and accounting treatment.

Reverse acceleration triggers a replay of the loan starting from the day of acceleration as if the loan was in active
status. This means if the acceleration occurred on day 90 of the loan, and the reverse acceleration is triggered on day
100, the loan will be replayed as an active loan with interest accrual between days 90-100. If the reversal is
triggered on day 90 (the same day of the acceleration), no additional interest is accrued. The result of a reverse
acceleration is a loan in active status.

The accelerationDueWithin and chargeOffDueWithin configurations of the loan are still in force. So a loan could
possibly go back to accelerated or chargedOff status during the next day if the balance is not paid on the day a
reversal was made.

### Reverse charge-off

 - [POST /people/{personId}/loans/{loanId}/reverse-charge-off](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_charge_off_reverse.md): A loan must be in chargedOff status to be reversed.

The reverse charge-off endpoint will reverse a loan in chargedOff status, and roll back any charge-off-related logic
and accounting treatment.

Reverse charge-off triggers a replay of the loan starting from the day of charge off as if the loan was in active
status. This means if the charge-off occurred on day 120 of the loan, and the reverse charge-off is triggered on day
130, the loan will be replayed as an active loan with interest accrual between days 120-130. If the reversal is
triggered on day 120 (the same day of the charge-off), no additional interest is accrued. The result of a reverse
charge-off is a loan in active status.

The chargeOffDueWithin configurations of the loan is still in force. So a loan could possibly go back to chargedOff
status during the next day if the balance is not paid on the day a reversal was made.

### Unfreeze loan

 - [POST /people/{personId}/loans/{loanId}/unfreeze](https://docs.peachfinance.com/api-docs/api-public/loans/peach.people.loans.handlers.loan_unfreeze.md): The Unfreeze endpoint will change the status of a frozen loan back to active, accelerated or chargedOff.

If the account was overdue before it was frozen, the system will use the earliest overdue due date (before the freeze date)
to count the number of days overdue and might accelerate or charge off the account (based on the loan type configurations) as
part of the unfreeze process. After the unfreeze process is completed, you can reverse the chargedOff status and take
additional actions such as posting a payment to make the account current.

## Installment Advances

This object represents an installment advance (also called loan proceeds or loan disbursements). Advances should be used for installment
loans of type "multiple advances". Advances can be made on Loan objects only. To clarify, Advances cannot be made on Line of Credit
objects. Advances increase principal balance of a Loan. Each advance has a unique identifier.


### Get advances

 - [GET /people/{personId}/loans/{loanId}/advances](https://docs.peachfinance.com/api-docs/api-public/installment-advances/peach.people.loans.installment_advances.handlers.get_loan_advances.md): Returns an installment loan's advances

### Create advance

 - [POST /people/{personId}/loans/{loanId}/advances](https://docs.peachfinance.com/api-docs/api-public/installment-advances/peach.people.loans.installment_advances.handlers.create_loan_advance.md)

### Get advance by ID

 - [GET /people/{personId}/loans/{loanId}/advances/{advanceId}](https://docs.peachfinance.com/api-docs/api-public/installment-advances/peach.people.loans.installment_advances.handlers.get_loan_advance.md): Returns an installment loan advance

### Update advance

 - [PUT /people/{personId}/loans/{loanId}/advances/{advanceId}](https://docs.peachfinance.com/api-docs/api-public/installment-advances/peach.people.loans.installment_advances.handlers.update_loan_advance.md)

## Installment Refunds

This object represents refunds. Various situations require full or partial refunds of a loan. Depending on the refund
amount and whether the borrower has made payments, a refund may also trigger a reimbursement to the borrower.


### Get refunds

 - [GET /people/{personId}/loans/{loanId}/refunds](https://docs.peachfinance.com/api-docs/api-public/installment-refunds/peach.people.loans.handlers.loan_refunds_get.md): Returns a list of all prior refunds for the loan, as well as the remaining eligible refund amount.

### Create refund

 - [POST /people/{personId}/loans/{loanId}/refunds](https://docs.peachfinance.com/api-docs/api-public/installment-refunds/peach.people.loans.handlers.loan_refunds_post.md): The refund endpoint will execute a full or partial refund according to the refundAmount specified.
A full refund is equal to the amountFinancedAtOrigination. An atFaultParty must also be specified,
in order to trigger the corresponding accounting entries related to billing for the refund.

### Create refund v2

 - [POST /people/{personId}/loans/{loanId}/refunds-v2](https://docs.peachfinance.com/api-docs/api-public/installment-refunds/peach.people.loans.handlers.loan_refunds_v2_post.md): The refund endpoint will execute a full or partial refund according to the refundAmount specified.
The total of all refunds cannot exceed the amountFinanced (or principalAmount)  passed at origination.

A refund is applied in the following way:
- The system first depletes any non-due principal.
  This amount will be stored as refundDetails.refundNonDuePrincipalAmount.
- If any refund amount is left to apply, the system will create a transaction of type service credit and serviceCreditType=refund.
  This transaction will be applied on the loan using the "payment waterfall".
  This amount will be stored as refundDetails.refundTransactionAmount.
- After the system applies the serviceCreditType=refund, if there is any remaining unapplied
  refund amount, it will be recorded as credit to the borrower (also called reimbursementAmount or amount owed to borrower.)
- The system will replay the loan from the refundDate.

Please consider the following before creating refunds:

- If you want to fully refund the loan including interest and fees, pass the following:
  - refundDate equals the activation date.
  - refundAmount equals the amount financed.
  - isRefundOriginationFees, isRefundLateFees and isRefundOtherFees set to true.
  - isRefundMDR and isRefundDownPayment - set these attributes depending on your policy.
- If you want to partially refund the loan with prorated interest and/or fees, set the following. Prorated interest means
  the system will lower the principal from the activation date and re-accrue interest.
  - refundDate equals the activation date.
  - refundAmount equals a partial refund amount.
  - isRefundOriginationFees, isRefundLateFees and isRefundOtherFees - set these values depending on your policy.
  - isRefundMDR - set this attribute depending on your policy.
  - isRefundDownPayment - set to false. To remind: this attribute can be true only for a full refund.
- If you want to partially refund the loan without prorating interest and/or fees prior the refund date, set the following:
  - refundDate equals an effective date of the refund (or keep empty to indicate "today").
  - refundAmount equals a partial refund amount.
  - isRefundOriginationFees, isRefundLateFees and isRefundOtherFees set to false.
  - isRefundMDR - set to false. To remind: this attribute can be true only if refundDate equals the activation date.
  - isRefundDownPayment - set to false. To remind: this attribute can be true only for a full refund.

### Cancel refund

 - [POST /people/{personId}/loans/{loanId}/refunds/{loanRefundId}/cancel](https://docs.peachfinance.com/api-docs/api-public/installment-refunds/peach.people.loans.handlers.loan_refunds_cancel.md): Cancel a refund.

## Line of Credit Draws

This object represents a draw. Draws can be made on Line of Credit loans only. Draws can be amortized
or non-amortized. If amortized, the draw will be amortized over the selected number of periods and aligned to the Line of
Credit due dates. If non-amortized, the draw is due on a due date following the current period statement creation.
A draw can have different interest and promo rates from the Line of Credit. Each draw has a unique identifier, similar to a loan.


### Preview draw amortization

 - [POST /people/{personId}/loans/{loanId}/amortize-preview](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.preview_draw_amortize.md): This endpoint is used for previewing draw amortization. The draw must have non-due principal to be amortized.

Note:
- If the loan type is configured to accrue interest as accrualMethod=compoundWithFees, there is a
known limitation to the draw amortization calculation logic.
- The draw amortization calculation will be done using the compound method and not compoundWithFees.
To ensure that the system calculates interest accurately, amortized draws should NOT include any fees.

### Get draws

 - [GET /people/{personId}/loans/{loanId}/draws](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.loan_draws_get.md)

### Create draw

 - [POST /people/{personId}/loans/{loanId}/draws](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.loan_draws_post.md)

### Get draw by ID

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.loan_draw_get.md)

### Update draw

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.draw_update.md)

### Activate draw

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/activate](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.draw_activate.md)

### Amortize draw

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/amortize](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.loan_draw_amortize.md): This endpoint is used for draw amortization. The draw must have non-due principal to be reamortized.

Note:
- If the loan type is configured to accrue interest as accrualMethod=compoundWithFees, there is a
known limitation to the draw amortization calculation logic.
- The draw amortization calculation will be done using the compound method and not compoundWithFees.
To ensure that the system calculates interest accurately, amortized draws should NOT include any fees.

### Cancel draw

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/cancel](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.draw_cancel.md): The cancel loan endpoint will change the status of a draw to canceled, and
trigger any cancellation-related logic.

An active draw can be canceled if it has no active purchases.

### Close draw

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/close](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.draw_close.md): Closing a draw means that the draw can no longer accept new purchases. Once all of its purchases are settled, its balance is
depleted and all payments are processed, the draw will transition to paidOff status.

### Get draw credit limit

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/credit-limit](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.draw_get_credit_limit.md)

### Update draw credit limit

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/credit-limit](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.draw_update_credit_limit.md)

### Update draw fees

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}/dynamic-fees](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.fees.handlers.draw_dynamic_fees_at_origination_update.md): Allows lenders to add or remove dynamic fees from a draw going forward. This does not affect balances or fees in the past.

### Update draw min pay calculation

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/min-payment-calculation](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.draw_min_payment_calculation_post.md)

### Reopen draw

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/reopen](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-draws/peach.people.loans.draws.handlers.draw_reopen.md): Reopen a closed draw. This will allow new purchases to be added to the draw. Draws in paidOff status cannot be reopened.

## Line of Credit Purchases

This object represents a line of credit purchase. Purchases can be made on Draw objects only. Purchases of type regular increase
principal balance of a Draw. Some purchase types, such as `cashBack` or `refund` are actually reduce the principal balance of a Draw.
Each purchase has a unique identifier.


### Get line of credit purchase disputes

 - [GET /people/{personId}/loans/{loanId}/disputes](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.loans.purchase_disputes.handlers.purchase_disputes_list_for_loc.md)

### Get draw purchase disputes

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/disputes](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.loans.purchase_disputes.handlers.purchase_disputes_list_for_draw.md)

### Get draw purchases

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/purchases](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.draw_purchases_get.md)

### Create purchase

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/purchases](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.draw_purchases_create.md)

### Get draw purchases timeline

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/purchases-timeline](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.draw_purchases_timeline_get.md): Get draw purchases timeline is designed to provide a sequential ordering of purchases using specific purchase timestamps passed to Peach as part of the query parameters. To generate the timeline, Peach "inserts" purchases using the first available timestamp provided in the query parameters. For example, if effectiveAt and authorizedAt are provided in that order, Peach will
- check first for an effectiveAt timestamp. If it exists, insert into timeline using effectiveAt timestamp.
- if effectiveAt does not exist, check for authorizedAt. If it exists, insert into timeline using authorizedAt timestamp.
- if neither exist, insert purchase into timeline using createdAt.

### Get purchase by ID

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.draw_purchase_get_one.md)

### Update purchase

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.draw_purchase_update.md)

### Get purchase disputes

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.loans.purchase_disputes.handlers.purchase_disputes_list_for_purchase.md)

### Create purchase dispute

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.loans.purchase_disputes.handlers.purchase_dispute_create.md): Creates a new purchase dispute. Purchases in authorized status may not be disputed. They must first 
be written to the ledger by changing the status of the purchase or creating a new purchase object in 
pending or settled status. Once one of those steps have been taken, the purchase may be disputed.

### Get purchase dispute by ID

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes/{purchaseDisputeId}](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.loans.purchase_disputes.handlers.purchase_dispute_get.md)

### Update purchase dispute

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes/{purchaseDisputeId}](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.loans.purchase_disputes.handlers.purchase_dispute_update.md)

### Get line of credit purchases

 - [GET /people/{personId}/loans/{loanId}/purchases](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.loan_purchases_get.md)

### Get line of credit purchases timeline

 - [GET /people/{personId}/loans/{loanId}/purchases-timeline](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.loan_purchases_timeline_get.md): Get line of credit purchases timeline is designed to provide a sequential ordering of purchases using specific purchase timestamps passed to Peach as part of the query parameters. To generate the timeline, Peach "inserts" purchases using the first available timestamp provided in the query parameters. For example, if effectiveAt and authorizedAt are provided in that order, Peach will
- check first for an effectiveAt timestamp. If it exists, insert into timeline using effectiveAt timestamp.
- if effectiveAt does not exist, check for authorizedAt. If it exists, insert into timeline using authorizedAt timestamp.
- if neither exist, insert purchase into timeline using createdAt.

## Line of Credit Migration

### Get migration period draw data

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/migration/period](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.migration_period.handlers.migration_period_draw_get.md)

### Create migration period draw data

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/migration/period](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.migration_period.handlers.migration_period_draw_create.md): This endpoint allows you to pass additional details about draws in preparation for migration.

The "migration period" is the period in which you execute the migration. This is the period from which the Peach system takes control over the line. This period is considered to be "open" at the time of the migration. The migration needs to be completed before the upcoming due date. To clarify, the upcoming due date corresponds to the previous period's statement date.

The "Migration cutoff date" is the most recent statement date relative to the day on which you execute the migration process. This date is also the startDate of the migration period.

The "Migration at date" is the actual date on which you execute the migration.

For example:
- Migration period:
  - startDate: Aug 1, 2024
  - endDate: Aug 31, 2024
  - statementDate: Sep 1, 2024
  - dueDate: Sep 22, 2024
- Previous period (also called 'past period'):
  - startDate: Jul 1, 2024
  - endDate: Jul 31, 2024
  - statementDate: Aug 1, 2024
  - dueDate: Aug 22, 2024
- Notes:
  - 'Migration cutoff date' is Aug 1, 2024.
  - If you execute the migration on Aug 10, 2024, the 'migration at date' is Aug 10.
  - Previous period's dueDate, Aug 22, 2024, falls in the 'migration period' that starts on Aug 1, 2024 and ends on Aug 31, 2024.
  - The upcoming due date is Aug 22, 2024.
  - If you didn't complete the migration before Aug 22, 2024, you need to cancel the loan and start the process again.

### Update migration period draw data

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}/migration/period](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.migration_period.handlers.migration_period_draw_update.md)

### Delete past period data

 - [DELETE /people/{personId}/loans/{loanId}/migration/past-periods](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.past_periods.handlers.past_periods_data_delete.md): Deletes past period in preparation for migration.

### Get past period data

 - [GET /people/{personId}/loans/{loanId}/migration/past-periods](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.past_periods.handlers.past_periods_data_list.md): Get past period in preparation for migration.

### Create past periods data

 - [POST /people/{personId}/loans/{loanId}/migration/past-periods](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.past_periods.handlers.past_periods_data_create.md): Creates past periods in preparation for migration.

### Update past period data

 - [PUT /people/{personId}/loans/{loanId}/migration/past-periods](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.past_periods.handlers.past_periods_data_update.md): Updates past period in preparation for migration.

### Get past transactions

 - [GET /people/{personId}/loans/{loanId}/migration/past-transaction](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.past_transactions.handlers.past_transaction_data_get_all.md)

### Create past transaction

 - [POST /people/{personId}/loans/{loanId}/migration/past-transaction](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.past_transactions.handlers.past_transaction_data_create.md): Creates past transaction in preparation for line of credit migration.

### Get past transaction by ID

 - [GET /people/{personId}/loans/{loanId}/migration/past-transaction/{transactionId}](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.past_transactions.handlers.past_transaction_data_get_one.md)

### Update past transaction

 - [PUT /people/{personId}/loans/{loanId}/migration/past-transaction/{transactionId}](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.past_transactions.handlers.past_transaction_data_update.md): Update past transaction in preparation for line of credit migration.

Note: After migration, you should call the "Update transaction" endpoint.

### Get migration period LOC data

 - [GET /people/{personId}/loans/{loanId}/migration/period](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.migration_period.handlers.migration_period_loc_get.md)

### Create migration period LOC data

 - [POST /people/{personId}/loans/{loanId}/migration/period](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.migration_period.handlers.migration_period_loc_create.md): This endpoint allows you to pass additional details about the line in preparation for migration.

The "Migration period" is the period in which you execute the migration. This is the period from which the Peach system takes control over the line. This period is considered to be "open" at the time of the migration. The migration needs to be completed before the upcoming due date. To clarify, the upcoming due date corresponds to the previous period's statement date.

"Migration cutoff date" is the most recent statement date relative to the day on which you execute the migration process. This date is also the startDate of the migration period.

"Migration at date" is the actual date on which you execute the migration.

For example:
 - Migration period:
    - startDate: Aug 1, 2024
    - endDate: Aug 31, 2024
    - statementDate: Sep 1, 2024
    - dueDate: Sep 22, 2024
 - Previous period (also called "past period"):
    - startDate: Jul 1, 2024
    - endDate: Jul 31, 2024
    - statementDate: Aug 1, 2024
    - dueDate: Aug 22, 2024
 - Notes:
    - "Migration cutoff date" is Aug 1, 2024.
    - If you execute the migration on Aug 10, 2024, the "migration at date" is Aug 10.
    - Previous period's dueDate, Aug 22, 2024, falls in the "migration period" that starts on Aug 1, 2024 and ends on Aug 31, 2024.
    - The upcoming due date is Aug 22, 2024.
 - If you didn't complete the migration before Aug 22, 2024, you need to cancel the loan and start the process again.

### Update migration period LOC data

 - [PUT /people/{personId}/loans/{loanId}/migration/period](https://docs.peachfinance.com/api-docs/api-public/line-of-credit-migration/peach.loans.migration.migration_period.handlers.migration_period_loc_update.md)

## Expected Payments

This object represents the expected loan payments on due dates. Expected payments are what we expect to
receive from a borrower on a specific date. Expected payments are created as a result of loan amortization.
The amounts and due dates can change during lifetime of a loan. For example, a borrower might change due dates
frequency from `monthly` to `weekly` and it will lower periodic payment amount.


### Defer installment single due date

 - [POST /people/{personId}/loans/{loanId}/defer-due-date](https://docs.peachfinance.com/api-docs/api-public/expected-payments/peach.people.loans.expected_payments.handlers.loan_due_date_defer.md): Defer single due date takes the amount in a selected due date and defers the amount to another due date in the
future. The deferral amount can be moved to an existing due date or alternatively, to a new due date added after
the last existing due date. These two options are mutually exclusive.

Fees associated with the amount in the period to be deferred will not be moved.

Limitations:
- Cannot defer due date which is due on the day of the request. e.g. Cannot defer 1/31 on 1/31
- Only applicable to installment loans.

### Defer installment schedule

 - [POST /people/{personId}/loans/{loanId}/defer-schedule](https://docs.peachfinance.com/api-docs/api-public/expected-payments/peach.people.loans.expected_payments.handlers.loan_schedule_defer.md): Defer schedule allows lenders to shift the entire expected payments schedule. There are two use cases:

Defer during the first period of the loan. In this scenario we "extend" the first period by
the requested buffer (while honoring frequency and specific days). As a result, the first due
date will be shifted in the future (and all subsequent due dates).

Defer after the first period has passed. In this scenario, we defer all due dates that fall
between "today's date" and "today's date + buffer days" to the end of the loan one by one.
It will extend the term of the loan by the number of periods equal to number of due dates that were deferred.
If the current date falls on a due date, it will not be deferred as the period has ended.

Only applicable to installment loans.

### Get draw expected payments

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/expected-payments](https://docs.peachfinance.com/api-docs/api-public/expected-payments/peach.people.loans.expected_payments.handlers.draw_expected_payments_get.md)

### Defer remaining balances for a draw

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/expected-payments/defer-remaining-balances](https://docs.peachfinance.com/api-docs/api-public/expected-payments/peach.people.loans.expected_payments.handlers.defer_remaining_draw_balances.md): Defer draw single or multiple due dates.
The selected due dates to defer can only be due dates for which
the statement was already generated.
Past due dates should always have statements.
Upcoming due date can only be selected if the statement was
already generated.

### Get loan expected payments

 - [GET /people/{personId}/loans/{loanId}/expected-payments](https://docs.peachfinance.com/api-docs/api-public/expected-payments/peach.people.loans.expected_payments.handlers.loan_expected_payments_get.md)

### Change due dates schedule

 - [POST /people/{personId}/loans/{loanId}/expected-payments](https://docs.peachfinance.com/api-docs/api-public/expected-payments/peach.people.loans.expected_payments.handlers.loan_change_due_dates_schedule_post.md): Change due date allows the customer to change the frequency of a loan and/or the specific day(s) that
due dates will fall on. This is not supported for loans with periodCalculationType=statementDate.

For accounts/loans with frequency!=singleTerm (aka non-single term), modifications to the expected payments schedule resulting
from Change Due Date do not impact the current period. Changes are only effective starting in the next period.

For accounts/loans with frequency=singleTerm, only specific days can be modified. The change impacts the current (single)
period of the loan. The caller must pass dueDatesFrequency=singleTerm.

- Note: In certain circumstances when requesting a new specificDays, the first adjusted period (with the new specificDays) can be 
pushed out an additional "cycle" in order to prevent the dueDate of the current period (with the current specificDays) from 
falling outside the first adjusted period. To achieve this, the max gapBetweenDueDates may be exceeded.

### Defer remaining balances for all active draws

 - [POST /people/{personId}/loans/{loanId}/expected-payments/defer-remaining-balances](https://docs.peachfinance.com/api-docs/api-public/expected-payments/peach.people.loans.expected_payments.handlers.defer_remaining_loc_balances.md): Defer line of credit single or multiple due dates.
The system will defer amounts across the line of credit and all
draws.
The selected due dates to defer can only be due dates for which
the statement was already generated.
Past due dates should always have statements.
Upcoming due date can only be selected if the statement was
already generated.

Note: If the line of credit has origination fee, unpaid
origination fee cannot be deferred.
Other balances can be deferred.

### Change installment loan terms

 - [POST /people/{personId}/loans/{loanId}/payment-plan](https://docs.peachfinance.com/api-docs/api-public/expected-payments/peach.people.loans.expected_payments.handlers.loan_change_terms.md): Change loan terms creates a customer payment plan for the borrower. There are several options:

The first option is passing in duration, which we use to calculate the new recurring amount going forward.
The second option is passing in the recurringAmount, which we use to calculate the remaining duration of
the loan. The third option is not passing either duration or recurringAmount, in which case the behavior
is similar to the Change Due Date endpoint. The fourth option is passing duration and recurringAmount, which
we use to calculate the final payment amount

Unlike the Change Due Date endpoint, for the Change Loan Terms endpoint, any modifications to the amount in
the expected payments schedule resulting from Change Loan Terms are effective from the current period. But
modifications to the dueDate in the expected payments schedule are only effective starting in the next period.

For all four options, it is optional to specify a new frequency and/or specific days. Change loan terms will cancel any due date deferrals
for the current or future periods.

Only applicable to installment loans.

## Obligations

This object represents information on the borrower's obligation for a given loan period. It also provides information
on the current status of the fulfillment of the obligation vis-à-vis the amount due and the due date. The obligation
is dynamically changing as a result of factors such as payments and service credits made, and the crossing over of due dates.


### Get draw obligations

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/obligations](https://docs.peachfinance.com/api-docs/api-public/obligations/peach.obligations.handlers.draw_obligations_get_all.md)

### Get draw obligation by ID

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/obligations/{obligationId}](https://docs.peachfinance.com/api-docs/api-public/obligations/peach.obligations.handlers.draw_obligation_get_by_id.md)

### Get loan obligations

 - [GET /people/{personId}/loans/{loanId}/obligations](https://docs.peachfinance.com/api-docs/api-public/obligations/peach.obligations.handlers.obligations_get_all.md)

### Get loan obligation by ID

 - [GET /people/{personId}/loans/{loanId}/obligations/{obligationId}](https://docs.peachfinance.com/api-docs/api-public/obligations/peach.obligations.handlers.obligation_get_by_id.md)

## Periods

### Get loan periods

 - [GET /people/{personId}/loans/{loanId}/periods](https://docs.peachfinance.com/api-docs/api-public/periods/peach.people.loans.handlers.get_loan_periods.md): Returns loan's payment periods.

### Get loan period by id

 - [GET /people/{personId}/loans/{loanId}/periods/{loanPeriodId}](https://docs.peachfinance.com/api-docs/api-public/periods/peach.people.loans.handlers.get_loan_period_by_id.md): Returns a single loan period

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

## SCRA

### Delete line of credit loan terms SCRA

 - [DELETE /people/{personId}/loans/{loanId}/loc-payment-plan-scra](https://docs.peachfinance.com/api-docs/api-public/scra/peach.people.loans.expected_payments.handlers.loc_change_terms_scra_delete.md): Removes a single SCRA interest rate (interestType=AbsoluteScra) on a line of credit loan.

The specified rateId must refer to an active SCRA interest rate on the loan.

Note: This endpoint currently validates the request but does not yet remove an
SCRA payment plan. Full plan removal will be added once the spec is finalized.

### Create line of credit loan terms SCRA

 - [POST /people/{personId}/loans/{loanId}/loc-payment-plan-scra](https://docs.peachfinance.com/api-docs/api-public/scra/peach.people.loans.expected_payments.handlers.loc_change_terms_scra_create.md): Creates SCRA (Servicemembers Civil Relief Act) terms for a line of credit loan.

For the SCRA period, the loan rate is lowered (default 6%) and fees may be canceled.
Only applicable to line of credit loans.

The startDate must be before or equal to endDate, and both must fall within
the loan's lifetime. The annualRate cannot exceed 6% per US federal regulations.
Overlapping SCRA periods are not allowed.

Note: This endpoint currently validates the request but does not yet create an
SCRA payment plan. Full plan creation will be added once the spec is finalized.

### Change line of credit loan terms SCRA

 - [PUT /people/{personId}/loans/{loanId}/loc-payment-plan-scra](https://docs.peachfinance.com/api-docs/api-public/scra/peach.people.loans.expected_payments.handlers.loc_change_terms_scra_update.md): Modifies the start date or end date of a single SCRA interest rate (interestType=AbsoluteScra)
on a line of credit loan.

The new startDate must be before or equal to endDate, and both must fall within
the loan's lifetime. The modified SCRA period must not overlap with other SCRA plans.

Note: This endpoint currently validates the request but does not yet modify an
SCRA payment plan. Full plan modification will be added once the spec is finalized.

### Delete installment loan terms SCRA

 - [DELETE /people/{personId}/loans/{loanId}/payment-plan-scra](https://docs.peachfinance.com/api-docs/api-public/scra/peach.people.loans.expected_payments.handlers.loan_change_terms_scra_delete.md): This endpoint is used for removing a single SCRA interest rate (interestType=AbsoluteScra) on a loan. Only applicable to installment loans. 

If the SCRA start date is in the past, this will replay the loan.

When an existing SCRA plan is updated or deleted, the system determines whether fees should be canceled or revived based on the isCancelFees value from the original SCRA plan.
For example, if we are updating the SCRA plan:

Expanding the SCRA period
- If isCancelFees = true, we will cancel fees within the extended SCRA plan period.
- If isCancelFees = false, we will not cancel any fees within the extended SCRA plan period.

Shrinking the SCRA period
- If isCancelFees = true, we will revive any previously canceled fees within the portion of the SCRA plan period that is being removed.
- If isCancelFees = false, we will not revive any fees since there were no fees canceled in the original SCRA plan.

### Create installment loan terms SCRA

 - [POST /people/{personId}/loans/{loanId}/payment-plan-scra](https://docs.peachfinance.com/api-docs/api-public/scra/peach.people.loans.expected_payments.handlers.loan_change_terms_scra_create.md): Creates a customer payment plan for the borrower in accordance with SCRA regulations.
Only applicable to installment loans.

### Change installment loan terms SCRA

 - [PUT /people/{personId}/loans/{loanId}/payment-plan-scra](https://docs.peachfinance.com/api-docs/api-public/scra/peach.people.loans.expected_payments.handlers.loan_change_terms_scra_update.md): This endpoint is used for modifying the start date or end date of a single SCRA interest rate (interestType=AbsoluteScra).
Only applicable to installment loans.

If the SCRA start date is in the past, this will replay the loan.

When an existing SCRA plan is updated or deleted, the system determines whether fees should be canceled or revived based on the isCancelFees value from the original SCRA plan.
For example, if we are updating the SCRA plan:

Expanding the SCRA period
- If isCancelFees = true, we will cancel fees within the extended SCRA plan period.
- If isCancelFees = false, we will not cancel any fees within the extended SCRA plan period.

Shrinking the SCRA period
- If isCancelFees = true, we will revive any previously canceled fees within the portion of the SCRA plan period that is being removed.
- If isCancelFees = false, we will not revive any fees since there were no fees canceled in the original SCRA plan.

## Promise to Pay Plans

This object represents a `Promise to Pay Plan`. A `Promise to Pay Plan` is a group of Promise to Pay
Periods— unscheduled payments that was verbally committed by a borrower. `Promise to Pay Plan`s are
defined on an account level. `Promise to Pay Plan`s are not guaranteed payments. They are used to track
verbal commitments made by borrowers.

Note: When creating or updating a `Promise to Pay Plan`, either pass a `schedule` object, or pass schedule descriptor
attributes— `startDate`, `frequency`, `specificDays`, `duration` and `amount`. Mixing the two
approaches is not allowed.


### Evaluate Promise to Pay Plan, does not require personId

 - [PUT /companies/{companyId}/loans/{loanId}/promise-to-pay-plans/{promiseToPayPlanId}/evaluate](https://docs.peachfinance.com/api-docs/api-public/promise-to-pay-plans/peach.loans.promise_to_pays.handlers.internal_evaluate_promise_to_pay_plan.md): Evaluates a Promise to Pay Plan and updates the status and isOverdue of the Promise to Pay Plan.

### Get Promise to Pay Plans for a Loan

 - [GET /people/{personId}/loans/{loanId}/promise-to-pay-plans](https://docs.peachfinance.com/api-docs/api-public/promise-to-pay-plans/peach.loans.promise_to_pays.handlers.get_promise_to_pay_plans_by_loan.md): Returns Promise to Pay Plans for a given Loan.

### Create Promise to Pay Plan

 - [POST /people/{personId}/loans/{loanId}/promise-to-pay-plans](https://docs.peachfinance.com/api-docs/api-public/promise-to-pay-plans/peach.loans.promise_to_pays.handlers.create_promise_to_pay_plan.md): Creates a new Promise to Pay Plan.

### Get Promise to Pay Plan

 - [GET /people/{personId}/loans/{loanId}/promise-to-pay-plans/{promiseToPayPlanId}](https://docs.peachfinance.com/api-docs/api-public/promise-to-pay-plans/peach.loans.promise_to_pays.handlers.get_promise_to_pay_plan.md): Returns a Promise to Pay Plan for a given Loan.

### Cancel Promise to Pay Plan

 - [PUT /people/{personId}/loans/{loanId}/promise-to-pay-plans/{promiseToPayPlanId}/cancel](https://docs.peachfinance.com/api-docs/api-public/promise-to-pay-plans/peach.loans.promise_to_pays.handlers.cancel_promise_to_pay_plan.md): Cancels a Promise to Pay Plan.

### Evaluate Promise to Pay Plan

 - [PUT /people/{personId}/loans/{loanId}/promise-to-pay-plans/{promiseToPayPlanId}/evaluate](https://docs.peachfinance.com/api-docs/api-public/promise-to-pay-plans/peach.loans.promise_to_pays.handlers.evaluate_promise_to_pay_plan.md): Evaluates a Promise to Pay Plan and updates the status and isOverdue of the Promise to Pay Plan.

### Get Promise to Pay Plans for a company

 - [GET /promise-to-pay-plans](https://docs.peachfinance.com/api-docs/api-public/promise-to-pay-plans/peach.loans.promise_to_pays.handlers.get_promise_to_pay_plans_by_company.md): Returns Promise to Pay Plans for a given company.

## Fees

This object contains information about the fees that are charged to the loan, including draw, origination or
dynamic fees, such as late fees.


### Get fee types

 - [GET /loan-types/{loanTypeId}/fee-types](https://docs.peachfinance.com/api-docs/api-public/fees/peach.people.loans.fees.handlers.fee_types_get.md)

### Cancel dynamic fees

 - [POST /people/{personId}/loans/{loanId}/cancel-fees](https://docs.peachfinance.com/api-docs/api-public/fees/peach.people.loans.fees.handlers.fees_cancel.md)

### Update draw fee

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}/fees/draw](https://docs.peachfinance.com/api-docs/api-public/fees/peach.people.loans.handlers.update_draw_fee.md): This endpoint allows lenders to change the draw fee amount. The system will update the draw fee amount and replay the loan from the draw activation date.

### Get fees

 - [GET /people/{personId}/loans/{loanId}/fees](https://docs.peachfinance.com/api-docs/api-public/fees/peach.people.loans.fees.handlers.fees_get.md)

### Charge dynamic fee

 - [POST /people/{personId}/loans/{loanId}/fees](https://docs.peachfinance.com/api-docs/api-public/fees/peach.people.loans.fees.handlers.fees_post.md)

### Update origination fee

 - [PUT /people/{personId}/loans/{loanId}/fees/origination](https://docs.peachfinance.com/api-docs/api-public/fees/peach.people.loans.handlers.update_origination_fee.md): This endpoint allows lenders to change the origination fee amount. The system will update the origination fee amount and replay the loan from the activation date.

### Update dynamic fee

 - [PUT /people/{personId}/loans/{loanId}/fees/{loanFeeId}](https://docs.peachfinance.com/api-docs/api-public/fees/peach.people.loans.fees.handlers.dynamic_fee_update.md)

### Cancel dynamic fee

 - [POST /people/{personId}/loans/{loanId}/fees/{loanFeeId}/cancel](https://docs.peachfinance.com/api-docs/api-public/fees/peach.people.loans.fees.handlers.fees_cancel_one.md)

## Rates

This object represents the interest and promo rates of the loan. You can modify interest and promo rates at any time.
If a rate is modified or added with an effective date in the past, we will recalculate loan balances retroactively and
future expected payments from the effective date. If a rate is modified or added with effective date in the future, we
will recalculate future expected payments only.


### Get draw effective rates

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/effective-rates](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.draw_effective_rates_get.md): This endpoint returns rates details of a draw for a given date(s).
Interest rates:
If two or more interest rates are active on the same date (aka overlap), the Peach system selects the lowest rate (also called effective rate) to accrue interest.
Promo rates:
If two or more promo rates are active on the same date (aka overlap), the Peach system sums up the rates as "effective" promo rate.

### Get draw rates

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/rates](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.draw_rates_get.md)

### Add draw rate

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/rates](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.draw_rates_add.md): This endpoint is used for adding rates. A draw can have multiple rates. If two or more interestRate overlap on the same date
we use the lowest value. If two or more promoRate overlap on the same date, we take the sum of the promo rates for the given
day, and cap this rate at the maximum interest rate for the given day (to avoid accruing negative interest).

The added interestRate will default to the existing interest type set on the loan at the time of
origination (see atOrigination.interestRate.interestType attribute).
The added interestRate must be within the bounds of any corresponding minimum and maximum rate range
configuration that is found on the loan type (if any).

### Remove draw rate

 - [DELETE /people/{personId}/loans/{loanId}/draws/{drawId}/rates/{rateId}](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.draw_rates_delete.md): This endpoint is used for removing a single interest or promo rate. The deletion of an
interest rate cannot lead to a gap in the loan where there is no reference rate.

Rates where setAtActivation is true can only be deleted with a special force permission.

### Update draw rate

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}/rates/{rateId}](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.draw_rates_update.md): This endpoint is used for updating a single interest or promo rate (don't pass both in the same call). The updating of an
interest rate cannot lead to a gap in the loan where there is no reference interest rate.

### Get loan effective rates

 - [GET /people/{personId}/loans/{loanId}/effective-rates](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.loan_effective_rates_get.md): This endpoint returns rates details of a loan for given date(s).

## Interest rates:
- If two or more interest rates are active on the same date (aka overlap), the Peach system selects the lowest rate (also called "effective rate") to accrue interest.
Promo rates:
- If two or more promo rates are active on the same date (aka overlap), the Peach system sums up the rates as "effective" promo rate.

### Get loan rates

 - [GET /people/{personId}/loans/{loanId}/rates](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.loan_rates_get.md)

### Add loan rate

 - [POST /people/{personId}/loans/{loanId}/rates](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.loan_rates_add.md): This endpoint is used for adding rates. A loan can have multiple rates. If two or more interestRate
overlap on the same date we use the lowest value. If two or more promoRate overlap on the same date, we
take the sum of the promo rates for the given day, and cap this rate at the maximum interest rate for the
given day (to avoid accruing negative interest).

The added interestRate will default to the existing interest type set on the loan at the time of
origination (see atOrigination.interestRate.interestType attribute).
The added interestRate must be within the bounds of any corresponding minimum and maximum rate range
configuration that is found on the loan type (if any).

### Remove loan rate

 - [DELETE /people/{personId}/loans/{loanId}/rates/{rateId}](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.loan_rates_delete.md): This endpoint is used for removing a single interest or promo rate. The deletion of an
interest rate cannot lead to a gap in the loan where there is no reference rate.

Rates where setAtActivation is true can only be deleted with a special force permission.

### Update loan rate

 - [PUT /people/{personId}/loans/{loanId}/rates/{rateId}](https://docs.peachfinance.com/api-docs/api-public/rates/peach.people.loans.handlers.loan_rates_update.md): This endpoint is used for updating a single interest or promo rate. (don't pass both in the same call). The updating of an
interest rate cannot lead to a gap in the loan where there is no reference interest rate.

## Rate Caps

Rate caps are rate limits applied to loans and draws to ensure compliance with various regulations.

They prevent calculated interest rates (spread + index) from exceeding specified maximums. Rate caps can be applied
to loans and line of credit draws. When multiple rate caps overlap on the same
dates, the system automatically uses the lowest value to ensure compliance.


### Get draw rate caps

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/rate-caps](https://docs.peachfinance.com/api-docs/api-public/rate-caps/peach.loans.rate_caps.handlers.draw_rate_caps_get.md)

### Add draw rate cap

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/rate-caps](https://docs.peachfinance.com/api-docs/api-public/rate-caps/peach.loans.rate_caps.handlers.draw_rate_cap_add.md): 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)

### Delete draw rate cap

 - [DELETE /people/{personId}/loans/{loanId}/draws/{drawId}/rate-caps/{rateCapId}](https://docs.peachfinance.com/api-docs/api-public/rate-caps/peach.loans.rate_caps.handlers.draw_rate_cap_delete.md): This endpoint is used for removing a single rate cap on a draw. 

If a draw rate was capped at the maxRate and removing this rate 
cap updates the effective interest rate, then we will replay the loan. If 
a loan rate is not affected by the removal of this maxRate, 
then we will not replay the loan.

### Update draw rate cap

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}/rate-caps/{rateCapId}](https://docs.peachfinance.com/api-docs/api-public/rate-caps/peach.loans.rate_caps.handlers.draw_rate_cap_update.md): This endpoint is used for updating a single rate cap on a draw.

If a rate cap is updated on a draw for past periods and the draw 
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 draw rate is not affected 
by the maxRate update, then we will not replay the loan.

### Get loan rate caps

 - [GET /people/{personId}/loans/{loanId}/rate-caps](https://docs.peachfinance.com/api-docs/api-public/rate-caps/peach.loans.rate_caps.handlers.loan_rate_caps_get.md)

### Add loan rate cap

 - [POST /people/{personId}/loans/{loanId}/rate-caps](https://docs.peachfinance.com/api-docs/api-public/rate-caps/peach.loans.rate_caps.handlers.loan_rate_cap_add.md): This endpoint is used for adding rate caps to a loan. 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 loan 
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)

### Delete loan rate cap

 - [DELETE /people/{personId}/loans/{loanId}/rate-caps/{rateCapId}](https://docs.peachfinance.com/api-docs/api-public/rate-caps/peach.loans.rate_caps.handlers.loan_rate_cap_delete.md): This endpoint is used for removing a single rate cap on a loan. 

If a loan rate was capped at the maxRate and removing this rate 
cap updates the effective interest rate, then we will replay the loan. If 
a loan rate is not affected by the removal of this maxRate, 
then we will not replay the loan.

### Update loan rate cap

 - [PUT /people/{personId}/loans/{loanId}/rate-caps/{rateCapId}](https://docs.peachfinance.com/api-docs/api-public/rate-caps/peach.loans.rate_caps.handlers.loan_rate_cap_update.md): This endpoint is used for updating a single rate cap on a loan.

If a rate cap is updated on a loan for past periods and the 
loan 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 loan 
rate is not affected by the maxRate update, then we will not replay the loan.

## Transactions

This object represents payments and credits. Payments represent real money that were paid back by borrowers. Credits
are adjustments made on a loan. Credits lower balances similar to payments. Credits can be issued by customer service
representatives or supervisors.


### Get transactions

 - [GET /people/{personId}/loans/{loanId}/transactions](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.handlers.loan_transactions_get_all.md)

### Create transaction

 - [POST /people/{personId}/loans/{loanId}/transactions](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.handlers.transactions_create.md): Create a transaction. Permissions required depend on the object type passed:

| type             | permission                            |
|------------------|---------------------------------------|
| One Time Payment | transaction:create.onetimepayment   |
| Service Credit   | transaction:create.servicecredit    |
| Down Payment     | transaction:create.downpayment      |

Once a loan has been onboarded to Peach's platform, valid loan statuses for each transaction type are as follows:

| type             | valid loan statuses                       |
|------------------|-------------------------------------------|
| One Time Payment | active, accelerated, or chargedOff* |
| Service Credit   | active, accelerated, or chargedOff* |
| Down Payment     | active                                  |

*=chargedOff is only valid when the loan type configuration paymentAllowedWhenChargedOff is true.

During migration while a loan is in prepMigration, valid loan statuses for each transaction type are as follows:

| type             | valid loan statuses                      |
|------------------|------------------------------------------|
| One Time Payment | originated                             |
| Service Credit   | originated                             |
| Down Payment     | active                                 |

### Fail multiple transactions

 - [POST /people/{personId}/loans/{loanId}/transactions/fail](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.handlers.transactions_fail_multiple.md): This endpoint allows you to fail multiple transactions in one call. The system will mark applicable transactions as 
failed and replay the loan once (starting from the earliest effective date of the provided transactions).

### Get transaction by ID

 - [GET /people/{personId}/loans/{loanId}/transactions/{transactionId}](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.handlers.transactions_get_by_id.md)

### Update transaction

 - [PUT /people/{personId}/loans/{loanId}/transactions/{transactionId}](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.handlers.transactions_update.md)

### Backdate transaction

 - [POST /people/{personId}/loans/{loanId}/transactions/{transactionId}/backdate](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.handlers.transaction_backdate.md): Backdate a transaction. Can only be applied to transactions with status=succeeded or status=pending. Can be applied to payments or service credits.

### Cancel transaction

 - [POST /people/{personId}/loans/{loanId}/transactions/{transactionId}/cancel](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.handlers.transaction_cancel.md)

### Get transaction chargebacks

 - [GET /people/{personId}/loans/{loanId}/transactions/{transactionId}/chargebacks](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.chargebacks.handlers.get_chargebacks.md)

### Create transaction chargeback

 - [POST /people/{personId}/loans/{loanId}/transactions/{transactionId}/chargebacks](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.chargebacks.handlers.transaction_chargeback.md): In some cases a borrower might chargeback/dispute a payment that they made in the past. Only transactions in succeeded status can be charged back.

If the payment/transaction isExternal=true, the caller can post chargeback in two ways:
 1. Update status of the transaction to inDispute or chargeback directly. The chargeback amount defaults to the full amount of the transaction.
    The system will create a chargeback object automatically. This option is the easiest way to tell the system about a chargeback.
 1. Create chargeback(s) via Create transaction chargeback endpoint. This option allows the caller to provide more details about the chargeback.
    This option should be used for multiple partial chargebacks. Keep in mind that a transaction can have multiple chargebacks and reversals.

It's important to not mix the options above because it can create edge cases and confusion.

If the payment/transaction is isExternal=false, the caller cannot change the transaction status to inDispute or chargeback nor create chargeback(s)
via Create transaction chargeback endpoint. Chargebacks will be received directly from the payment processor.

### Get chargeback by ID

 - [GET /people/{personId}/loans/{loanId}/transactions/{transactionId}/chargebacks/{chargebackId}](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.chargebacks.handlers.get_chargeback_by_id.md)

### Update chargeback

 - [PUT /people/{personId}/loans/{loanId}/transactions/{transactionId}/chargebacks/{chargebackId}](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.chargebacks.handlers.update_chargeback.md)

### Reverse transaction

 - [POST /people/{personId}/loans/{loanId}/transactions/{transactionId}/reverse](https://docs.peachfinance.com/api-docs/api-public/transactions/peach.transactions.handlers.transaction_reverse.md)

## Statements

This object represents line of credit (e.g. credit card) or loan (e.g. personal installment) statement. Each statement is
associated with one due date.

For lines of credit, statements are created one calendar day after the period end date. The number of dates between a
statement creation and a due date can be configured by lenders, but are normally 14 or 21 days.

For installments, there are two options for when statements can be created:
1. One calendar day after the period end date, which is also the due date. In this case, the statement date and due date are the same.
2. A number of calendar days before the period end date. The offset (as number of calendar days) can be configured by lenders.
   In this case, a statement is created and sent before the period ends, which means some of the statement details are calculated
   based on partial period data (e.g. amount of interest accrued in the period.)


### Generate statement

 - [POST /people/{personId}/loans/{loanId}/periods/{periodId}/generate-statement](https://docs.peachfinance.com/api-docs/api-public/statements/peach.statements.handlers.generate_statement.md): Generates a statement, and if one already exists, replaces the older one as the active one.
If sync=true is passed, the server will try to wait up to 20 seconds for the statement
creation to finish. If it finishes in time, it will return the statement object.
Otherwise, it will return nothing.

### Get statements

 - [GET /people/{personId}/loans/{loanId}/statements](https://docs.peachfinance.com/api-docs/api-public/statements/peach.statements.handlers.get_statements.md)

### Update statement

 - [PUT /people/{personId}/loans/{loanId}/statements/{statementId}](https://docs.peachfinance.com/api-docs/api-public/statements/peach.statements.handlers.update_statement.md)

### Get statement details

 - [GET /people/{personId}/loans/{loanId}/statements/{statementId}/details](https://docs.peachfinance.com/api-docs/api-public/statements/peach.statements.handlers.get_statement_details.md)

## Autopay

This object represents the current Autopay plan. The current Autopay plan must be canceled before creating a new plan. The autopay
cadence can be aligned to due dates or can be on a different payment schedule.


### Cancel Autopay plan

 - [DELETE /people/{personId}/loans/{loanId}/autopay](https://docs.peachfinance.com/api-docs/api-public/autopay/peach.people.loans.autopay.handlers.loan_autopay_delete.md)

### Get Autopay plan

 - [GET /people/{personId}/loans/{loanId}/autopay](https://docs.peachfinance.com/api-docs/api-public/autopay/peach.people.loans.autopay.handlers.loan_autopay_get.md)

### Create Autopay plan

 - [POST /people/{personId}/loans/{loanId}/autopay](https://docs.peachfinance.com/api-docs/api-public/autopay/peach.people.loans.autopay.handlers.loan_autopay_post.md)

### Update Autopay plan

 - [PUT /people/{personId}/loans/{loanId}/autopay](https://docs.peachfinance.com/api-docs/api-public/autopay/peach.people.loans.autopay.handlers.loan_autopay_put.md)

## Balances

This object represents current loan balances.


### Get loan balances

 - [GET /people/{personId}/loans/{loanId}/balances](https://docs.peachfinance.com/api-docs/api-public/balances/peach.people.loans.balances.handlers.loan_balances_get.md)

### Get draw balances

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/balances](https://docs.peachfinance.com/api-docs/api-public/balances/peach.people.loans.balances.handlers.draw_balances_get.md)

### Get draw future balances

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/future-balances](https://docs.peachfinance.com/api-docs/api-public/balances/peach.people.loans.balances.handlers.draw_future_balances_get.md)

### Get loan future balances

 - [GET /people/{personId}/loans/{loanId}/future-balances](https://docs.peachfinance.com/api-docs/api-public/balances/peach.people.loans.balances.handlers.loan_future_balances_get.md)

### Get loan interest

 - [GET /people/{personId}/loans/{loanId}/interest](https://docs.peachfinance.com/api-docs/api-public/balances/peach.people.loans.handlers.loan_interest_get.md)

## Credit Reporting

This object represents loan credit reporting data as it was reported to credit bureaus.


### Get credit reporting statuses

 - [GET /people/{personId}/loans/{loanId}/credit-reporting](https://docs.peachfinance.com/api-docs/api-public/credit-reporting/peach.credit_reporting.handlers.credit_reporting_statuses_list.md)

### Start credit reporting

 - [POST /people/{personId}/loans/{loanId}/credit-reporting](https://docs.peachfinance.com/api-docs/api-public/credit-reporting/peach.credit_reporting.handlers.credit_reporting_status_create.md): Sets the starting date to begin reporting credit history for the loan.

### Update reporting fields

 - [PUT /people/{personId}/loans/{loanId}/credit-reporting](https://docs.peachfinance.com/api-docs/api-public/credit-reporting/peach.credit_reporting.handlers.credit_reporting_fields_update.md): Sets loan-level credit reporting fields

### Delete from credit reporting

 - [POST /people/{personId}/loans/{loanId}/credit-reporting/{creditAgencyId}/delete](https://docs.peachfinance.com/api-docs/api-public/credit-reporting/peach.credit_reporting.handlers.credit_reporting_status_delete.md)

## Loan Investors

Investors associated with a loan.


### Get loan investors

 - [GET /people/{personId}/loans/{loanId}/investors](https://docs.peachfinance.com/api-docs/api-public/loansinvestors/peach.people.loans.handlers.loan_investors_get_all.md)

### Update loan investors

 - [PUT /people/{personId}/loans/{loanId}/investors](https://docs.peachfinance.com/api-docs/api-public/loansinvestors/peach.people.loans.handlers.loan_investors_update.md)

## Loan Collection Agencies

Allows a loan to be assigned to a collection agency


### Unassign loan collection agency

 - [DELETE /people/{personId}/loans/{loanId}/collection-agency](https://docs.peachfinance.com/api-docs/api-public/loan-collection-agencies/peach.collections.handlers.collection_agency_loan_details_unassign.md): This endpoint is used to "unassign" a loan from a collection agency. To keep the servicedBy value on the loan to debtCollectionAgency,
just pass that value to this endpoint and the servicedBy will remain the same, while still clearing the collection agency assignment fields for the loan.

### Get loan collection agency

 - [GET /people/{personId}/loans/{loanId}/collection-agency](https://docs.peachfinance.com/api-docs/api-public/loan-collection-agencies/peach.collections.handlers.collection_agency_loan_details_get.md)

### Update loan collection agency

 - [POST /people/{personId}/loans/{loanId}/collection-agency](https://docs.peachfinance.com/api-docs/api-public/loan-collection-agencies/peach.collections.handlers.collection_agency_loan_details_update.md): This end point allows lenders to assign a loan to a debt collection agency.
When a loan is assigned to a debt collection agency, the system will set servicedBy=debtCollectionAgency.
Once the loan is assigned, Peach system can only accept "external" transactions to update the loan balance (isExternal=true).

## Promo Programs

### Create promo program for draw

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/promo-programs](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_draw_add.md)

### Cancel promo program for draw

 - [DELETE /people/{personId}/loans/{loanId}/draws/{drawId}/promo-programs/{promoProgramId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_draw_delete.md)

### Get promo program for draw by ID

 - [GET /people/{personId}/loans/{loanId}/draws/{drawId}/promo-programs/{promoProgramId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_draw_get.md)

### Update promo program for draw

 - [PUT /people/{personId}/loans/{loanId}/draws/{drawId}/promo-programs/{promoProgramId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_draw_update.md): There a few restrictions on what can be updated.
promoTypeId cannot be updated.
If status=pending - any attribute except for status can be
updated.
To activate use the Activate promo program endpoint.
If status=active - promoType, status, promoDurationDays
and promoStartDate cannot be updated.
If status=canceled -  promoType, promoDurationDays and
promoStartDate cannot be updated.
If status=exercised - no attributes can be updated.

### Activate promo program for draw

 - [POST /people/{personId}/loans/{loanId}/draws/{drawId}/promo-programs/{promoProgramId}/activate](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_draw_activate.md)

### Get promo programs

 - [GET /people/{personId}/loans/{loanId}/promo-programs](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_get_all.md)

### Create promo program

 - [POST /people/{personId}/loans/{loanId}/promo-programs](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_add.md)

### Cancel promo program

 - [DELETE /people/{personId}/loans/{loanId}/promo-programs/{promoProgramId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_delete.md)

### Get promo program by ID

 - [GET /people/{personId}/loans/{loanId}/promo-programs/{promoProgramId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_get.md)

### Update promo program

 - [PUT /people/{personId}/loans/{loanId}/promo-programs/{promoProgramId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_update.md): There a few restrictions on what can be updated.
promoTypeId cannot be updated.
If status=pending - any attribute except for status can be
updated.
To activate use the Activate promo program endpoint.
If status=active - promoType, status, promoDurationDays
and promoStartDate cannot be updated.
If status=canceled -  promoType, promoDurationDays and
promoStartDate cannot be updated.
If status=exercised - no attributes can be updated.

### Activate promo program

 - [POST /people/{personId}/loans/{loanId}/promo-programs/{promoProgramId}/activate](https://docs.peachfinance.com/api-docs/api-public/promo-programs/peach.promo_programs.handlers.promo_program.promo_programs_activate.md)

## Cards

**BETA**

Allows lenders to associate physical or virtual card with a loan or line of credit.


### Get cards

 - [GET /people/{personId}/loans/{loanId}/cards](https://docs.peachfinance.com/api-docs/api-public/cards/peach.card_issuers.handlers.cards_list.md)

### Create card

 - [POST /people/{personId}/loans/{loanId}/cards](https://docs.peachfinance.com/api-docs/api-public/cards/peach.card_issuers.handlers.card_create.md): The card details.

You can pass either issuerId + corresponding accountIdentifier for the card (e.g. accountIdentifiers.galileoCad) attributes or the cardDetails object.

If issuerId + card accountIdentifier attributes are passed and issuerEventsSubscriber is set to peach, Peach will sync the card status, transactions and balances with the loan ledger seamlessly. Note: these attributes must be passed if issuerEventsSubscriber is set to peach, because Peach will need the identifying information to tie the issuer's events to the proper card.

If cardDetails is passed, the card details will be stored in the Peach system as read-only. The lender is responsible for updating the loan details based on the card usage. Note: if cardDetails is passed without issuerId and accountIdentifier, issuerEventsSubscriber cannot be set to peach.

The card issuerId and accountIdentifier attributes can be updated only if the loan status is originated or pending. After the loan is activated, the issuerId and accountIdentifier information cannot be changed.

### Get card

 - [GET /people/{personId}/loans/{loanId}/cards/{cardId}](https://docs.peachfinance.com/api-docs/api-public/cards/peach.card_issuers.handlers.card_get.md)

### Update card

 - [PUT /people/{personId}/loans/{loanId}/cards/{cardId}](https://docs.peachfinance.com/api-docs/api-public/cards/peach.card_issuers.handlers.card_update.md): The card details.

You can pass either issuerId + corresponding accountIdentifier for the card (e.g. accountIdentifiers.galileoCad) attributes or the cardDetails object.

If issuerId + card accountIdentifier attributes are passed and issuerEventsSubscriber is set to peach, Peach will sync the card status, transactions and balances with the loan ledger seamlessly. Note: these attributes must be passed if issuerEventsSubscriber is set to peach, because Peach will need the identifying information to tie the issuer's events to the proper card.

If cardDetails is passed, the card details will be stored in the Peach system as read-only. The lender is responsible for updating the loan details based on the card usage. Note: if cardDetails is passed without issuerId and accountIdentifier, issuerEventsSubscriber cannot be set to peach.

The card issuerId and accountIdentifier attributes can be updated only if the loan status is originated or pending. After the loan is activated, the issuerId and accountIdentifier information cannot be changed.

## Loan Labels

### Get loan labels

 - [GET /companies/{companyId}/loan-labels](https://docs.peachfinance.com/api-docs/api-public/loan-labels/peach.loans.labels.handlers.loan_labels_list.md)

### Create loan label

 - [POST /companies/{companyId}/loan-labels](https://docs.peachfinance.com/api-docs/api-public/loan-labels/peach.loans.labels.handlers.loan_label_create.md): Creates a new loan label.

### Get loans by loan labels

 - [GET /companies/{companyId}/loan-labels/{loanLabelIds}/loans](https://docs.peachfinance.com/api-docs/api-public/loan-labels/peach.loans.labels.handlers.loan_labels_get_loans.md)

### Add labels to loans

 - [PUT /companies/{companyId}/loan-labels/{loanLabelIds}/loans](https://docs.peachfinance.com/api-docs/api-public/loan-labels/peach.loans.labels.handlers.loan_labels_add_loans.md): Adds loans to the specified labels.

### Remove labels from loans

 - [PUT /companies/{companyId}/loan-labels/{loanLabelIds}/loans/remove](https://docs.peachfinance.com/api-docs/api-public/loan-labels/peach.loans.labels.handlers.loan_labels_remove_loans.md): Remove loans from the specified labels.

### Delete loan label

 - [DELETE /companies/{companyId}/loan-labels/{loanLabelId}](https://docs.peachfinance.com/api-docs/api-public/loan-labels/peach.loans.labels.handlers.loan_label_delete.md)

### Get loan label by ID

 - [GET /companies/{companyId}/loan-labels/{loanLabelId}](https://docs.peachfinance.com/api-docs/api-public/loan-labels/peach.loans.labels.handlers.loan_label_get.md)

### Update loan label

 - [PUT /companies/{companyId}/loan-labels/{loanLabelId}](https://docs.peachfinance.com/api-docs/api-public/loan-labels/peach.loans.labels.handlers.loan_label_update.md): Updates a loan label.

## Communicator

Send and receive communications like email and text messages with borrowers and their contacts. When
sending and receiving communications an interaction is usually created.


### Render template preview for subject

 - [POST /communicator/preview](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.preview.md): Render the template and return as a JSON response.

It selects an appropriate Template Descriptor (matching subject, channel), and
renders the active Template Version with the given context. 

The three contents are returned in a single JSON response, they are contentHtml,
contentText and subjectLine.

NOTE: This is different from the /render endpoints because it does not
return a file but rather the simple text-respresentation of the rendered
templates that would be used in rendering a file. It is generally easier
to test and debug the rendered templates as JSON strings rather than, for
instance a PDF file.

### Preview free-form email

 - [POST /communicator/preview-free-form-email](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.preview_free_form_email.md): Render a template for "free-form" emails and return is as JSON.

A free-form message is one that can contain any content.

Templates previewed via this endpoint will be free-form but still be branded.
i.e., they will use the freeFormBranded interaction subject, not freeForm.

This returns the three contents of a template in a single JSON response, 
they are contentHtml, contentText and subjectLine.

### Receive message

 - [POST /communicator/receive](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.handle_receive.md): Receive a message.

This is different from a normal /interactions creation because
it creates the interaction and also performs associated "inbound message"
actions:

- if the message is an email sent to an email address configured as
  "unmonitored", it will autorespond that the email was not received because
  it was sent to an "unmonitored address".
- it will publish a taskrouter task for inbound interactions (either
  handleInboundInteraction or handleUnboundInboundInteraction).

### Render to download

 - [POST /communicator/render](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.render.md): Render a file (text, html or pdf) from template and download it.

It selects an appropriate Template Descriptor (matching subject, channel), and
renders the active Template Version with the given context. Only
the content matching the fmt query parameter is returned in the file.

The rendered template file is then downloaded as an attachment. (i.e., a
response is sent with the header Content-Disposition: attachment.)

Note: that a Document Descriptor is NOT created.

### Render to document

 - [POST /communicator/render-to-document](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.render_to_document.md): Render a file (text, html or pdf) from template and write it to a document descriptor.

It selects an appropriate Template Descriptor (matching subject, channel), and
renders the active Template Version with the given context. Only
the content matching the fmt query parameter is returned in the file.

The rendered template file is then associated with the given documentId. (i.e., this
new content can be downloaded via that Document Descriptor.)

WARNING: if there is existing document content for that document it will be
overwritten.

### Resend existing interaction

 - [POST /communicator/resend](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.resend.md): Copy the fields from an existing interaction into a new interaction
and queue that new interaction for sending. 

WARNING: This message is not checked against Compliance Guard.

### Send message

 - [POST /communicator/send](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.handle_send.md): Send a message and save it as a new interaction.

The message is checked against Compliance Guard and may be rejected
if it violates any rules. 

If the message is accepted, it is queued for send. 
You can check the status of the queued interaction by calling 
GET on /interactions/{interactionId} endpoint with the interaction ID
returned by this endpoint.

## Context Variables
### Hydratable Context Variables
Certain context variables can be "hydrated" by this endpoint for use in the template
being rendered for sending. 

For instance, if you provide a loanId in the request
body it is "hydrated" to a loan object and passed to the context. This means you
can then reference things like {{loan.displayId}} when customizing the template.

- companyId hydrates to company
- loanId hydrates to loan
- loanIds hydrates to loans
- caseId hydrates to case

### No Automatic Context Variables
Note that this endpoint does not automatically fill in context variables.

If the template you're sending requires context variables, you must provide them. This
can sometimes be confusing because Peach will automatically calculate and include 
context variables when the system sends a message automatically. See
System Sent Messages for more information.

## Difference from /interactions endpoint
Note this is different from POSTing to a /interactions endpoint because those
endpoints create the interaction object, but do NOT send an actual message. 
(You can think of that endpoint as creating a historical log of an interaction
which happened elsewhere.)

### Send confirmation code for contact verification

 - [POST /communicator/send-confirmation-code](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.confirmation_codes.handlers.send_confirmation_code.md): Send a verification code to an email or phone number.

This creates a confirmation code in the system which can be used
via the .../contacts endpoint to verify the contact. (i.e., this 
sets the verified attribute of the contact to true.)

This endpoint is rate limited to 10 requests per borrower
per hour.

An interaction is created with InteractionSubject confirmationCode.

NOTE: This endpoint is not checked against Compliance Guard, however
it should never be necessary to restrict sending confirmation codes
due to compliance guard rules.

### Send free-form email

 - [POST /communicator/send-free-form-email](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.send_free_form_email.md): Sends an email with the freeFormBranded template. 

This selects the Template Descriptor with subject=freeFormBranded and
its currently active Template Version. The freeFormBranded` template allows 
for the insertion of completely custom content within a standard branded email
template.

WARNING: This endpoint is not checked against Compliance Guard.

### List subject desciptors

 - [GET /communicator/subjects](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.subject_descriptors_list.md): List all the currently available Interaction Subject descriptors.

An interaction subject is the category or topic to which an interaction pertains.
(Note this is different from the subject line of an email message.)

For example, an email or a text message will necessarily contain different
content due to their nature, but they still might pertain to
the subject of paymentReminder. Similarly, a phone call despite not being
text based at all might also pertain to the subject of paymentReminder.

### Get subject descriptor

 - [GET /communicator/subjects/{subject}](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.subject_descriptor_get_by_subject.md): Get the descriptor for a specific Interaction Subject.

Note that subject descriptors do not have an id field but are
instead identified by their unique subject field.

### Update subject descriptor

 - [PUT /communicator/subjects/{subject}](https://docs.peachfinance.com/api-docs/api-public/communicator/peach.communicator.handlers.subject_descriptor_update.md): Update the descriptor for a specific Interaction Subject.

Note that subject descriptors do not have an id field but are
instead identified by their unique subject field.

## Templates

The templates system is used manage templates and render content from existing templates. Templates can be used, for
instance, when sending emails and text messages. Custom branding and dynamic fields can be added into
templates.

## Management
The templates system consists of two main components: Template Descriptors and Template Versions (also sometimes
simply referred to as "templates"). A Template Descriptor is a configuration object that defines the structure
of a template. A Template Version is a specific instance of a template that contains the actual content.

A Template Descriptor many have many Template Versions associated with it. There can be only one "active"
Template Version at a time.

## Content
### Syntax
Peach uses <a href="https://jinja.palletsprojects.com/">Jinja templating</a>. Therefore all templates
use Jinja template syntax, and _must be a valid Jinja template to render_.

### Rendering Context
When a template is rendered, context variables are passed into the template. If a template looks like:

```
Hello {{foo}}, your loan is due on {{bar}}.
````

then the context variables in the template are `foo` and `bar`. If, when the template is
rendered, the provided context is:

```
{
  "foo": "John",
  "bar": "2021-01-01"
}
```

...then the rendered template will be:

```
Hello John, your loan is due on 2021-01-01.
```


### List template descriptors

 - [GET /communicator/templatedescriptors](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.list_template_descriptors.md)

### Create template descriptor

 - [POST /communicator/templatedescriptors](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.create_template_descriptor.md)

### Delete template descriptor

 - [DELETE /communicator/templatedescriptors/{descriptorId}](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.delete_template_descriptor.md)

### Get template descriptor

 - [GET /communicator/templatedescriptors/{descriptorId}](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.get_template_descriptor.md)

### Update template descriptor

 - [PUT /communicator/templatedescriptors/{descriptorId}](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.update_template_descriptor.md)

### List template versions for descriptor

 - [GET /communicator/templatedescriptors/{descriptorId}/templates](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.list_template_versions_by_descriptor.md): List all template versions for the given template descriptor.

### List all template versions (Deprecated)

 - [GET /communicator/templates](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.list_template_versions.md): List all template versions. 

Deprecated in favor of /v2/communicator/templates.

This dumps all template versions (regardless of active status) without paging.

### Create template version

 - [POST /communicator/templates](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.create_template_version.md): Create a new template versions.

The new version will not be active until it is activated with 
the activate endpoint.

### Export all template descriptors and versions

 - [GET /communicator/templates/export](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.export_templates.md): Export all template descriptors and template versions for a company. 
The export is in JSON format. It can be used with the import endpoint to
restore templates.

### Import exported template descriptors and versions

 - [POST /communicator/templates/import](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.import_templates.md): Import exported template descriptors and template versions for a company. The exported
data should come from the /communicator/templates/export endpoint.

The import will create new template descriptor if a matching one does not exist
and will create new template versions if a matching one does not exist. This is often
used to "promote" templates from a testing environment to a production environment.

### Delete template version

 - [DELETE /communicator/templates/{templateVersionId}](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.delete_template_version.md)

### Get template version

 - [GET /communicator/templates/{templateVersionId}](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.get_template_version.md)

### Update template version

 - [PUT /communicator/templates/{templateVersionId}](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.update_template_version.md)

### Activate template version

 - [PUT /communicator/templates/{templateVersionId}/activate](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.activate_template_version.md): Set's the given template version as active.

A template descriptor can have exactly one "active" version. The active template
version is what's used to generate the content of the messages.

### Render template version preview

 - [POST /communicator/templates/{templateVersionId}/preview](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.preview_template_version.md): Render the template contents of the given Template Version 
using the given context.

The three contents are returned in a single JSON response, they are contentHtml,
contentText and subjectLine.

### Render template version

 - [POST /communicator/templates/{templateVersionId}/render](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.render_template_version.md): Render a file (text, html or pdf) from this Template Version and download it.

Only the content matching the fmt query parameter is returned in the file.

The rendered template file is then downloaded as an attachment. (i.e., a
response is sent with the header Content-Disposition: attachment.)

Note: that a Document Descriptor is NOT created.

### List context vars for template version

 - [GET /communicator/templates/{templateVersionId}/vars](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.get_template_vars.md): List all context variables used in the given template version.

If a template looks like:
  

Hello {{name}},

Your loan {{loanName}} is due on {{dueDate}}.

Thanks,
{{companyName}}

{{SOME_MACRO()}}


The context variables are name, loanName, dueDate and companyName as
well as whatever context variables are defined in SOME_MACRO() (but 
SOME_MACRO itself is NOT a context variable). Note that this means
sometimes a Template Version may contain many context variables since all possible
context variables are included in this list.

### List all template versions (v2)

 - [GET /v2/communicator/templates](https://docs.peachfinance.com/api-docs/api-public/templates/peach.communicator.handlers.list_template_versions_modern.md): List all Templates Versions for all Template Descriptors.

## Interactions

Interactions represent communications with a borrower.

Whenever Peach communicates with a borrower an interaction is recorded.

Additionally, communications taking place outside of Peach  should be recorded
as interactions.

Past interactions information is used by Compliance Guard to make decisions
about when and how it is appropriate to communicate again with a borrower.


### Get interaction call summaries

 - [GET /companies/{companyId}/interactions/{interactionId}/call-transcripts/summaries](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.ai.call_transcription.handlers.internal_unbound_interaction_call_summary_results_get_by_interaction.md)

### Get previous interactions

 - [GET /companies/{companyId}/interactions/{interactionId}/previous](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.internal_unbound_get_many_previous_interactions.md): For this interaction, get all the previous interactions linked to it
via the previousInteractionId field.

### Get interactions

 - [GET /interactions](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.unbound_interaction_get_all.md)

### Get interaction by ID

 - [GET /interactions/{interactionId}](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.unbound_interaction_get_by_id.md)

### Get interaction call summaries

 - [GET /interactions/{interactionId}/call-transcripts/summaries](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.ai.call_transcription.handlers.unbound_interaction_call_summary_results_get_by_interaction.md)

### Get interaction convo

 - [GET /interactions/{interactionId}/convo](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.twilio.convo.handlers_api.interaction_convo_get.md)

### Close interaction convo

 - [POST /interactions/{interactionId}/convo/close](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.twilio.convo.handlers_api.interaction_convo_close.md)

### Join interaction convo

 - [POST /interactions/{interactionId}/convo/join](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.twilio.convo.handlers_api.interaction_convo_join.md): Add the user making the request to the conversation associated with this interaction.

Note that only users of type Agent can join conversations. (i.e., Service and Borrower
users cannot join conversations.)

### Leave interaction convo

 - [POST /interactions/{interactionId}/convo/leave](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.twilio.convo.handlers_api.interaction_convo_leave.md)

### Get previous interactions

 - [GET /interactions/{interactionId}/previous](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.unbound_get_many_previous_interactions.md): For this interaction, get all the previous interactions linked to it
via the previousInteractionId field.

### Download interaction recording

 - [GET /interactions/{interactionId}/recording-content](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.unbound_interaction_download_recording.md)

### Download interaction voicemail

 - [GET /interactions/{interactionId}/voicemail-content](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.unbound_interaction_download_voicemail.md)

### Get borrower interactions

 - [GET /people/{personId}/interactions](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.interaction_get_all.md)

### Create interaction

 - [POST /people/{personId}/interactions](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.interaction_add.md): Creating interactions tracks the history of communication between lenders/servicers and borrowers.

Note that this does NOT send a message—merely tracks that it occurred. If you need to send a message, use the
/communicator/send endpoint.

### Delete interaction

 - [DELETE /people/{personId}/interactions/{interactionId}](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.interaction_delete.md): Delete an interaction. Only external interactions (interactions created
by lenders via API) can be deleted.

### Get interaction by ID

 - [GET /people/{personId}/interactions/{interactionId}](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.interaction_get_by_id.md)

### Update interaction

 - [PUT /people/{personId}/interactions/{interactionId}](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.interaction_update.md)

### Get interaction call summaries

 - [GET /people/{personId}/interactions/{interactionId}/call-transcripts/summaries](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.ai.call_transcription.handlers.call_summary_results_get_by_interaction.md)

### Get cases associated with an interaction

 - [GET /people/{personId}/interactions/{interactionId}/cases](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.get_interaction_cases.md)

### Get previous interactions

 - [GET /people/{personId}/interactions/{interactionId}/previous](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.get_many_previous_interactions.md): For this interaction, get all the previous interactions linked to it
via the previousInteractionId field.

### Download interaction recording

 - [GET /people/{personId}/interactions/{interactionId}/recording-content](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.interaction_download_recording.md)

### Download interaction voicemail

 - [GET /people/{personId}/interactions/{interactionId}/voicemail-content](https://docs.peachfinance.com/api-docs/api-public/interactions/peach.people.interaction.handlers.interaction_download_voicemail.md)

## Compliance Guard

Compliance Guard helps ensures communications with borrowers are compliant with
regulations.


### Can interact

 - [POST /people/{personId}/can-interact](https://docs.peachfinance.com/api-docs/api-public/compliance-guard/peach.people.handlers.can_interact.md): Returns whether or not a communication is allowed with a borrower.

It uses past interactions, current borrower status, loan status,
and relevant Compliance Guard rules to make a decision if it is
permissable to communicate with a borrower.

Note this endpoint always returns a 200 status code if we could successfully
calculate a result. (i.e., even if a communication is not permitted
this is a 200 response.)

## Promo Programs Type

### Get promo program types

 - [GET /companies/{companyId}/promo-program-types](https://docs.peachfinance.com/api-docs/api-public/promo-programs-type/peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_get_all.md)

### Create promo program type

 - [POST /companies/{companyId}/promo-program-types](https://docs.peachfinance.com/api-docs/api-public/promo-programs-type/peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_add.md)

### Cancel promo program type

 - [DELETE /companies/{companyId}/promo-program-types/{promoProgramTypeId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs-type/peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_delete.md)

### Get promo program type by ID

 - [GET /companies/{companyId}/promo-program-types/{promoProgramTypeId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs-type/peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_get.md)

### Update promo program type

 - [PUT /companies/{companyId}/promo-program-types/{promoProgramTypeId}](https://docs.peachfinance.com/api-docs/api-public/promo-programs-type/peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_update.md)

## Payment Processors

Peach allows clients to bring their own/partner bank to process ACH payments.
If configured, the Peach system will create NACHA files and upload them to the provided destination (SFTP).
The Peach system will download NACHA return files from the same destination. Make sure you coordinate this setup with the Peach team.

NACHA requires bank accounts to be verified. If you are using Peach system to process ACH payments, borrowers have two options to verify their bank account:
1. Connect their online bank account via Plaid.
2. Trigger micro-deposits and verify amounts.

Please note the following logic of how Peach system selects payment processor for micro-deposits. A payment method is associated with a borrower
object instead of a specific loan because the same method can be used to pay multiple loans.
- If you have only one loan type and one payment processor with `default=true`, the system will use the `default=true` payment processor to initiate micro-deposits.
- If you have more than one loan type and one payment processor with `default=true`, the system will use the `default=true` payment processor to initiate micro-deposits.
- If you have have more than one loan type and more than one payment processor:
    - You can associate a specific payment processor with a loan type.
    - If a borrower has one or more loans in status [`pending`, `originated`, `active`, `frozen`, `accelerated`, `chargedOff`] of ONE loan type only,
      the system will use that loan type's ACH payment processor for micro-deposits. If the loan type doesn't have an ACH payment processor
      associated, the system will use the `default=true` processor to initiate micro-deposits.
    - If a borrower has one or more loans in status [`pending`, `originated`, `active`, `frozen`, `accelerated`, `chargedOff`] of more than one
      loan type, the system will use the `default=true` processor to initiate micro-deposits.


### Get payment processors

 - [GET /payment-processors](https://docs.peachfinance.com/api-docs/api-public/payment-processors/peach.payment_processors.handlers.get_payment_processors.md)

### Create payment processor

 - [POST /payment-processors](https://docs.peachfinance.com/api-docs/api-public/payment-processors/peach.payment_processors.handlers.create_payment_processor.md)

### Delete payment processor

 - [DELETE /payment-processors/{paymentProcessorId}](https://docs.peachfinance.com/api-docs/api-public/payment-processors/peach.payment_processors.handlers.delete_payment_processor.md)

### Get payment processor

 - [GET /payment-processors/{paymentProcessorId}](https://docs.peachfinance.com/api-docs/api-public/payment-processors/peach.payment_processors.handlers.get_one_payment_processor.md)

### Update payment processor

 - [PUT /payment-processors/{paymentProcessorId}](https://docs.peachfinance.com/api-docs/api-public/payment-processors/peach.payment_processors.handlers.update_payment_processor.md)

## Card Issuers

**BETA**

Allows clients to manage configurations for card issuers.


### Get card issuers

 - [GET /card-issuers](https://docs.peachfinance.com/api-docs/api-public/card-issuers/peach.card_issuers.handlers.card_issuers_list.md)

### Create card issuer

 - [POST /card-issuers](https://docs.peachfinance.com/api-docs/api-public/card-issuers/peach.card_issuers.handlers.card_issuer_create.md): Creates a new card issuer.

### Delete card issuer

 - [DELETE /card-issuers/{cardIssuerId}](https://docs.peachfinance.com/api-docs/api-public/card-issuers/peach.card_issuers.handlers.card_issuer_delete.md)

### Get card issuer by ID

 - [GET /card-issuers/{cardIssuerId}](https://docs.peachfinance.com/api-docs/api-public/card-issuers/peach.card_issuers.handlers.card_issuer_get.md)

### Update card issuer

 - [PUT /card-issuers/{cardIssuerId}](https://docs.peachfinance.com/api-docs/api-public/card-issuers/peach.card_issuers.handlers.card_issuer_update.md)

## Funding Instruments

### Get funding instruments

 - [GET /companies/{companyId}/payment-processors/{paymentProcessorId}/funding-instruments](https://docs.peachfinance.com/api-docs/api-public/funding-instruments/peach.payment_instruments.handlers.funding_instrument_get_all.md)

### Create funding instrument

 - [POST /companies/{companyId}/payment-processors/{paymentProcessorId}/funding-instruments](https://docs.peachfinance.com/api-docs/api-public/funding-instruments/peach.payment_instruments.handlers.funding_instrument_create.md)

### Get funding instrument by ID

 - [GET /companies/{companyId}/payment-processors/{paymentProcessorId}/funding-instruments/{fundingInstrumentId}](https://docs.peachfinance.com/api-docs/api-public/funding-instruments/peach.payment_instruments.handlers.funding_instrument_get.md)

### Update funding instrument

 - [PUT /companies/{companyId}/payment-processors/{paymentProcessorId}/funding-instruments/{fundingInstrumentId}](https://docs.peachfinance.com/api-docs/api-public/funding-instruments/peach.payment_instruments.handlers.funding_instrument_update.md)

## Employees

### Get employees

 - [GET /employees](https://docs.peachfinance.com/api-docs/api-public/employees/peach.employees.handlers.employees.employees_get.md): Get employees

### Create employee

 - [POST /employees](https://docs.peachfinance.com/api-docs/api-public/employees/peach.employees.handlers.employees.employee_create.md): Create a new employee for a company.

### Get employee by ID

 - [GET /employees/{employeeId}](https://docs.peachfinance.com/api-docs/api-public/employees/peach.employees.handlers.employees.employee_get_by_id.md): Get employee by ID

### Update employee

 - [PUT /employees/{employeeId}](https://docs.peachfinance.com/api-docs/api-public/employees/peach.employees.handlers.employees.employee_update.md): Update an employee

### Get email signature

 - [GET /employees/{employeeId}/email-signature](https://docs.peachfinance.com/api-docs/api-public/employees/peach.employees.handlers.email_signature.employee_email_signature_get.md): Get the employee's email signature

### Update email signature

 - [PUT /employees/{employeeId}/email-signature](https://docs.peachfinance.com/api-docs/api-public/employees/peach.employees.handlers.email_signature.employee_email_signature_set.md): Update the employee's email signature

### Remove employee from team

 - [DELETE /employees/{employeeId}/teams/{teamId}](https://docs.peachfinance.com/api-docs/api-public/employees/peach.employees.handlers.employees.employee_remove_from_team.md): Remove an employee from a team

### Add employee to team

 - [PUT /employees/{employeeId}/teams/{teamId}](https://docs.peachfinance.com/api-docs/api-public/employees/peach.employees.handlers.employees.employee_add_to_team.md): Add employee to a team

## Teams

### Get teams

 - [GET /teams](https://docs.peachfinance.com/api-docs/api-public/teams/peach.employees.handlers.teams.teams_get.md): Get all teams in a company

### Create team

 - [POST /teams](https://docs.peachfinance.com/api-docs/api-public/teams/peach.employees.handlers.teams.teams_create.md): Create a new team

### Delete team

 - [DELETE /teams/{teamId}](https://docs.peachfinance.com/api-docs/api-public/teams/peach.employees.handlers.teams.team_delete.md): Delete team

### Get team by ID

 - [GET /teams/{teamId}](https://docs.peachfinance.com/api-docs/api-public/teams/peach.employees.handlers.teams.team_get.md): Get team by ID

### Update

 - [PUT /teams/{teamId}](https://docs.peachfinance.com/api-docs/api-public/teams/peach.employees.handlers.teams.team_update.md): Update team

## Users

### Get users

 - [GET /users](https://docs.peachfinance.com/api-docs/api-public/users/peach.users.handlers.users_get.md)

### Create user

 - [POST /users](https://docs.peachfinance.com/api-docs/api-public/users/peach.users.handlers.user_create.md): Creates a user.

authType.email or authType.phone is required depending on company configuration.

authType.password is required unless the company is configured to OneTimeCodeEmail or OneTimeCodeText in which case sends an empty string.

### Get user

 - [GET /users/{userId}](https://docs.peachfinance.com/api-docs/api-public/users/peach.users.handlers.user_get.md)

### Update user

 - [PUT /users/{userId}](https://docs.peachfinance.com/api-docs/api-public/users/peach.users.handlers.user_update.md)

## Roles

### Get user's current permissions

 - [GET /users/{userId}/permissions](https://docs.peachfinance.com/api-docs/api-public/roles/peach.users.handlers.user_get_permissions.md): Given

### Get user roles

 - [GET /users/{userId}/roles](https://docs.peachfinance.com/api-docs/api-public/roles/peach.roles.handlers.user_role_get.md)

### Remove role from user

 - [DELETE /users/{userId}/roles/{roleId}](https://docs.peachfinance.com/api-docs/api-public/roles/peach.roles.handlers.user_role_delete.md)

### Add role to user

 - [PUT /users/{userId}/roles/{roleId}](https://docs.peachfinance.com/api-docs/api-public/roles/peach.roles.handlers.user_role_update.md)

## Investors

This object represents institutional owners of loans. Investors must be created before they
can be associated with loans.


### Get investors

 - [GET /companies/{companyId}/investors](https://docs.peachfinance.com/api-docs/api-public/investors/peach.payment_instruments.handlers.investor_get_all.md): Get all investors under the given company.

### Create investor

 - [POST /companies/{companyId}/investors](https://docs.peachfinance.com/api-docs/api-public/investors/peach.payment_instruments.handlers.investor_create.md): Create an investor under the umbrella of the given company.

### Get investor by ID

 - [GET /companies/{companyId}/investors/{investorId}](https://docs.peachfinance.com/api-docs/api-public/investors/peach.payment_instruments.handlers.investor_get.md)

### Update investor

 - [PUT /companies/{companyId}/investors/{investorId}](https://docs.peachfinance.com/api-docs/api-public/investors/peach.payment_instruments.handlers.investor_update.md)

### Get loan investors

 - [GET /companies/{companyId}/people/{personId}/loans/{loanId}/investors](https://docs.peachfinance.com/api-docs/api-public/investors/peach.people.loans.handlers.internal_loan_investors_get_all.md)

## Settlement Instruments

This object represents a bank account belonging to an investor. Peach will settle payment
proceed into that account.


### Get settlement instruments

 - [GET /companies/{companyId}/investors/{investorId}/settlement-instruments](https://docs.peachfinance.com/api-docs/api-public/settlement-instruments/peach.payment_instruments.handlers.settlement_instrument_get_all.md)

### Create settlement instrument

 - [POST /companies/{companyId}/investors/{investorId}/settlement-instruments](https://docs.peachfinance.com/api-docs/api-public/settlement-instruments/peach.payment_instruments.handlers.settlement_instrument_create.md)

### Get settlement instrument by ID

 - [GET /companies/{companyId}/investors/{investorId}/settlement-instruments/{settlementInstrumentId}](https://docs.peachfinance.com/api-docs/api-public/settlement-instruments/peach.payment_instruments.handlers.settlement_instrument_get.md)

### Update settlement instrument

 - [PUT /companies/{companyId}/investors/{investorId}/settlement-instruments/{settlementInstrumentId}](https://docs.peachfinance.com/api-docs/api-public/settlement-instruments/peach.payment_instruments.handlers.settlement_instrument_update.md)

## Loan Tape Types

Allows configuration for which fields should be included for loans or payments tapes.


### Get loan tape types

 - [GET /companies/{companyId}/loan-tape-types](https://docs.peachfinance.com/api-docs/api-public/loan-tape-types/peach.loans.tape.handlers.loan_tape_types_list.md)

### Create loan tape type

 - [POST /companies/{companyId}/loan-tape-types](https://docs.peachfinance.com/api-docs/api-public/loan-tape-types/peach.loans.tape.handlers.loan_tape_type_create.md): Creates a new loan tape type.

### Delete loan tape type

 - [DELETE /companies/{companyId}/loan-tape-types/{loanTapeTypeId}](https://docs.peachfinance.com/api-docs/api-public/loan-tape-types/peach.loans.tape.handlers.loan_tape_type_delete.md)

### Get loan tape type by ID

 - [GET /companies/{companyId}/loan-tape-types/{loanTapeTypeId}](https://docs.peachfinance.com/api-docs/api-public/loan-tape-types/peach.loans.tape.handlers.loan_tape_type_get.md)

### Update loan tape type

 - [PUT /companies/{companyId}/loan-tape-types/{loanTapeTypeId}](https://docs.peachfinance.com/api-docs/api-public/loan-tape-types/peach.loans.tape.handlers.loan_tape_type_update.md)

## Loan Tapes

Allows investors to get different loan tapes delivered to different SFTP servers.


### Get loan tapes

 - [GET /companies/{companyId}/loan-tapes](https://docs.peachfinance.com/api-docs/api-public/loan-tapes/peach.loans.tape.handlers.loan_tapes_list.md)

### Create loan tape

 - [POST /companies/{companyId}/loan-tapes](https://docs.peachfinance.com/api-docs/api-public/loan-tapes/peach.loans.tape.handlers.loan_tape_create.md): Creates a new loan tape.

### Generate Loan Tapes

 - [POST /companies/{companyId}/loan-tapes/generate](https://docs.peachfinance.com/api-docs/api-public/loan-tapes/peach.loans.tape.handlers.loan_tapes_generate.md)

### Delete loan tape

 - [DELETE /companies/{companyId}/loan-tapes/{loanTapeId}](https://docs.peachfinance.com/api-docs/api-public/loan-tapes/peach.loans.tape.handlers.loan_tape_delete.md)

### Get loan tape by ID

 - [GET /companies/{companyId}/loan-tapes/{loanTapeId}](https://docs.peachfinance.com/api-docs/api-public/loan-tapes/peach.loans.tape.handlers.loan_tape_get.md)

### Update loan tape

 - [PUT /companies/{companyId}/loan-tapes/{loanTapeId}](https://docs.peachfinance.com/api-docs/api-public/loan-tapes/peach.loans.tape.handlers.loan_tape_update.md)

### Get loan tape records

 - [GET /companies/{companyId}/loan-tapes/{loanTapeId}/records](https://docs.peachfinance.com/api-docs/api-public/loan-tapes/peach.loans.tape.handlers.loan_tape_records_list.md): Records are sorted by createdAt descending

## Merchants

Allows lenders to keep track of merchants associated with loans and purchases.
Merchant details can be shown in the Peach Borrower Portal. The following attributes are shown to a borrower:

`NAME` businessName

`ADDRESS` address

`DEPARTMENT OR CONTACT NAME` primaryContactName

`EMAIL` primaryContactEmail

`PHONE` primaryContactPhone


### Get merchants

 - [GET /companies/{companyId}/merchants](https://docs.peachfinance.com/api-docs/api-public/merchants/peach.merchants.handlers.merchants_list.md)

### Create merchant

 - [POST /companies/{companyId}/merchants](https://docs.peachfinance.com/api-docs/api-public/merchants/peach.merchants.handlers.merchant_create.md): Creates a new merchant.

### Get merchant by ID

 - [GET /companies/{companyId}/merchants/{merchantId}](https://docs.peachfinance.com/api-docs/api-public/merchants/peach.merchants.handlers.merchant_get.md)

### Update merchant

 - [PUT /companies/{companyId}/merchants/{merchantId}](https://docs.peachfinance.com/api-docs/api-public/merchants/peach.merchants.handlers.merchant_update.md)

## Events

This object represents an event. Events are sent from Peach to you. Events can be
related to any object in this API.

| Event Name                                  | Occurs when                                                           | Related Object     |
|---------------------------------------------|-----------------------------------------------------------------------|--------------------|
| advance.statuschanged                       | an advance status changes                                             | Advance            |
| advance.updated                             | an advance amount is updated                                          | Advance            |
| autopay.schedule.created                    | an autopay schedule is set up                                         | Autopay            |
| autopay.schedule.cancel                     | an autopay schedule is canceled                                       | Autopay            |
| autopay.schedule.changed                    | an autopay schedule is changed                                        | Autopay            |
| autopay.payment.rescheduled                 | an autopay payment is rescheduled                                     | Autopay            |
| autopay.payment.canceled                    | an autopay payment is canceled                                        | Autopay            |
| card.created                                | a card is created                                                     | Card               |
| card.replacement.requested                  | a card replacement is requested                                       | Card               |
| card.status.changed                         | a card's status is changed                                            | Card               |
| case.changed                                | a case is created, updated, or deleted, with precise change information | Case             |
| case.created                                | [**DEPRECATED** - no longer fired, use case.changed instead] a case is created         | Case               |
| case.deleted                                | [**DEPRECATED** - was never used, use case.changed instead] a case is deleted         | Case               |
| case.updated                                | [**DEPRECATED** - no longer fired, use case.changed instead] a case is updated         | Case               |
| case.association.added                      | an association is added to a case                                     | Case               |
| case.association.removed                    | an association is removed from a case                                 | Case               |
| case.donotinteract.changed                  | a DoNotInteract object is created, updated, or deleted, with precise change information | Case               |
| case.donotinteract.created                  | [**DEPRECATED** - use case.donotinteract.changed instead] a DoNotInteract object is created | Case               |
| case.donotinteract.deleted                  | [**DEPRECATED** - use case.donotinteract.changed instead] a DoNotInteract object is deleted | Case               |
| case.donotinteract.updated                  | [**DEPRECATED** - use case.donotinteract.changed instead] a DoNotInteract object is updated | Case               |
| case.donotinteract.expired                  | a DoNotInteract object has expired                                    | Case |
| case.escalation.changed                     | a case escalation is created, updated, or deleted, with precise change information | Case  |
| case.escalation.created                     | [**DEPRECATED** - use case.escalation.changed instead] a case escalation is created | Case               |
| case.escalation.canceled                    | [**DEPRECATED** - use case.escalation.changed instead] a case escalation is canceled | Case               |
| contact.created                             | a contact is created                                                  | Contact            |
| contact.deleted                             | a contact is deleted                                                  | Contact            |
| contact.updated                             | a contact is updated                                                  | Contact            |
| communication.send                          | communication is attempted                                            | Interaction        |
| indexrate.created                           | index rate is created                                                 | Loan Type          |
| indexrate.updated                           | index rate is updated                                                 | Loan Type          |
| interaction.blocked                         | interaction is blocked for a borrower                                 | Interaction        |
| loan.balance.changed                        | a loan balance changed                                                | Loan               |
| loan.closed                                 | a loan is closed                                                      | Loan               |
| loan.created                                | a loan is created                                                     | Loan               |
| loan.credit.limit.changed                   | a loan credit limit was changed                                       | Loan               |
| draw.credit.limit.changed                   | a draw credit limit was changed                                       | Draw               |
| loan.creditreporting.created                | a loan is scheduled to start credit reporting                         | Credit Reporting Status |
| loan.creditreporting.stopped                | a loan is scheduled to stop credit reporting                          | Credit Reporting Status |
| loan.current                                | a loan is current or became current                                   | Loan               |
| loan.duedate.defer                          | a single loan due date is deferred                                    | Loan               |
| loan.fee.booked                             | a dynamic fee is applied                                              | Loan               |
| loan.fee.canceled                           | a dynamic fee is canceled                                             | Loan               |
| loan.fee.changed                            | a dynamic fee is changed                                              | Loan               |
| loan.interest.capitalized                   | interest capitalization is triggered after a due date                 | Loan               |
| loan.interestaccrued.min                    | minimum interest charge is triggered on a draw                        | Draw               |
| loan.latefee.booked                         | a late fee is applied                                                 | Loan               |
| loan.modificationfee.booked                 | a modification fee is applied                                         | Loan               |
| loan.migration.succeeded                    | a loan migration succeeds                                             | Loan               |
| loan.migration.failed                       | a loan migration fails                                                | Loan               |
| loan.obligation.statuschanged               | a change in a loan's obligation status is recorded                    | Loan               |
| loan.overdue                                | a loan is overdue                                                     | Loan               |
| loan.overdue.update                         | a loan is overdue                                                     | Loan               |
| loan.ownerchanged                           | a loan changes owners                                                 | Loan               |
| loan.paymentplan.setup                      | a loan payment plan is set up                                         | Loan               |
| loan.period.started                         | a loan period has started                                             | Loan               |
| loan.promiseplan.created                    | a promise to pay plan is created                                      | Promise to Pay Plan|
| loan.promiseplan.statuschanged              | a promise to pay plan status changes                                  | Promise to Pay Plan|
| loan.promiseplan.due.today                  | a promise to pay plan is due today                                    | Promise to Pay Plan|
| loan.promiseplan.overdue                    | a promise to pay plan becomes "overdue"                               | Promise to Pay Plan|
| loan.promiseplan.current                    | a promise to pay plan changes from "overdue" to "current"             | Promise to Pay Plan|
| loan.promoprogram.created                   | a promo program is created                                            | Loan               |
| loan.promoprogram.updated                   | a promo program is updated                                            | Loan               |
| loan.rate.created                           | rate is created                                                       | Loan               |
| loan.rate.updated                           | rate is updated                                                       | Loan               |
| loan.refunded                               | payments on a loan are refunded                                       | Loan               |
| loan.reimbursement.initiated                | a borrower reimbursement is initiated                                 | Loan               |
| loan.reimbursement.processed                | a borrower reimbursement is processed                                 | Loan               |
| loan.schedule.defer                         | a loan schedule is deferred                                           | Loan               |
| loan.changeloanterms.scra.update            | a loan SCRA plan is created                                           | Loan               |
| loan.scraplan.changed                       | a loan SCRA plan is changed                                           | Loan               |
| loan.scraplan.deleted                       | a loan SCRA plan is deleted                                           | Loan               |
| loan.servicefee.booked                      | a service fee is booked                                               | Loan               |
| loan.membershipfee.booked                   | a membership fee is booked                                            | Loan               |
| loan.statuschanged                          | a loan changes status                                                 | Loan               |
| person.consent.updated                      | a borrower updates their consents                                     | Borrower           |
| person.created                              | a borrower is created                                                 | Borrower           |
| person.monitoring.bankruptcy.started        | bankruptcy and deceased monitoring begins for a borrower              | Borrower           |
| person.monitoring.scra.started              | SCRA monitoring begins for a borrower                                 | Borrower           |
| payment.instrument.created                  | a payment instrument is created                                       | Payment Instrument |
| payment.instrument.updated                  | a payment instrument is updated                                       | Payment Instrument |
| payment.instrument.deactivated              | a payment instrument is deactivated                                   | Payment Instrument |
| payment.applied                             | **DEPRECATED** used in place of payment.initiated for internal ACH prior to deprecation. | Transaction        |
| payment.chargeback                          | a payment is charged back                                             | Transaction        |
| payment.chargeback.reversed                 | a payment is chargeback is reversed                                   | Transaction        |
| payment.failed                              | a payment fails                                                       | Transaction        |
| payment.initiated                           | a payment is initiated                                                | Transaction        |
| payment.pending                             | a payment is pending                                                  | Transaction        |
| payment.reversed                            | a payment is reversed                                                 | Transaction        |
| payment.succeeded                           | a payment is succeeded                                                | Transaction        |
| payment.scheduled                           | a payment is scheduled                                                | Transaction        |
| payment.rescheduled                         | a payment is rescheduled                                              | Transaction        |
| payment.due.today                           | periodically for external transactions with a status of "scheduled"   | Transaction        |
| payment.hold.days.expired                   | a transaction's hold days expired                                     | Transaction        |
| paymentplan.created                         | a payment plan is created                                             | Payment Plan       |
| paymentplan.statuschanged                   | a payment plan changes status                                         | Payment Plan       |
| purchase.authorized                         | a purchase is authorized                                              | Purchase           |
| purchase.settled                            | a purchase is settled                                                 | Purchase           |
| purchase.applied                            | a purchase is applied.                                                | Purchase           |
| purchase.created                            | a purchase is created                                                 | Purchase           |
| purchase.changed                            | a purchase is updated                                                 | Purchase           |
| purchase.dispute.created                    | a purchase dispute is created                                         | Purchase Dispute   |
| purchase.dispute.updated                    | a purchase dispute is updated                                         | Purchase Dispute   |
| statement.created                           | a statement is created                                                | Loan               |
| reconciliation.payment.failed               | a reconciliation payment fails                                        | Transaction        |


### Retrieve events

 - [GET /events](https://docs.peachfinance.com/api-docs/api-public/events/peach.events.handlers.get_events_external.md)

## Webhooks

Allows clients to manage webhooks.

The Peach webhook system will issue `POST` requests with the event data as JSON payload.


### Get webhooks

 - [GET /webhooks](https://docs.peachfinance.com/api-docs/api-public/webhooks/peach.webhooks.handlers.webhooks_list.md)

### Create webhook subscription

 - [POST /webhooks](https://docs.peachfinance.com/api-docs/api-public/webhooks/peach.webhooks.handlers.webhook_create.md): Creates a new webhook subscription.

### Delete webhook subscription

 - [DELETE /webhooks/{webhookSubscriptionId}](https://docs.peachfinance.com/api-docs/api-public/webhooks/peach.webhooks.handlers.webhook_delete.md)

### Get webhook subscription by ID

 - [GET /webhooks/{webhookSubscriptionId}](https://docs.peachfinance.com/api-docs/api-public/webhooks/peach.webhooks.handlers.webhook_get.md)

### Update webhook subscription

 - [PUT /webhooks/{webhookSubscriptionId}](https://docs.peachfinance.com/api-docs/api-public/webhooks/peach.webhooks.handlers.webhook_update.md)

### Test a webhook with static payload.

 - [POST /webhooks/{webhookSubscriptionId}/ping](https://docs.peachfinance.com/api-docs/api-public/webhooks/peach.webhooks.handlers.webhook_ping.md)

## Loan Amortization

### Amortize loan

 - [POST /amortize](https://docs.peachfinance.com/api-docs/api-public/loan-amortization/peach.loans.handlers.amortization_get.md): This utility generates an amortization schedule for an installment loan or line of credit draw.
The atOrigination field is where you specify various loan or draw-specific inputs such as the
start date, amount to be financed, and duration.

You can specify generic loan type configurations as part of the request body (or omit these
fields and use the default configurations). Alternatively, you can use predefined loan type
configurations by passing in a loanTypeId. For a line of credit draw, you can also pass in
a loanId in place of a loanTypeId. When a loanId is provided, the amortization calculation
will reference the configurations of the loan type associated with the loanId, and will also
use the line of credit start date and rates associated with the loanId if these fields are
not passed in.

When generating an amortization schedule from a predefined loan type, you can pass in either a
personAddress or personAddressId to check the amortization output against any existing rate
caps associated with the loan type.

Note for the "Predefined Line Of Credit" option only:
- If the loan type is configured to accrue interest as accrualMethod=compoundWithFees, there is
a known limitation to the draw amortization calculation logic.
- The draw amortization calculation will be done using the compound method and not compoundWithFees.
To ensure that the system calculates interest accurately, amortized draws should NOT include any fees.

### Amortize loan combinations

 - [POST /amortize-combinations](https://docs.peachfinance.com/api-docs/api-public/loan-amortization/peach.loans.handlers.amortization_combinations.md): NOTE: This endpoint does not support recurring dynamic fees. Origination fees and other dynamic non-recurring fees are supported.

## Routing Numbers

This utility function returns financial institution name that a routing number belongs to.
This information is updated once or twice a month by the Federal Reserve Bank.


### Get routing number details

 - [GET /routing-numbers/{routingNumber}](https://docs.peachfinance.com/api-docs/api-public/routing-numbers/peach.routing_numbers.handlers.get_routing_number.md)

## BIN Numbers

This utility function returns card details.
The BIN information is provided by First Data and normally updated weekly.


### Get BIN details from card number

 - [POST /bin-numbers](https://docs.peachfinance.com/api-docs/api-public/bin-numbers/peach.bin_numbers.handlers.get_bin_number.md)

## Index Rates

This utility function is used for managing index interest rates (for example, a rate that is pegged to the prime rate
of the Fed). Index Interest Rates are set at the loan type level and can be used by loans associated with the loanTypeId.
Index Interest Rates are only relevant to interest rates and not relevant to promo rates.

Index Interest Rate values can be updated with a new value with an effective date in the past. When a new Index Interest
Rate value is set, the previous rate end date will be set to one calendar day before the new rate's effective date.
If the new rate's effective date is in the past, the Peach system will replay all Active loans (to clarify, Active loans
at the time of Index Interest Rate update) with the new Index Interest Rate value and re-accrue loans' interest.


### Get index interest rates

 - [GET /loan-types/{loanTypeId}/index-rates](https://docs.peachfinance.com/api-docs/api-public/index-rates/peach.loan_configuration.handlers.loan_type_index_rate_get_all.md)

### Add index interest rate

 - [POST /loan-types/{loanTypeId}/index-rates](https://docs.peachfinance.com/api-docs/api-public/index-rates/peach.loan_configuration.handlers.loan_type_index_rate_add.md)

### Cancel index interest rate

 - [DELETE /loan-types/{loanTypeId}/index-rates/{indexRateId}](https://docs.peachfinance.com/api-docs/api-public/index-rates/peach.loan_configuration.handlers.loan_type_index_rate_delete.md)

### Get index interest rate by ID

 - [GET /loan-types/{loanTypeId}/index-rates/{indexRateId}](https://docs.peachfinance.com/api-docs/api-public/index-rates/peach.loan_configuration.handlers.loan_type_index_rate_get.md)

### Update index interest rate

 - [PUT /loan-types/{loanTypeId}/index-rates/{indexRateId}](https://docs.peachfinance.com/api-docs/api-public/index-rates/peach.loan_configuration.handlers.loan_type_index_rate_update.md): This endpoint is used for updating index interest rates.

## Operations

Operations represent ongoing asynchronous tasks in the Peach system. When
you start an asynchronous task, either directly by having an API call with
`sync=false` or indirectly by having an API call with `sync=true` time
out, you will receive an operation ID that can be used to monitor its
status.

When an operation completes, the operation ID will continue to be valid
for 1 hour, after which it will expire and become inaccessible.

Under certain exceptional circumstances, an asychronous task may be
delayed and not complete before 24 hours have passed. At that point, the
operation ID will expire despite still being in-flight. If this happens,
please reach out to Peach support.


### Get operation status

 - [GET /operations/{operationId}](https://docs.peachfinance.com/api-docs/api-public/operations/peach.operation_status.handlers.operation_status_get.md)

## Credit Agencies

### Get credit agencies

 - [GET /companies/{companyId}/credit-agencies](https://docs.peachfinance.com/api-docs/api-public/credit-agencies/peach.credit_reporting.handlers.credit_agencies_list.md)

### Create credit agency

 - [POST /companies/{companyId}/credit-agencies](https://docs.peachfinance.com/api-docs/api-public/credit-agencies/peach.credit_reporting.handlers.credit_agency_create.md): Creates a new credit agency.

### Get credit agency by ID

 - [GET /companies/{companyId}/credit-agencies/{creditAgencyId}](https://docs.peachfinance.com/api-docs/api-public/credit-agencies/peach.credit_reporting.handlers.credit_agency_get.md)

### Update credit agency

 - [PUT /companies/{companyId}/credit-agencies/{creditAgencyId}](https://docs.peachfinance.com/api-docs/api-public/credit-agencies/peach.credit_reporting.handlers.credit_agency_update.md)

### Regenerate SSH key pair for credit agency

 - [POST /companies/{companyId}/credit-agencies/{creditAgencyId}/regenerate-ssh-keys](https://docs.peachfinance.com/api-docs/api-public/credit-agencies/peach.credit_reporting.handlers.credit_agency_regenerate_ssh_keys.md): Generates a new RSA SSH key pair for the credit agency and returns the updated object.
The new sftpSSHPeachPublicKey must be added to the SFTP server's authorized_keys file —
the old public key will no longer work after this call.

## Collection Agencies

Allows lenders to keep track of different collection agencies that charged-off loans may be assigned to.
This is useful when a lender assigns charged off loans to a third party debt collection agency.
The Peach Borrower Portal will display the collection agency information to the borrower. The lender can continue to use Peach as the system
of record / ledger for charged off loans. The lender can post any payments collected by the collection agency as `isExternal=true` transactions.
The Peach system will waterfall the payments and update loan balances.


### Get collection agencies

 - [GET /companies/{companyId}/collection-agencies](https://docs.peachfinance.com/api-docs/api-public/collection-agencies/peach.collections.handlers.collection_agencies_list.md)

### Create collection agency

 - [POST /companies/{companyId}/collection-agencies](https://docs.peachfinance.com/api-docs/api-public/collection-agencies/peach.collections.handlers.collection_agency_create.md): Creates a new collection agency. This is useful when a lender assigns a charged off loan to a third party debt collection agency.
The Peach Borrower Portal will display the collection agency information to the borrower. The lender can continue to use Peach as the system
of record / ledger for charged off loans. The lender can post any payments collected by the collection agency as isExternal=true transaction. 
The Peach system will waterfall the payments and update loan balances.

### Delete collection agency

 - [DELETE /companies/{companyId}/collection-agencies/{collectionAgencyId}](https://docs.peachfinance.com/api-docs/api-public/collection-agencies/peach.collections.handlers.collection_agency_delete.md): Sets isArchived = true on the agency

### Get collection agency by ID

 - [GET /companies/{companyId}/collection-agencies/{collectionAgencyId}](https://docs.peachfinance.com/api-docs/api-public/collection-agencies/peach.collections.handlers.collection_agency_get.md)

### Update collection agency

 - [PUT /companies/{companyId}/collection-agencies/{collectionAgencyId}](https://docs.peachfinance.com/api-docs/api-public/collection-agencies/peach.collections.handlers.collection_agency_update.md)

