Concepts
Each page of this documentation uses the terms on this page. Read this page first.
Organisation and business
An organisation is your account in Miridia. It holds your data, your users, your API keys, and your subscription. Miridia keeps the data of each organisation separate from all other organisations.
A business is a trading entity in an organisation. It has its own customers, products, locations, orders, and stock. Most organisations have one business. A group of companies, or a franchise, can have more than one.
- To register a new organisation, send
POST /api/organizationsto the Global API. This also creates the first business and the first user. - To add a business to an organisation that exists, send
POST /api/businessto the Core API.
A business can be a sub-business of a master business. Read Business hierarchy.
Users, roles, and API keys
A user is a person who logs in. One user can be a member of more than one organisation. A user has a role in each business, and the role gives permissions for each module. Read Users and roles.
An API key lets a system call Miridia without a person. An API key belongs to one organisation and acts for one business. You can revoke it at any time. Read Authentication.
Location
A location is a physical place where the business operates: a warehouse, a storefront, a factory, or an office. Stock, transfers, receipts, production, and price lists all refer to a location. One location is the default for the business. Read Locations.
Product
A product is each item that Miridia tracks. A product has a type: a finished good, a raw material, a component, a consumable, or a service. The type decides where the product can appear. For example, a raw material is purchasable but not sellable. Read Products.
The three order types
Miridia has exactly three order types. Each other process is a status of one of these orders.
| Order type | Direction | Does ownership change? | Financial effect |
|---|---|---|---|
| Sales order | From you to a customer | Yes | Revenue |
| Purchase order | From a supplier to you | Yes | Spend |
| Transfer order | From one of your locations to another | No | Stock moves at cost |
Two rules follow from this model:
- A branch that requests stock from a warehouse makes a transfer order with the status
Requested. The request is not a separate document. - A franchisee that buys stock from the head office is a customer. That is a sales order, not a transfer order.
The movement ledger
Miridia does not store a stock count on the product. Each change to stock is a movement, for example a purchase, a sale, a transfer, an adjustment, or a production run. Each movement records the quantity, the balance after the change, and the document that caused it.
The ledger is append-only. You cannot edit or delete a movement. To correct an error, you add a new movement with a reason. Thus the ledger is a full audit record. Read Inventory.
Workflows and events
When something occurs in Miridia, for example an order is created, Miridia raises an event. A workflow subscribes to an event and runs in a workflow engine, for example n8n. Thus you can add behaviour to Miridia without a change to Miridia. Read Workflows.