Step 1: Create the loan
Create a loan withloan_type set to MCA, and disburse the full advance immediately by including a single DISBURSEMENT proceed for the whole amount. Set an external_id so you can reference the loan later without storing Layer’s IDs.
The fee_percentage is the fixed fee expressed as a percentage (for example, "15" for a 15% fee on a $20,000 advance).
Request
Step 2: Record repayments
MCA repayments are typically withheld from the business’s incoming sales, so each repayment reduces the outstanding principal and includes a portion of the fee. Each repayment is a loan payment split intoPRINCIPAL and FEE. For MCAs you can omit the payment’s splits and Layer derives them from the loan’s fee_percentage (principal = amount / (1 + fee_percentage / 100), fee = remainder); provide explicit splits to override. How you create those loan payments depends on the granularity of your data.
If you have payment-level granularity
If you know how much was withheld for each individual sale, attach the repayment to that invoice payment as aLOAN_REPAYMENT additional fee when you record the payment. Layer creates the linked loan payment and ties the two together.
In the example below, a customer pays a $1,150.00 invoice and the MCA provider withholds $150.00 of it to repay the advance, so the business nets $1,000.00. Because the loan is an MCA, splits are omitted and Layer derives the principal and fee from the loan’s fee_percentage.
Request
If you have payout-level granularity
If you only know repayment totals at the payout level, create the loan payment(s) directly with Create a loan payment, then reference them when you create the payout they were deducted from. First, create the loan payment with anexternal_id you can reference. As above, splits are omitted so Layer derives the principal and fee from the loan’s fee_percentage:
Request
loan_payments. The MCA repayment reduces the amount deposited: here $5,000.00 of sales were collected and $1,150.00 was withheld for the advance, so paid_out_amount is $3,850.00.
Request