---
title: "Update a loan"
method: PATCH
path: "/companies/{companyId}/loans/{id}"
tags: ["Loans"]
---

# Update a loan

`PATCH /companies/{companyId}/loans/{id}`

## Request

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

## Request body

- UpdateLoanInput
  - `lender` string
  - `glLoanLiabilityAccountId` string, uuid, nullable
  - `glInterestExpenseAccountId` string, uuid, nullable
  - `glCashAccountId` string, uuid, nullable

## Response `200`

Loan updated

- 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
- `404`: Loan not found
- `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)
