Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
loans
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": "loan-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"
    }
  ]
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "display_name": "<string>",
    "loan_account": {
      "type": "Single_Chart_Account",
      "id": {
        "type": "AccountId",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "name": "Current Assets",
      "account_number": "4000",
      "stable_name": {
        "type": "StableName",
        "stable_name": "CURRENT_ASSETS"
      },
      "account_type": {
        "display_name": "Asset"
      },
      "account_subtype": {
        "display_name": "Current Assets"
      }
    },
    "current_balance": 123,
    "origination_date": "2023-12-25",
    "transaction_tags": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "key": "ExampleTagKey",
        "value": "ExampleTagValue",
        "dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "dimension_display_name": "<string>",
        "value_display_name": "<string>",
        "archived_at": "2023-11-07T05:31:56Z"
      }
    ],
    "external_id": "<string>",
    "original_principal": 123,
    "credit_limit": 123,
    "fee_percentage": "<string>",
    "loan_term_months": 123,
    "completed_at": "2023-11-07T05:31:56Z",
    "cancelled_at": "2023-11-07T05:31:56Z",
    "archived_at": "2023-11-07T05:31:56Z",
    "memo": "<string>",
    "metadata": {},
    "reference_number": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

businessId
string<uuid>
required

The UUID of the business.

Body

application/json

The loan to create.

Parameters for creating a loan. The shape depends on loan_type.

loan_type
enum<string>
required

Discriminator. Must be TERM_LOAN.

Available options:
TERM_LOAN
display_name
string
required

Human-friendly name for the loan.

origination_date
string<date>
required

Date the loan was originated.

original_principal
integer<int64>
required

Original principal of the loan, in cents.

external_id
string | null

Unique ID of the loan in your system for linking purposes.

parent_ledger_account_identifier
Account ID · object

Parent ledger account under which the loan's dedicated liability account is created. Defaults to NOTES_PAYABLE.

loan_term_months
integer<int32> | null

Term of the loan, in months.

proceeds
(Asset proceed · object | Disbursement proceed · object)[] | null

Loan proceeds. Optional. On create, sets the loan's initial proceeds. Because creating with an existing external_id upserts the loan, on a subsequent call this list is reconciled against the loan's existing proceeds by proceed external_id (matched proceeds are updated, existing proceeds that are absent or have no external_id are archived, and new entries are created). Omit the field or set it to null to leave the existing proceeds untouched. Individual proceeds can also be managed with the loan proceed endpoints.

A loan proceed: funds (or an asset) received from the loan.

memo
string | null

Internal note about the loan.

metadata
object

Arbitrary JSON object you can attach for your own use. Layer stores and returns it unchanged.

reference_number
string | null

Reference number for the loan.

Response

201 - application/json

Loan created successfully.

data
object
required

A loan held by a business. Each loan has a dedicated child ledger (liability) account.