Merchant financing
A lending or BNPL platform advances $10,000.00 to a merchant, withholds a $200.00 fee and pays out $9,800.00. The merchant then makes monthly repayments of $1,100.00, made up of $1,000.00 principal and $100.00 interest.
These are the merchant's books, kept in the merchant's Paprel company. They are not your loan book. To the merchant, the loan is a debt and only the interest and fees are costs.
How loans get misrecorded
| Mistake | Effect | Instead |
|---|---|---|
| Credit income with the $9,800.00 received | Revenue is overstated and the debt is missing | Credit a loan liability |
| Record the $9,800.00 payout as the loan amount | The debt is understated by $200.00 | Credit the full $10,000.00 and record the fee |
| Expense the full $1,100.00 repayment | Expenses are overstated and the debt never falls | Split principal and interest |
| Post a repayment only when the bank feed shows it | Deductions taken from settlements can be missed | Post from your repayment events |
| Record the amount left after a deduction as revenue | Sales, fees and the repayment all disappear from view | Record the sale at gross and split the settlement |
The split in each repayment must come from your loan system, using the same figures as the merchant's statement. Do not estimate it.
Before you start
Working in your own language? These samples use plain HTTP. You can generate a typed Partner API client from openapi-partner.json with the same generators; see SDKs and client libraries.
Complete Your first accounting entry first. You need a provisioned company and a session whose permissions allow account and journal writes.
export BASE="https://api.paprel.com"
export AUTH="authorization: Bearer $SESSION_TOKEN"
export PARTNER="x-partner-domain: $PARTNER_DOMAIN"
export CT="content-type: application/json"
1. Set up the accounts
Read the company's chart with GET /v1/accounting/accounts, and reuse existing accounts where they fit. Create what is missing with POST /v1/accounting/accounts, and store each returned data.id with the merchant record. Account ids differ between companies.
| Account | Type |
|---|---|
| Bank Account | Asset |
| Payment Gateway Clearing | Asset |
| Sales Revenue | Income |
| Transaction Fee Expense | Expense |
| Financing Loan Payable | Liability; use an ordinary liability account, not a system control account |
| Financing Fees | Expense |
| Interest Expense | Expense |
Use one loan account per facility if the merchant needs each balance on its own.
2. Record the disbursement
Credit the full amount the merchant owes, not the amount that reached the bank:
| Account | Debit | Credit |
|---|---|---|
| Bank Account | $9,800.00 | — |
| Financing Fees | $200.00 | — |
| Financing Loan Payable | — | $10,000.00 |
curl -X POST "$BASE/v1/accounting/journals" \
-H "$AUTH" -H "$PARTNER" -H "$CT" \
-d '{
"date": "2026-11-02",
"currency": "USD",
"reference": "LOAN-5001",
"description": "Financing LOAN-5001 disbursed",
"posted": true,
"lines": [
{ "account_id": "<Bank Account id>", "description": "Net amount received", "debit": "9800.00" },
{ "account_id": "<Financing Fees id>", "description": "Processing fee withheld", "debit": "200.00" },
{ "account_id": "<Financing Loan Payable id>", "description": "Loan principal owed", "credit": "10000.00" }
],
"meta_data": { "root_entity_type": "loan_disbursement", "root_entity_id": "LOAN-5001" }
}'
This expenses the fee when it is charged. Some accounting policies spread it over the loan term, so confirm the treatment with the merchant's accountant.
3. Record a repayment
| Account | Debit | Credit |
|---|---|---|
| Financing Loan Payable | $1,000.00 | — |
| Interest Expense | $100.00 | — |
| Bank Account | — | $1,100.00 |
curl -X POST "$BASE/v1/accounting/journals" \
-H "$AUTH" -H "$PARTNER" -H "$CT" \
-d '{
"date": "2026-12-02",
"currency": "USD",
"reference": "LOAN-5001-R01",
"description": "LOAN-5001 repayment 1",
"posted": true,
"lines": [
{ "account_id": "<Financing Loan Payable id>", "description": "Principal repaid", "debit": "1000.00" },
{ "account_id": "<Interest Expense id>", "description": "Interest charged", "debit": "100.00" },
{ "account_id": "<Bank Account id>", "description": "Repayment paid", "credit": "1100.00" }
],
"meta_data": { "root_entity_type": "loan_repayment", "root_entity_id": "LOAN-5001-R01", "related_entity_type": "loan_disbursement", "related_entity_id": "LOAN-5001" }
}'
4. Deduct a repayment from a settlement
If you also process the merchant's payments, you may collect repayments from their settlements. Record the $100.00 sale and $2.00 fee as shown in Sales, fees and settlements. From the $98.00 due, you then withhold a $10.00 repayment, made up of $9.00 principal and $1.00 interest, and pay $88.00 to the bank. Clear the full $98.00, and split where it went:
| Account | Debit | Credit |
|---|---|---|
| Bank Account | $88.00 | — |
| Financing Loan Payable | $9.00 | — |
| Interest Expense | $1.00 | — |
| Payment Gateway Clearing | — | $98.00 |
curl -X POST "$BASE/v1/accounting/journals" \
-H "$AUTH" -H "$PARTNER" -H "$CT" \
-d '{
"date": "2026-12-05",
"currency": "USD",
"reference": "STL-20261205",
"description": "Settlement STL-20261205 with LOAN-5001 deduction",
"posted": true,
"lines": [
{ "account_id": "<Bank Account id>", "description": "Net settlement received", "debit": "88.00" },
{ "account_id": "<Financing Loan Payable id>", "description": "Principal deducted", "debit": "9.00" },
{ "account_id": "<Interest Expense id>", "description": "Interest deducted", "debit": "1.00" },
{ "account_id": "<Payment Gateway Clearing id>", "description": "Settlement STL-20261205", "credit": "98.00" }
],
"meta_data": { "root_entity_type": "gateway_settlement", "root_entity_id": "STL-20261205", "related_entity_type": "loan_disbursement", "related_entity_id": "LOAN-5001" }
}'
Revenue stays at the gross $100.00 and clearing returns to zero. The merchant's bank statement shows $88.00, so match that deposit to this journal rather than categorising it as income.
5. Verify the books
Find a repayment's journal from your own id:
curl --get "$BASE/v1/accounting/journals/for-entity" \
-H "$AUTH" -H "$PARTNER" \
--data-urlencode 'entity_type=loan_repayment' \
--data-urlencode 'entity_id=LOAN-5001-R01' \
| jq '.data[] | {anchor_id, identifier, is_posted}'
Then check the balances:
curl --get "$BASE/v1/reports/trial-balance" \
-H "$AUTH" -H "$PARTNER" \
--data-urlencode 'date=2026-12-05' \
| jq '.data.trial_balance[] | {account_name, debit, credit, balance}'
After these steps, assuming no other activity, expect:
| Account | Debit | Credit |
|---|---|---|
| Financing Loan Payable | — | $8,991.00 |
| Bank Account | $8,788.00 | — |
| Payment Gateway Clearing | — | — |
| Sales Revenue | — | $100.00 |
| Transaction Fee Expense | $2.00 | — |
| Financing Fees | $200.00 | — |
| Interest Expense | $101.00 | — |
The loan balance should equal the outstanding principal on your loan statement. Reconcile the two at least monthly, and investigate any difference.
Production notes
Retries. Paprel does not deduplicate journals. Record each loan event in your own database before posting, and keep at most one request in flight for each. After an ambiguous timeout, follow the journal retry rule; do not resend automatically.
Interest timing. Posting interest on repayment is simple, but interest may need accruing at period end when a repayment falls in the next period. Agree this with the merchant's accountant.
Late fees and write-offs. Post late fees as a separate expense and credit the amount owed. Treat restructuring and waivers as separate events, with the merchant's accountant confirming the treatment.
Early settlement. Post the final payment with the same split, then confirm the loan balance is zero.
Scope. This guide covers the merchant's bookkeeping only. It does not cover your own loan accounting, or lending or regulatory requirements.
Before launch, work through the production checklist.