> ## Documentation Index
> Fetch the complete documentation index at: https://pier.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Facilities

> A facility represents an active loan or line of credit. It contains references to the borrower, application and executed loan as well as the terms and other state information about the credit facility. Facilities are used by Pier’s system for servicing, credit reporting and other down stream functionality.

<Card title="Create facility" icon="square-plus" href="/facilities/create-facility">`POST /facilities`</Card>
<Card title="Close facility" icon="square-xmark" href="/facilities/close-facility">`POST /facilities/{facility_id}/close`</Card>
<Card title="Retrieve a facility" icon="magnifying-glass" href="/facilities/retrieve-facility-by-id">`GET /facilities/{facility_id}`</Card>
<Card title="List all facilities" icon="list" href="/facilities/list-facilities">`GET /facilities`</Card>

## Facility Object

### Parameters

<ResponseField name="id" type="string">
  Unique identifier for the facility
</ResponseField>

<ResponseField name="application_id" type="string">
  The application\_id of the corresponding loan application for the facility
</ResponseField>

<ResponseField name="borrower_id" type="string">
  The borrower\_id of the corresponding borrower the facility is for
</ResponseField>

<ResponseField name="loan_agreement_id" type="string">
  The loan\_agreement\_id of the corresponding loan agreement the facility is for
</ResponseField>

<ResponseField name="credit_type" type="string">
  The type of credit product. Can be one of `installment_loan`, `revolving_line_of_credit`, `closed_line_of_credit`
</ResponseField>

<ResponseField name="created_on" type="string">
  Timestamp the loan agreement object is created on
</ResponseField>

<ResponseField name="status" type="enum">
  The status of the facility. Can be one of `active` or `closed`
</ResponseField>

<ResponseField name="terms" type="string">
  An object containing a summary of the terms of the facility. See [LoadOffer](https://www.notion.so/72a5b7a8b07d4bb983ae86a6b32d6696) or [LineOfCreditOffer](https://www.notion.so/72a5b7a8b07d4bb983ae86a6b32d6696) types
</ResponseField>

<Accordion title="Facility object">
  ```json
  {
      "terms": {
          "amount": 2500000,
          "apr": 0,
          "annual_fee": 0,
          "billing_cycle": 30,
          "grace_period": 21,
          "grace_period_interest_rate": 0,
          "interest_rate": 0,
          "late_payment_fee": 0,
          "origination_fee": 0,
          "term": 24,
          "fund_access": [],
          "interest_type": "fixed"
      },
      "id": "fac_7264c6575a894548a386939434b0adf3",
      "application_id": "app_ad1564ffb1d745f9ad482bb5182708e2",
      "borrower_id": "bor_d965bea9f47a4b108562642dbb1dae9f",
      "loan_agreement_id": "doc_234259b117854d0194bc5864a6c45b42",
      "credit_type": "revolving_line_of_credit",
      "status": "active",
      "created_on": "2023-01-17T04:59:21.773Z"
  }
  ```
</Accordion>
