Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
loans
/
payments
Create a loan payment
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/loans/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "loan_id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
  "external_id": "loan-pmt-001",
  "amount": 150000,
  "date": "2024-02-15",
  "splits": [
    {
      "split_type": "PRINCIPAL",
      "amount": 120000
    },
    {
      "split_type": "INTEREST",
      "amount": 30000
    }
  ],
  "method": "ACH"
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "loan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "splits": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "amount": 123,
        "account": {
          "type": "AccountId",
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        },
        "external_id": "<string>"
      }
    ],
    "amount": 123,
    "date": "2023-12-25",
    "defer_posting": true,
    "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>",
    "processor": "<string>",
    "payment_clearing_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"
      }
    },
    "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 payment to create.

Parameters for recording a loan payment. Provide exactly one of loan_id or loan_external_id to identify the loan.

amount
integer<int64>
required

Total payment amount, in cents. Must equal the sum of the splits.

date
string<date>
required

Date of the payment.

loan_id
string<uuid> | null

ID of the loan being paid. Provide this or loan_external_id.

loan_external_id
string | null

External ID of the loan being paid. Provide this or loan_id.

external_id
string | null

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

splits
object[] | null

Breakdown of the payment into principal, interest, and fee portions. Optional for MCA and flex loans: when omitted, Layer derives a PRINCIPAL/FEE split from the loan's fee_percentage (principal = amount / (1 + fee_percentage / 100), fee = remainder). Required for all other loan types. Provide explicit splits to override the derived ones.

defer_posting
boolean
default:false

If true, the payment is recorded but not posted to the ledger until it is paid out or its due date is reached.

method
enum<string>
default:OTHER

Payment method. Defaults to OTHER.

Available options:
CASH,
CHECK,
CREDIT_CARD,
ACH,
CREDIT_BALANCE,
OTHER
processor
string | null

Payment processor, if any (e.g. stripe).

payment_clearing_account_identifier
Account ID · object

Override the clearing account used for the payment. Defaults based on method.

memo
string | null

Internal note about the payment.

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

Response

201 - application/json

Loan payment created successfully.

data
object
required

A payment made against a loan, broken down into principal, interest, and fee splits.