---
title: "Create a loan (auto-generates amortization schedule)"
method: POST
path: "/companies/{companyId}/loans"
tags: ["Loans"]
---

# Create a loan (auto-generates amortization schedule)

`POST /companies/{companyId}/loans`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/loans`
- Auth: HTTP bearer

## Request body

- CreateLoanInput
  - `lender` string, required
  - `originalAmountCents` integer, required
  - `startDate` string, date, required
  - `interestRateBps` integer, required
  - `termMonths` integer, required
  - `currency` string
  - `glLoanLiabilityAccountId` string, uuid
  - `glInterestExpenseAccountId` string, uuid
  - `glCashAccountId` string, uuid

## Response `201`

Loan created

- LoanResponse
  - `success` boolean
  - `data` Loan
    - `id` string, uuid
    - `companyId` string, uuid
    - `lender` string
    - `originalAmountCents` integer
    - `currency` string
    - `startDate` string, date
    - `interestRateBps` integer: Interest rate in basis points (500 = 5%)
    - `termMonths` integer
    - `monthlyPaymentCents` integer: Computed from PMT formula
    - `maturityDate` string, date: Computed from startDate + termMonths
    - `glLoanLiabilityAccountId` string, uuid, nullable
    - `glInterestExpenseAccountId` string, uuid, nullable
    - `glCashAccountId` string, uuid, nullable
    - `createdAt` string, date-time

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `422`: Validation error

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
