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

# Loan object

A Loan represents financing a Business has taken on: a term loan, line of credit, lease, equipment financing, or merchant cash advance. Creating a loan opens a dedicated liability account in the Business's ledger (under `NOTES_PAYABLE` by default), and records the proceeds and repayments against it.

A loan is made up of three related concepts:

* **Proceeds**: the funds (or assets) received when the loan is drawn. A proceed is either a cash **disbursement** or an **asset** that the loan financed (for example, financed equipment). See the [Loan Proceed object](#loan-proceed-object).
* **Payments**: repayments made against the loan, each split into **principal**, **interest**, and **fee** portions. See the [Loan Payment object](#loan-payment-object).
* **Ledger account**: the dedicated liability account Layer maintains for the loan, exposed as `loan_account`.

### Attributes

<ParamField body="id" type="string" required="true">
  Unique identifier for the loan.
</ParamField>

<ParamField body="business_id" type="string" required="true">
  ID of the Business that holds the loan.
</ParamField>

<ParamField body="external_id" type="string">
  Unique ID of the loan in your system for linking purposes.
</ParamField>

<ParamField body="display_name" type="string" required="true">
  Human-friendly name for the loan.
</ParamField>

<ParamField body="loan_type" type="enum" required="true">
  The type of loan. Values can be: `TERM_LOAN`, `MCA`, `FLEX_LOAN`, `LINE_OF_CREDIT`, `LEASE`, `EQUIPMENT_FINANCING`
</ParamField>

<ParamField body="loan_account" type="ChartAccount object" required="true">
  The dedicated ledger (liability) account for this loan.
</ParamField>

<ParamField body="current_balance" type="integer" required="true">
  Current outstanding balance of the loan, in cents.
</ParamField>

<ParamField body="opening_balance" type="Loan Opening Balance object">
  The loan's active opening balance, if one has been set: pre-existing debt recorded against Opening Balance Equity rather than explained by recorded proceeds and payments. Contains `ledger_account_id`, `ledger_account_name`, `balance` (in cents), `effective_at`, `created_at`, `updated_at`, `transaction_tags`, `memo`, `metadata`, and `reference_number`. See [Backfilling existing loans](/guides/loans/backfilling-existing-loans).
</ParamField>

<ParamField body="origination_date" type="ISO8601 date" required="true">
  Date the loan was originated.
</ParamField>

<ParamField body="original_principal" type="integer">
  Original principal, in cents. Present for `TERM_LOAN`, `MCA`, `FLEX_LOAN`, `LEASE`, and `EQUIPMENT_FINANCING`.
</ParamField>

<ParamField body="credit_limit" type="integer">
  Credit limit, in cents. Present for `LINE_OF_CREDIT`.
</ParamField>

<ParamField body="fee_percentage" type="string">
  Fixed fee, expressed as a percentage in a decimal string (for example, `"15"` for a 15% fee). Present for `MCA` and `FLEX_LOAN`.
</ParamField>

<ParamField body="loan_term_months" type="integer">
  Loan term in months. Present for `TERM_LOAN`, `LEASE`, and `EQUIPMENT_FINANCING`.
</ParamField>

<ParamField body="completed_at" type="ISO8601 timestamp">
  When the loan was fully repaid, if applicable.
</ParamField>

<ParamField body="cancelled_at" type="ISO8601 timestamp">
  When the loan was cancelled, if applicable.
</ParamField>

<ParamField body="archived_at" type="ISO8601 timestamp">
  When the loan was archived, if applicable.
</ParamField>

<ParamField body="memo" type="string">
  Internal note about the loan.
</ParamField>

<ParamField body="metadata" type="object">
  Arbitrary JSON object you can attach for your own use. Layer stores and returns it unchanged.
</ParamField>

<ParamField body="reference_number" type="string">
  Reference number for the loan.
</ParamField>

<ParamField body="transaction_tags" type="array of Tag objects">
  Tags applied to this loan.
</ParamField>

## Loan Proceed object

A Loan Proceed represents funds (or an asset) received when a loan is drawn. A proceed is one of two types:

* **`DISBURSEMENT`**: a cash disbursement, received via a `method` such as ACH or check.
* **`ASSET`**: an asset the loan financed (for example, financed equipment). The funded asset is referenced by `asset_id`.

Proceeds can be supplied inline when you [create](/api-reference/v1/loans/create-loan) or [update](/api-reference/v1/loans/update-loan) a loan, or managed individually with the loan proceed endpoints: [list](/api-reference/v1/loans/list-loan-proceeds), [create](/api-reference/v1/loans/create-loan-proceed), [fetch](/api-reference/v1/loans/fetch-loan-proceed), [update](/api-reference/v1/loans/update-loan-proceed), and [archive](/api-reference/v1/loans/archive-loan-proceed).

### Attributes

<ParamField body="id" type="string" required="true">
  Unique identifier for the loan proceed.
</ParamField>

<ParamField body="business_id" type="string" required="true">
  ID of the Business that holds the loan.
</ParamField>

<ParamField body="external_id" type="string">
  Unique ID of the proceed in your system for linking purposes.
</ParamField>

<ParamField body="loan_id" type="string" required="true">
  ID of the loan this proceed belongs to.
</ParamField>

<ParamField body="loan_proceed_type" type="enum" required="true">
  How the proceeds were received. Values can be: `ASSET`, `DISBURSEMENT`
</ParamField>

<ParamField body="method" type="enum" required="true">
  Payment method used for the proceed. Values can be: `CASH`, `CHECK`, `CREDIT_CARD`, `ACH`, `CREDIT_BALANCE`, `OTHER`
</ParamField>

<ParamField body="amount" type="integer" required="true">
  Proceed amount, in cents.
</ParamField>

<ParamField body="asset_id" type="string">
  ID of the asset funded by this proceed. Present for `ASSET` proceeds.
</ParamField>

<ParamField body="date" type="ISO8601 date" required="true">
  Date the proceed was received.
</ParamField>

<ParamField body="archived_at" type="ISO8601 timestamp">
  When the proceed was archived, if applicable.
</ParamField>

<ParamField body="memo" type="string">
  Internal note about the proceed.
</ParamField>

<ParamField body="metadata" type="object">
  Arbitrary JSON object you can attach for your own use.
</ParamField>

<ParamField body="reference_number" type="string">
  Reference number for the proceed.
</ParamField>

<ParamField body="transaction_tags" type="array of Tag objects">
  Tags applied to this proceed.
</ParamField>

## Loan Payment object

A Loan Payment is a repayment made against a loan. Each payment is broken into one or more **splits** by type (`PRINCIPAL`, `INTEREST`, `FEE`), and the splits must sum to the payment `amount`. Payments can optionally be **deferred**: recorded but not posted to the ledger until they are paid out or their due date is reached.

### Attributes

<ParamField body="id" type="string" required="true">
  Unique identifier for the loan payment.
</ParamField>

<ParamField body="business_id" type="string" required="true">
  ID of the Business that made the payment.
</ParamField>

<ParamField body="external_id" type="string">
  Unique ID of the payment in your system for linking purposes.
</ParamField>

<ParamField body="loan_id" type="string" required="true">
  ID of the loan this payment applies to.
</ParamField>

<ParamField body="splits" type="array of LoanPaymentSplit objects" required="true">
  The principal, interest, and fee splits that make up this payment. The split amounts sum to `amount`.

  <Expandable title="LoanPaymentSplit properties">
    <ResponseField name="id" type="string" required="true">
      Unique identifier for the split.
    </ResponseField>

    <ResponseField name="external_id" type="string">
      Unique ID of the split in your system for linking purposes.
    </ResponseField>

    <ResponseField name="split_type" type="enum" required="true">
      The portion of the payment this split applies to. Values can be: `PRINCIPAL`, `INTEREST`, `FEE`
    </ResponseField>

    <ResponseField name="amount" type="integer" required="true">
      Split amount, in cents.
    </ResponseField>

    <ResponseField name="account" type="Account Identifier" required="true">
      The ledger account this split posted to.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="amount" type="integer" required="true">
  Total payment amount, in cents.
</ParamField>

<ParamField body="date" type="ISO8601 date" required="true">
  Date of the payment.
</ParamField>

<ParamField body="defer_posting" type="boolean" required="true">
  Whether posting to the ledger is deferred.
</ParamField>

<ParamField body="method" type="enum" required="true">
  Payment method. Values can be: `CASH`, `CHECK`, `CREDIT_CARD`, `ACH`, `CREDIT_BALANCE`, `OTHER`
</ParamField>

<ParamField body="processor" type="string">
  Payment processor, if any.
</ParamField>

<ParamField body="payment_clearing_account" type="ChartAccount object">
  The clearing account used for the payment, if any.
</ParamField>

<ParamField body="archived_at" type="ISO8601 timestamp">
  When the payment was archived, if applicable.
</ParamField>

<ParamField body="memo" type="string">
  Internal note about the payment.
</ParamField>

<ParamField body="metadata" type="object">
  Arbitrary JSON object you can attach for your own use.
</ParamField>

<ParamField body="reference_number" type="string">
  Reference number for the payment.
</ParamField>

<ParamField body="transaction_tags" type="array of Tag objects">
  Tags applied to this payment.
</ParamField>
