# 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
{
  "amount": 1000000,
  "approval": null,
  "created_at": "2020-01-31T23:59:59Z",
  "entity_id": "entity_n8y8tnk2p9339ti393yi",
  "id": "loan_application_mpe6oe4a2gc5knzl1xfy",
  "idempotency_key": null,
  "parameters": [
    {
      "key": "event_name",
      "value": "Cherry Street Pier Market"
    }
  ],
  "program_id": "program_i2v2os4mwza1oetokh9i",
  "rejection": null,
  "status": "pending_reviewing",
  "type": "loan_application"
}
```
### Attributes
- `amount` (integer)
  The requested amount of credit in the minor unit of the currency. For dollars, this is cents.

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

- `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.key` (string)
    The parameter's key.

  - `parameters.value` (string)
    The value the applicant provided.

- `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, nullable)
    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.)
    * `other` (The Loan Application was rejected for another reason.)

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

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

### Returns a Loan Application List object:
```json
{
  "data": [
    {
      "amount": 1000000,
      "approval": null,
      "created_at": "2020-01-31T23:59:59Z",
      "entity_id": "entity_n8y8tnk2p9339ti393yi",
      "id": "loan_application_mpe6oe4a2gc5knzl1xfy",
      "idempotency_key": null,
      "parameters": [
        {
          "key": "event_name",
          "value": "Cherry Street Pier Market"
        }
      ],
      "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 $'{
    "amount": 1000000,
    "entity_id": "entity_n8y8tnk2p9339ti393yi",
    "parameters": [
      {
        "key": "event_name",
        "value": "Cherry Street Pier Market"
      }
    ],
    "program_id": "program_i2v2os4mwza1oetokh9i"
  }'
```

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

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

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

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

  - `parameters.value` (string, required)
    The value for the parameter.

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