Complex funds flows are built from common building blocks. Learn how to model these core flows in FRAGMENT.
A platform facilitates a transaction between a customer and a restaurant. The customer pays the platform, which then pays out to the restaurant.
When the customer places an order, an Entry records two lines: a payable to the restaurant and funds in the cash account.
The payout moves funds out of the platform to the restaurant.
The platform charges a fee for facilitating the transaction between customer and restaurant. The fee is recorded as income.
The platform pays the card network a fee for processing the payment, which the platform records as an expense.
A $25 order becomes $20 to the restaurant, $5 fee income, and $1 expense. The total held by the platform is $25 minus $1.
In reality, money movements are not instant. Pay ins and pay outs take a few days to settle.
When the process starts, an Initiate entry records a new receivable or payable. When the funds arrive, a Settle Entry moves the funds out of the receivable or payable account.
Clearing Accounts handle these transitory balances.
To reduce fees on payouts, the platform consolidates multiple orders to the same restaurant into a single payout.
In this example, a restaurant receives two different orders.
Both orders are consolidated into a single payout through a bulk initiate Entry.
Orders placed through the same card network arrive as a bulk payin.
The platform must reconcile the bulk payment, their bank balance, and the balance in Fragment.
A bulk payment arrives into the Linked Account.
The platform subdivides the bulk payin into the corresponding order receivables.
The restaurant charges €18. The platform charges the customer $20 priced against a projected exchange rate.
The USD payment and Euro payable are balanced through corresponding lines in the income account.
The payout to the restaurant leaves an €18 deficit.
The platform sells $18.90 of cash to buy €18 at a 1.05 rate. The platform keeps the $1.10 spread as income.
The platform offers a loan service to cover operating costs for restaurants.
Disbursing the loan moves money out of the cash account into the loan receivable.
On repayment, the loan receivable is cleared, an income line is added for interest, and the cash account is replenished.
This section is models a peer-to-peer payments app instead of the marketplace.
Each user’s wallet balance is held in a liability account.
A user funds their wallet using ACH.
When one user pays another, the platform records a book transfer, moving the funds between the two wallets.
When a user withdraws, the platform initiates an ACH payout, marking the funds as pending, and takes a fee.
Ready to build? Follow the Quickstart to create your first ledger and post an entry.