# Loan Applications
> A Loan Application is a request for credit submitted by a customer. Once submitted, Increase reviews the application and either approves it, yielding a Loan Offer, or rejects it.

[Events](https://increase.com/documentation/webhooks.md) will be generated for this resource. The possible event categories are: `loan_application.created` and `loan_application.updated`.

## The Loan Application object
### Example
```json
{
  "adverse_action_notice_evidence": null,
  "approval": null,
  "created_at": "2020-01-31T23:59:59Z",
  "entity_id": "entity_n8y8tnk2p9339ti393yi",
  "guarantor_beneficial_owner_id": null,
  "id": "loan_application_mpe6oe4a2gc5knzl1xfy",
  "idempotency_key": null,
  "parameters": [
    {
      "amount": null,
      "category": "text",
      "enumerated_option": null,
      "key": "event_name",
      "text": {
        "value": "Cherry Street Pier Market"
      }
    }
  ],
  "plaid_processor_tokens": [
    {
      "plaid_processor_token_id": "plaid_processor_token_u8go17ptm6tnxi70hwiz"
    }
  ],
  "program_id": "program_i2v2os4mwza1oetokh9i",
  "rejection": null,
  "status": "pending_reviewing",
  "type": "loan_application"
}
```
### Attributes
- `adverse_action_notice_evidence` (dictionary, nullable)
  If evidence of an adverse action notice has been submitted for the Loan Application, this contains details of the notice.

  - `adverse_action_notice_evidence.sent_at` (string)
    The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the adverse action notice was sent to the applicant.

- `approval` (dictionary, nullable)
  If the Loan Application has been approved, this contains details of the approval.

  - `approval.approved_at` (string)
    The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Loan Application was approved.

  - `approval.loan_offer_id` (string)
    The identifier of the Loan Offer extended as a result of the approval.

- `created_at` (string)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Loan Application was created.

- `entity_id` (string)
  The identifier of the Entity applying for credit.

- `guarantor_beneficial_owner_id` (string, nullable)
  The identifier of the Beneficial Owner of the Entity who is guaranteeing the loan, if any.

- `id` (string)
  The Loan Application's identifier.

- `idempotency_key` (string, nullable)
  The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

- `parameters` (array of objects)
  The values the applicant provided for the Program's application parameters.

  - `parameters.amount` (dictionary, nullable)
    A monetary amount in the minor unit of the currency. Present if `category` is `amount`.

      - `parameters.amount.value` (integer)
        The amount in the minor unit of the currency. For dollars, this is cents.

  - `parameters.category` (enum)
    The category of the parameter.
    Cases:
    * `text` (A free-form text value.)
    * `enumerated_option` (A value selected from a predefined list of options.)
    * `amount` (A monetary amount in the minor unit of a currency.)

  - `parameters.enumerated_option` (dictionary, nullable)
    A value selected from the parameter's options. Present if `category` is `enumerated_option`.

      - `parameters.enumerated_option.value` (string)
        The selected option's value.

  - `parameters.key` (string)
    The parameter's key.

  - `parameters.text` (dictionary, nullable)
    A free-form text value. Present if `category` is `string`.

      - `parameters.text.value` (string)
        The text value.

- `plaid_processor_tokens` (array of objects)
  The Plaid Processor Tokens corresponding to bank accounts owned by the applicant.

  - `plaid_processor_tokens.plaid_processor_token_id` (string)
    The Increase identifier of the Plaid Processor Token, not the token itself.

- `program_id` (string)
  The identifier of the Program under which the application was submitted.

- `rejection` (dictionary, nullable)
  If the Loan Application has been rejected, this contains details of the rejection.

  - `rejection.file_id` (string)
    The identifier of the File containing the adverse action notice sent to the applicant.

  - `rejection.reasons` (array of enums)
    The principal reasons the Loan Application was rejected, up to four.
    Cases:
    * `credit_score` (The applicant's credit score was insufficient.)
    * `insufficient_revenue` (The applicant's revenue was insufficient.)
    * `insufficient_operating_history` (The applicant's operating history was insufficient.)
    * `incomplete_application` (The Loan Application was incomplete.)
    * `ineligible_state` (We do not offer loans in the applicant's state.)
    * `ownership_structure` (The applicant's ownership structure was outside of the program's parameters.)
    * `prohibited_industry` (The applicant's business operates in a prohibited industry.)
    * `identity_verification_fraud` (The applicant's identity could not be confirmed because fraud was suspected.)
    * `identity_verification_incomplete` (The applicant did not successfully complete identity verification.)
    * `business_verification` (The nature of the applicant's business could not be confirmed.)
    * `wallet_identity_verification` (The identity associated with the applicant's wallet could not be confirmed.)
    * `credit_report_unavailable` (One or more beneficial owners' personal credit reports could not be retrieved.)
    * `beneficial_owner_credit_score` (One or more beneficial owners' personal credit score was too low.)
    * `advertising_spend` (The applicant's 90-day advertising spend was outside the range considered for the program.)
    * `insufficient_bank_account_history` (The bank accounts the applicant connected had insufficient history.)
    * `incomplete_application_credit_score_frozen` (The applicant's credit report was frozen, so their credit score could not be retrieved.)
    * `revenue` (The applicant's trailing 365-day net merchandise sales were below the range considered for the program.)
    * `liquidity` (The applicant's available bank account balances were below the range considered for the program.)

  - `rejection.rejected_at` (string)
    The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Loan Application was rejected.

- `status` (enum)
  The status of the Loan Application.
  Cases:
  * `pending_reviewing` (The Loan Application is being reviewed.)
  * `approved` (The Loan Application has been approved and a Loan Offer has been extended.)
  * `rejected` (The Loan Application has been rejected.)

- `type` (string)
  A constant representing the object's type. For this resource it will always be `loan_application`.

## List Loan Applications
GET /loan_applications

### Example
```curl
curl \
  --url "${INCREASE_URL}/loan_applications" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```

### Query Parameters
- `cursor` (string, optional)
  Return the page of entries after this one.

- `limit` (integer, optional)
  Limit the size of the list that is returned. The default (and maximum) is 100 objects.

  Default: `100`

- `status.in` (array of enums, optional)
  Filter Loan Applications for those with the specified status or statuses. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.

  Cases:
  * `pending_reviewing` (The Loan Application is being reviewed.)
  * `approved` (The Loan Application has been approved and a Loan Offer has been extended.)
  * `rejected` (The Loan Application has been rejected.)

- `idempotency_key` (string, optional)
  Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).
  Between 1 and 200 characters

### Returns a Loan Application List object:
```json
{
  "data": [
    {
      "adverse_action_notice_evidence": null,
      "approval": null,
      "created_at": "2020-01-31T23:59:59Z",
      "entity_id": "entity_n8y8tnk2p9339ti393yi",
      "guarantor_beneficial_owner_id": null,
      "id": "loan_application_mpe6oe4a2gc5knzl1xfy",
      "idempotency_key": null,
      "parameters": [
        {
          "amount": null,
          "category": "text",
          "enumerated_option": null,
          "key": "event_name",
          "text": {
            "value": "Cherry Street Pier Market"
          }
        }
      ],
      "plaid_processor_tokens": [
        {
          "plaid_processor_token_id": "plaid_processor_token_u8go17ptm6tnxi70hwiz"
        }
      ],
      "program_id": "program_i2v2os4mwza1oetokh9i",
      "rejection": null,
      "status": "pending_reviewing",
      "type": "loan_application"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Create a Loan Application
POST /loan_applications

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/loan_applications" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "entity_id": "entity_n8y8tnk2p9339ti393yi",
    "parameters": [
      {
        "category": "text",
        "key": "event_name",
        "text": {
          "value": "Cherry Street Pier Market"
        }
      }
    ],
    "plaid_processor_tokens": [
      {
        "plaid_processor_token_id": "plaid_processor_token_u8go17ptm6tnxi70hwiz"
      }
    ],
    "program_id": "program_i2v2os4mwza1oetokh9i"
  }'
```

### Body Parameters
- `entity_id` (string, required)
  The identifier of the Entity applying for credit.

- `guarantor_beneficial_owner_id` (string, optional)
  The identifier of a Beneficial Owner of the Entity who is guaranteeing the loan.

- `parameters` (array of objects, required)
  The values for the Program's application parameters.

  - `parameters.amount` (dictionary, optional)
    A monetary amount in the minor unit of the currency. Required if `category` is equal to `amount`.

      - `parameters.amount.value` (integer, required)
        The amount in the minor unit of the currency. For dollars, this is cents.

  - `parameters.category` (enum, required)
    The category of the parameter, which determines the sub-object under which the value is provided.

    Cases:
    * `text` (A free-form text value.)
    * `enumerated_option` (A value selected from a predefined list of options.)
    * `amount` (A monetary amount in the minor unit of a currency.)

  - `parameters.enumerated_option` (dictionary, optional)
    A value selected from the parameter's options. Required if `category` is equal to `enumerated_option`.

      - `parameters.enumerated_option.value` (string, required)
        The selected option's value.
        Between 1 and 200 characters

  - `parameters.key` (string, required)
    The parameter's key.
    Between 1 and 200 characters

  - `parameters.text` (dictionary, optional)

      - `parameters.text.value` (string, required)
        The text value.
        Between 1 and 200 characters

- `plaid_processor_tokens` (array of objects, required)
  Plaid Processor Tokens corresponding to bank accounts owned by the applicant.

  - `plaid_processor_tokens.plaid_processor_token_id` (string, required)
    The Increase identifier of the Plaid Processor Token, not the token itself.

- `program_id` (string, required)
  The identifier of the Program to apply under.

## Retrieve a Loan Application
GET /loan_applications/{loan_application_id}

### Example
```curl
curl \
  --url "${INCREASE_URL}/loan_applications/loan_application_mpe6oe4a2gc5knzl1xfy" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `loan_application_id` (string, required)
  The identifier of the Loan Application.

## Submit adverse action notice evidence for a Loan Application
POST /loan_applications/{loan_application_id}/submit_adverse_action_notice_evidence
> Each rejected application should result in an adverse action notice stored at `file_id` delivered to the applicant via email.
### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/loan_applications/loan_application_mpe6oe4a2gc5knzl1xfy/submit_adverse_action_notice_evidence" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "recipient_email_address": "user@example.com",
    "sender_email_address": "notices@example.com",
    "sent_at": "2020-01-31T23:59:59Z"
  }'
```
### Path Parameters
- `loan_application_id` (string, required)
  The identifier of the Loan Application the adverse action notice was sent for.

### Body Parameters
- `recipient_email_address` (string, required)
  The email address the adverse action notice was sent to.
  Between 1 and 255 characters

- `sender_email_address` (string, required)
  The email address the adverse action notice was sent from.
  Between 1 and 255 characters

- `sent_at` (string, required)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the adverse action notice was sent to the applicant.

## Sandbox: Approve a Loan Application
POST /simulations/loan_applications/{loan_application_id}/approve
> Simulates the approval of a [Loan Application](#loan-applications) by Increase, yielding a [Loan Offer](#loan-offers). This Loan Application must first have a `status` of `pending_reviewing`.
### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/simulations/loan_applications/loan_application_mpe6oe4a2gc5knzl1xfy/approve" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "amount": 1000000
  }'
```
### Path Parameters
- `loan_application_id` (string, required)
  The identifier of the Loan Application you wish to approve.

### Body Parameters
- `amount` (integer, required)
  The amount of the resulting Loan Offer in the minor unit of the currency. For dollars, this is cents.

## Sandbox: Reject a Loan Application
POST /simulations/loan_applications/{loan_application_id}/reject
> Simulates the rejection of a [Loan Application](#loan-applications) by Increase, generating an adverse action notice. This Loan Application must first have a `status` of `pending_reviewing`.
### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/simulations/loan_applications/loan_application_mpe6oe4a2gc5knzl1xfy/reject" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "reasons": [
      "credit_score"
    ]
  }'
```
### Path Parameters
- `loan_application_id` (string, required)
  The identifier of the Loan Application you wish to reject.

### Body Parameters
- `reasons` (array of enums, optional)
  The principal reasons the Loan Application is being rejected, up to four.

  Cases:
  * `credit_score` (The applicant's credit score was insufficient.)
  * `insufficient_revenue` (The applicant's revenue was insufficient.)
  * `insufficient_operating_history` (The applicant's operating history was insufficient.)
  * `incomplete_application` (The Loan Application was incomplete.)
  * `ineligible_state` (We do not offer loans in the applicant's state.)
  * `ownership_structure` (The applicant's ownership structure was outside of the program's parameters.)
  * `prohibited_industry` (The applicant's business operates in a prohibited industry.)
  * `identity_verification_fraud` (The applicant's identity could not be confirmed because fraud was suspected.)
  * `identity_verification_incomplete` (The applicant did not successfully complete identity verification.)
  * `business_verification` (The nature of the applicant's business could not be confirmed.)
  * `wallet_identity_verification` (The identity associated with the applicant's wallet could not be confirmed.)
  * `credit_report_unavailable` (One or more beneficial owners' personal credit reports could not be retrieved.)
  * `beneficial_owner_credit_score` (One or more beneficial owners' personal credit score was too low.)
  * `advertising_spend` (The applicant's 90-day advertising spend was outside the range considered for the program.)
  * `insufficient_bank_account_history` (The bank accounts the applicant connected had insufficient history.)
  * `incomplete_application_credit_score_frozen` (The applicant's credit report was frozen, so their credit score could not be retrieved.)
  * `revenue` (The applicant's trailing 365-day net merchandise sales were below the range considered for the program.)
  * `liquidity` (The applicant's available bank account balances were below the range considered for the program.)