Skip to main content
POST
Create a loan payment

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.

included_in_opening_balance
boolean
default:false

Set to true when recording a historical payment that the loan's opening balance already reflects. The payment must be dated before the opening balance's effective_at (its date is evaluated as midnight US Eastern time at the start of the day). Layer increases the opening balance by the payment's principal portion and moves the opening balance's effective_at back to the payment date, so the explicit record replaces what the opening balance implied and the loan's balance is unchanged. Without this flag, payments dated before the opening balance's effective_at are rejected with a 400. Sending the flag when the loan has no active opening balance, or when the event is not dated before it, also fails with a 400.

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 | null

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.