# Kasir POS

> A phone-first point of sale and back office for Indonesian food and beverage, retail and service businesses, sold on the AgentBuff marketplace, that opens the shop's numbers to the owner's own AI agent.

Small shops lose money quietly: a discount with no reason, a sale voided after the customer paid, a drawer that is a little short at every close, stock nobody counts. Their sales data also sits inside vendor apps where no AI can reach it. Kasir POS runs the cashier, kitchen, tables and stock from a phone, and lets the owner's AI agent read the numbers while a person approves every change.

- Agent tools only create drafts that the owner approves with a PIN; six sale-changing tool names are refused in code.
- Reports come from a deterministic analytics engine with no language model inside, so the numbers repeat exactly.
- The first screen loads about 0.2 MB of JavaScript, down from about 1.1 MB, so it opens fast on a cashier's phone.

- 14 read-only MCP resources for agents
- 6 agent tools, 5 of them draft-only

- Role: Founder & CEO, designer and builder
- Company: AgentBuff
- Period: Since Aug 2026
- Stack: React 18, Vite, TypeScript, Fastify 5, PostgreSQL 16, Drizzle ORM, MCP, OAuth 2.1, Docker Compose, Vitest
- Live app: pos.agentbuff.id (https://pos.agentbuff.id)
- Showcase on GitHub: nugrahalabib/agentbuff-pos-showcase (https://github.com/nugrahalabib/agentbuff-pos-showcase)

## The problem

Small shops lose money in ways nobody sees on the day: a discount given without a reason, a sale voided after the customer has paid, a cash drawer that is a little short at every close, and stock that runs out in the middle of lunch. Most owners find out weeks later, if ever.

Cost of goods is usually a guess, because ingredient prices move from one market trip to the next, so the real margin of a rice bowl or a coffee is unknown. At peak hours the cashier, the kitchen and the tables talk by shouting; orders get lost and guests wait to order. And the point of sale apps these shops use mostly record and display: the owner still reads every report alone, and **the data stays inside the vendor app, where no AI assistant can reach it**.

*What changes in the shop*

| Before | With Kasir POS |
| --- | --- |
| Discounts and voids happen with no reason recorded | Large discounts and voids need a reason and a PIN, and every action lands in an audit trail nobody can edit |
| Cash differences are shrugged off at close | The shift close counts notes by denomination and turns a shortage into a named record to settle |
| Food cost is a guess | Recipes link menu items to ingredients, and cost of goods follows the price paid at the last purchase |
| Orders shouted to the kitchen | Orders reach a live kitchen screen with a timer per ticket |
| Guests wait for a waiter to order | Guests order from a table QR code and pay at the cashier |
| Sales data locked in the app | Any MCP agent can read the shop's numbers with the owner's consent and scoped access |

Kasir POS is the app I built for that shop. It is one web app for the cashier, the kitchen, the tables and the back office, it runs on a phone, tablet or laptop without an install, and it is sold on the [AgentBuff](/work/agentbuff) marketplace. A first cafe customer has used it for daily operations since September 2026.

## Who uses it

*Six users of one shop*

| Who | What they do in Kasir POS |
| --- | --- |
| Owner | Sets up the menu, recipes and staff, reads the daily report and the list of things that need attention, and approves anything an AI agent proposes with a PIN |
| Cashier | Takes orders with options and notes, splits payments across cash, the shop's own QRIS, transfer, card machine or store credit, and opens and closes the cash shift |
| Kitchen and barista | Work from a live kitchen screen, tick items as they are cooked and see which orders are running late |
| Manager | Plans the weekly shifts, checks attendance, records purchases with receipt photos and follows up on cash differences |
| Guest | Scans the QR code on the table, orders from their own phone without installing anything, and pays at the cashier |
| Owner's AI agent | Reads sales, stock, margins and receivables over MCP and drafts reminders, price changes or stock adjustments; it cannot create, void or refund a sale |

## One day in the shop

**A business day in Kasir POS** (Every step is tied to a named person and written to the activity book.)
1. Open the shift: The cashier counts the opening cash by denomination
2. Take the order: At the till or from a table QR code
3. Cook: The kitchen screen ticks items to ready
4. Take payment: Split across cash and the shop's own QRIS
5. Close and report: Count, shortage record, daily report
6. Ask the agent: The agent reads and drafts, the owner approves

The rules sit in the flow, not in a manual. A discount above 10% or above Rp 20.000 needs a reason and a PIN from someone allowed to approve it. A shift cannot close while a purchase still has no receipt photo. The next cashier opens with a count, and any difference from the last close must be explained. Every change to money, stock, staff or settings goes to an append-only activity book that **the owner cannot edit either**.

## Inside the product

**Cashier**
A catalog on the left and a cart on the right. Each order starts with who serves, who the customer is and where the order comes from, so every sale carries that context into the reports. Payment can be split by amount or by item, and the rest can become store credit with a due date for a saved customer. The shop's own static QRIS is confirmed by the cashier, so the app never moves money.

**Kitchen**
Orders from the cashier, saved table orders and table QR orders all reach one live kitchen screen. Cooks tick each item through received, cooking and ready, with an undo for a wrong tap. Items are routed to the kitchen or the bar, and a timer turns a ticket red when it runs past the shop's limit.

*Kitchen screen with a table QR order and a ticket where the drinks are done and the rice bowls are cooking.*

**Table QR**
Each table has its own QR code with a rotating token. A guest opens the menu in the phone browser, picks items and options, gives a name and how they will eat, and sends the order to the kitchen. There is no app to install and no sign in. Payment always happens at the cashier, where the order waits alone or merged with the rest of the table.

*Guest menu from the QR code on table 4.*

**Stock and cost**
Stock is kept as movements, never as an overwritten number. Ingredients carry a unit, a minimum level and the price paid at the last purchase, and a recipe links each menu item to its ingredients, so every product shows its cost of goods and what is left after it. Purchases are recorded as they really happen, with who went, where, how it was paid and a receipt photo, and the app flags a price that is above what the shop usually pays.

**Shifts and reports**
Each cash shift belongs to a named cashier, and a shortage becomes a record against that cashier to be repaid or written off. Managers plan the week in a shift grid and attendance shows lateness against it. The daily report starts with what needs attention, then shows sales, transactions, average ticket, gross profit and peak hours, and a read-only link opens it on the owner's phone, marked as not final while a shift is still open.

## Made for one hand

Many small shops run the till on a phone, so the cashier was designed for a 390 pixel wide screen first: large touch targets, a bottom bar for the most used menus, a cart that opens as a sheet, and a cash keypad with split shortcuts and suggested notes. Only the cart in progress is kept on the device, so a short connection drop does not lose an order.

*Catalog with the order context bar.*

*Cart sheet with options and the pay button.*

*Cash part of a split payment, change calculated.*

Guests and the owner use their own phones too. The table QR menu needs no install and no account, and the owner's daily report opens from a read-only link, so nobody has to be at the till to know how the day went.

*The guest gives a name and how they will eat.*

*The order reached the kitchen; pay at the cashier.*

*The owner's read-only daily report.*

## Agents read, people approve

The whole shop is also an MCP server, so the owner's own AI agent, from AgentBuff or any MCP client, can answer questions like which menu items lost margin this week or who still owes the shop money. The surface is small on purpose, and the line between reading and changing is drawn in code.

*Drafts from the agent waiting for approval, with past decisions below.*

- **14 read-only resources**: sales summary, transactions, margin by product, inventory, customers, receivables and more.
- **6 tools, 5 of them draft-only**: a reminder, a price change or a stock adjustment waits as a draft; the sixth only builds a report.
- **A PIN for every change**: the owner approves or rejects each draft, and an approved draft can run only once.
- **Forbidden in code**: six tool names that would change a sale, such as void or refund, are refused and logged even if an agent asks for them.
- **Data, not instructions**: names and notes from the shop reach the agent as data, and every answer says it comes from store data, not from a language model.

**When the agent proposes a change**
1. The agent calls a draft tool: For example a suggested new price for one product.
2. The server checks: Scope and the store's modules first, then it writes a draft with a readable title and logs the call.
3. The owner decides: The draft waits in the approval queue in the app.
4. Approve with a PIN: The server claims the draft atomically, runs it once and records executed or failed.
5. Everything is logged: Rejections are recorded too, and both outcomes appear in the action log.

## Part of AgentBuff

*Sign in with AgentBuff: the consent screen before entering Kasir POS.*

A new store can only be created by an AgentBuff account that owns the product, through **Sign in with AgentBuff**, an OpenID Connect login. After purchase, AgentBuff requests a normal, revocable MCP token for the owner with a short-lived signed assertion, so the owner's agent is connected without anyone pasting a token.

While the store is in use, the entitlement is checked with a 10 minute cache and a one hour grace period. If access lapses, the store is frozen in read-only form and **the data is never touched**; renewing opens it again on the next check. Staff accounts belong to the store and are not checked against the marketplace.

## How it is built

Two TypeScript packages share one repository: a React single page app built with Vite, and a Fastify API with Drizzle ORM on PostgreSQL. In development and tests the API runs on PGlite, an embedded PostgreSQL, so it starts without any external database.

- The server owns the money: Amounts are integer rupiah, the client never decides a total, and checkout re-prices every line from the catalog.
- One rule, two copies: Money and payment rules exist on both sides and parity tests keep the copies identical.
- Tenant from the session: The store id always comes from the session, never from the request, and every query filters by it.
- Analytics without a model: Alerts and reports come from rules and statistics, so they repeat exactly and carry no inference cost.
- Tokens that expire: Agent tokens are stored as hashes, bound to one store, limited to 120 calls per minute and expire after 90 days.
- Deploys that count rows: The deploy backs up first, counts rows in 13 key tables, and raises an alarm if any table shrank.

*Decisions and why*

| Decision | Why |
| --- | --- |
| Web app, online first | One responsive app for phone, tablet and laptop, with no install |
| No payment gateway | The app records payments and never processes funds; QRIS is the shop's own static code, with no gateway fees |
| Agents read, people approve | Tools only create drafts and every approval needs a PIN, so an agent can never fabricate or erase a sale |
| Purchase orders removed | Shops buy at the market on the day, so real purchases with receipt photos replaced a formal flow nobody used |
| No automatic WhatsApp sending | Receipts and reports are sent by hand when a customer asks, which avoids unwanted messages |

The server has 114 test files that run against a real embedded PostgreSQL, covering tenant isolation, money routes, MCP and the marketplace gate. An automated sweep of 33 routes at two screen widths found no console errors and no failed requests, and loading each menu on demand cut the first-load JavaScript from about 1.1 MB to about 0.2 MB.

**At a glance**
- Product: Point of sale and back office, app on the AgentBuff marketplace
- For: Food and beverage, retail and service businesses in Indonesia
- Live since: August 2026, at pos.agentbuff.id
- In daily use: A first cafe customer, since September 2026
- For AI agents: MCP: 14 resources, 6 tools, 5 prompts, 7 scopes
- Payments: Recorded, never processed

**Run a small cafe or shop?** Kasir POS runs the till from a phone and lets your AI agent read the numbers, while you approve every change.

Source: https://nugrahalabib.com/work/kasir-pos
Author: Nugraha Labib Mujaddid (https://nugrahalabib.com)
Published: 2026-11-27. Updated: 2026-11-27.
