Retail, events, licensing
Inventory and seats
Stock, seats and licences kept under the rules that protect money, because over-allocation is a contractual exposure.
The problem
What goes wrong without a ledger
Selling the same seat twice, shipping stock you do not have and granting more licences than you bought are one defect, a count that was updated in two places. The ledger treats a unit of stock exactly as it treats a unit of money, and that defect cannot occur.
How it works on Ledger
The shape of the books
Stock as an asset type with whole units
Define an item or a seat type with zero decimal places. Accounts represent locations, baskets and customers.
Reserve against a basket
A hold takes the units out of the available count while the customer decides. If checkout never completes, the hold expires and the units come back.
Goods and money in one transaction
A sale moves stock out and money in as one record. Both sides settle together or neither does.
Transfers with a source and a destination
Moving stock between warehouses is a balanced transfer with a source and a destination. The count cannot drift between the two.
POST /v1/transactions # sell two units for 50.00
{
"description": "sale: 2 widgets",
"entries": [
{ "account_id": cash, "direction": "debit", "amount": "50.00" },
{ "account_id": customer, "direction": "credit", "amount": "50.00" },
{ "account_id": stock, "direction": "credit", "amount": "2" },
{ "account_id": shipped, "direction": "debit", "amount": "2" }
]
}
# unbalance either asset and the whole write is refusedWhat you get
Outcomes, and the guarantees behind them
- No seat or unit can be allocated twice.
- Stock on hand is a balance, reconcilable against the physical count.
- A basket that is abandoned returns its units automatically.
Questions
Asked about this use case
Can stock go negative for back-orders?
Only if you give that account a negative floor on purpose, exactly as an overdraft works for money. By default a stock account cannot go below zero.
Free today. Access is provisioned personally by RODMENA.
Tell us what you keep books of and we will set up a tenant, mint your first key and walk you through the tour.