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

# Term loans

A term loan is a fixed amount borrowed up front and repaid over a set term in scheduled installments of principal and interest. Term loans have no transaction feed, so you provide the loan and every repayment through the API.

## Step 1: Create the loan

Create a loan with `loan_type` set to `TERM_LOAN` and disburse the full amount up front with a single `DISBURSEMENT` [proceed](/api-reference/loan/loan#loan-proceed-object). Set `loan_term_months` and an `external_id` so you can reference the loan later without storing Layer's IDs.

```bash Request theme={null}
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/loans \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "loan_type": "TERM_LOAN",
  "external_id": "term-001",
  "display_name": "Equipment term loan",
  "origination_date": "2024-01-15",
  "original_principal": 5000000,
  "loan_term_months": 36,
  "proceeds": [
    {
      "loan_proceed_type": "DISBURSEMENT",
      "amount": 5000000,
      "date": "2024-01-15",
      "method": "ACH"
    }
  ]
}'
```

## Step 2: Record repayments

Each repayment is a [loan payment](/api-reference/loan/loan#loan-payment-object) split into `PRINCIPAL` and `INTEREST`. Unlike MCAs and flex loans, term loans have no `fee_percentage` to derive from, so every loan payment must include explicit `splits`. The interest portion posts to `INTEREST_EXPENSE` by default; override it with the split's `account_identifier`.

### Pre-create scheduled payments (recommended)

If you have an amortization schedule, we recommend creating the future payments up front with `defer_posting` set to `true`. A deferred payment is recorded immediately but is not posted to the ledger until its `date` arrives (or it is paid out), so the books stay accurate as each installment comes due without you having to call back every month.

Create one loan payment per scheduled installment:

```bash Request theme={null}
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/loans/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "loan_external_id": "term-001",
  "external_id": "term-001-2024-02-15",
  "amount": 150000,
  "date": "2024-02-15",
  "defer_posting": true,
  "splits": [
    { "split_type": "PRINCIPAL", "amount": 135000 },
    { "split_type": "INTEREST", "amount": 15000 }
  ]
}'
```

### Record payments as they happen

If you don't have a schedule, create each loan payment when the repayment occurs using the same call with `defer_posting` omitted (it defaults to `false`), so the payment posts to the ledger immediately.
