Browse documentation

On this page

Partner APIAPI contract v1.1.0

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

MistakeEffectInstead
Credit income with the $9,800.00 receivedRevenue is overstated and the debt is missingCredit a loan liability
Record the $9,800.00 payout as the loan amountThe debt is understated by $200.00Credit the full $10,000.00 and record the fee
Expense the full $1,100.00 repaymentExpenses are overstated and the debt never fallsSplit principal and interest
Post a repayment only when the bank feed shows itDeductions taken from settlements can be missedPost from your repayment events
Record the amount left after a deduction as revenueSales, fees and the repayment all disappear from viewRecord 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

Complete Your first accounting entry first. You need a provisioned company and a session whose permissions allow account and journal writes.

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

AccountType
Bank AccountAsset
Payment Gateway ClearingAsset
Sales RevenueIncome
Transaction Fee ExpenseExpense
Financing Loan PayableLiability; use an ordinary liability account, not a system control account
Financing FeesExpense
Interest ExpenseExpense

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:

AccountDebitCredit
Bank Account$9,800.00—
Financing Fees$200.00—
Financing Loan Payable—$10,000.00
Shell
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

AccountDebitCredit
Financing Loan Payable$1,000.00—
Interest Expense$100.00—
Bank Account—$1,100.00
Shell
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:

AccountDebitCredit
Bank Account$88.00—
Financing Loan Payable$9.00—
Interest Expense$1.00—
Payment Gateway Clearing—$98.00
Shell
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:

Shell
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:

Shell
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:

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

Evaluate Paprel

Build in sandbox, launch with a production trial

Use sandbox for developer testing with no billing. When you are ready for real workflows, start production on a monthly plan with a 14-day free trial.

API-First Delivery
Audit-Ready Controls
Sandbox And Guided Rollout
We use cookies to improve your experience.

We use cookies and local storage for essential settings and, with your choices, analytics and advertising. Online identifiers and activity can be personal data. You can reject optional categories or change your choices.

These cookies are necessary for the basic functionality of the website, ensuring a seamless user experience. They cannot be disabled.