---
title: "Point of Sale"
description: "Retail and restaurants. Model a shop till: configuration, cash-controlled sessions, orders with lines and payment lines per method."
canonical: "https://obop-platform.sliplane.app/apps/pos/"
lang: "en"
---

# Point of Sale

## What it is for

Model a shop till: configuration, cash-controlled sessions, orders with lines and payment lines per method. It records what happened at the till; it is not a payment terminal integration, and card numbers must never be stored.

## What the package does and does not do

Shop tills: a point-of-sale configuration, cash-controlled sessions that are opened and closed, orders with lines, and payment lines per method. A refund and the closing of a session need a human approval from a manager; agents may only propose them. Totals, change and cash differences are entered, not computed. Card numbers must never be stored; keep only the payment provider's reference. Needs the Products package.

## Models

### `pos_config`

A point of sale (a till or a shop) and its rules

Read group: `pos.user`. Write group: `pos.manager`.

| Field | Kind | Data class | Personal data | Group | Agents see | Description |
|---|---|---|---|---|---|---|
| `name` | text | `none` | no | `pos.user` | in clear | Name of the till or shop, for example Main street shop |
| `currency` | text | `none` | no | `pos.user` | in clear | ISO 4217 currency code, for example EUR |
| `receipt_header` | longtext | `none` | no | `pos.user` | in clear | Text printed at the top of receipts |
| `cash_control` | bool | `none` | no | `pos.user` | in clear | Whether sessions must count the cash in the drawer when they open and close |
| `default_opening_cash` | money | `none` | no | `pos.user` | in clear | Cash normally left in the drawer overnight (minor currency units) |
| `allow_refunds` | bool | `none` | no | `pos.user` | in clear | Whether cashiers may propose refunds at this point of sale |
| `active` | bool | `none` | no | `pos.user` | in clear | Whether the point of sale is in use |

### `pos_session`

One shift of selling at a point of sale, from opening to closing the cash drawer

Read group: `pos.user`. Write group: `pos.user`.

| Field | Kind | Data class | Personal data | Group | Agents see | Description |
|---|---|---|---|---|---|---|
| `config_id` | ref → pos_config | `none` | no | `pos.user` | in clear | The point of sale the session belongs to |
| `cashier` | text | `internal` | yes | `pos.user` | masked | Name of the cashier who opened the session |
| `opened_on` | date | `none` | no | `pos.user` | in clear | Day the session was opened (YYYY-MM-DD) |
| `closed_on` | date | `none` | no | `pos.user` | in clear | Day the session was closed (YYYY-MM-DD) |
| `opening_cash` | money | `financial` | no | `pos.user` | withheld | Cash counted in the drawer at opening (minor currency units) |
| `expected_cash` | money | `financial` | no | `pos.user` | withheld | Cash the drawer should hold at closing: opening cash plus cash payments (entered, not computed) |
| `closing_cash` | money | `financial` | no | `pos.user` | withheld | Cash actually counted in the drawer at closing |
| `cash_difference` | money | `financial` | no | `pos.user` | withheld | Closing cash minus expected cash; negative means money is missing |
| `note` | longtext | `none` | no | `pos.user` | in clear | Explanation for any cash difference |
| `state` | select (open, closed) | `none` | no | `pos.user` | in clear | Session status: open, closed |

### `pos_order`

A sale rung up at a point of sale

Read group: `pos.user`. Write group: `pos.user`.

| Field | Kind | Data class | Personal data | Group | Agents see | Description |
|---|---|---|---|---|---|---|
| `session_id` | ref → pos_session | `none` | no | `pos.user` | in clear | The session the sale was made in |
| `receipt_number` | text | `none` | no | `pos.user` | in clear | Number printed on the receipt. Free text: packages cannot generate sequences |
| `ordered_on` | date | `none` | no | `pos.user` | in clear | Day of the sale (YYYY-MM-DD) |
| `customer_id` | ref → party | `none` | no | `pos.user` | in clear | The customer, when one was identified |
| `tax_total` | money | `none` | no | `pos.user` | in clear | Tax included in the total (minor currency units) |
| `total` | money | `none` | no | `pos.user` | in clear | Total paid by the customer including tax (minor currency units, entered not computed) |
| `note` | longtext | `none` | no | `pos.user` | in clear | Remark about the sale |
| `state` | select (draft, paid, refunded, cancelled) | `none` | no | `pos.user` | in clear | Sale status: draft, paid, refunded, cancelled |

### `pos_order_line`

One product line of a sale

Read group: `pos.user`. Write group: `pos.user`.

| Field | Kind | Data class | Personal data | Group | Agents see | Description |
|---|---|---|---|---|---|---|
| `order_id` | ref → pos_order | `none` | no | `pos.user` | in clear | The sale the line belongs to |
| `product_id` | ref → product | `none` | no | `pos.user` | in clear | The product sold |
| `description` | text | `none` | no | `pos.user` | in clear | Text shown on the receipt |
| `quantity` | number | `none` | no | `pos.user` | in clear | Units sold |
| `unit_price` | money | `none` | no | `pos.user` | in clear | Price per unit including tax (minor currency units) |
| `discount_bp` | number | `none` | no | `pos.user` | in clear | Discount in basis points: 1000 means 10.00 percent |
| `subtotal` | money | `none` | no | `pos.user` | in clear | Line total after discount (minor currency units, entered not computed) |

### `pos_payment`

A payment received against a sale; a sale may be paid with several methods

Read group: `pos.user`. Write group: `pos.user`.

| Field | Kind | Data class | Personal data | Group | Agents see | Description |
|---|---|---|---|---|---|---|
| `order_id` | ref → pos_order | `none` | no | `pos.user` | in clear | The sale the payment is for |
| `method` | select (cash, card, bank_transfer, voucher, other) | `none` | no | `pos.user` | in clear | How the customer paid: cash, card, bank_transfer, voucher, other |
| `amount` | money | `financial` | no | `pos.user` | withheld | Amount paid with this method (minor currency units) |
| `paid_on` | date | `none` | no | `pos.user` | in clear | Day of the payment (YYYY-MM-DD) |
| `provider_reference` | text | `financial` | yes | `pos.user` | withheld | Reference from the card terminal or payment provider; never a card number |

## Workflows

### `pos_session`

| Action | Moves | Who may run it | Approval |
|---|---|---|---|
| `pos_session.close` | state: open → closed | `pos.manager` | yes |

### `pos_order`

| Action | Moves | Who may run it | Approval |
|---|---|---|---|
| `pos_order.pay` | state: draft → paid | `pos.user` | no |
| `pos_order.cancel` | state: draft → cancelled | `pos.user` | no |
| `pos_order.refund` | state: paid → refunded | `pos.manager` | yes |

## Permission groups

Groups used by this app:

- `pos.manager`
- `pos.user`

## Approval steps

Steps an agent can only propose:

- `pos_session.close`
- `pos_order.refund`

## What agents can and cannot do

An agent can read, search, create and update records of this app, and run the actions that need no approval, within the permission groups of its token.

It can only propose these steps, and a person must approve them: `pos_session.close`, `pos_order.refund`, `pos_config.delete`, `pos_session.delete`, `pos_order.delete`, `pos_order_line.delete`, `pos_payment.delete`.

Personal data is masked as placeholder tokens: `pos_session.cashier`.

These fields are withheld from agents entirely: `pos_session.opening_cash`, `pos_session.expected_cash`, `pos_session.closing_cash`, `pos_session.cash_difference`, `pos_payment.amount`, `pos_payment.provider_reference`.

## Dependencies

- `base`
- `product`

## Install

Install it from the Customize app (Marketplace), or from the command line:

```bash
obop modules install-from pos
```

Needs a database and administrator rights.

## Build your own

[The module guide shows how apps like this one are written](/docs/reference/module-manifest/)
