> ## Documentation Index
> Fetch the complete documentation index at: https://muveya.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and track orders

> Request supplies for one of your locations, submit the order and follow it from draft to closed.

An order asks for supplies to be delivered to a warehouse of one of your locations. It starts as a **draft** that only you, the requester, can edit. When you submit it, the [approval policy](/docs/en/orders/approval-policy) decides whether someone has to approve it; after that, the delivery team reserves stock, prepares it, dispatches it and the location receives it.

This page covers the **Orders** screens: the list (`console.muveya.com/orders`), **New order** (`/orders/new`) and the order detail (`/orders/<orderId>`).

<Note>
  In the order screens the location is labeled **Clinic** (column, field and fact). It is the same thing the main navigation calls a **Location**. See [Concepts](/docs/en/concepts).
</Note>

## Who can do what

| What you want to do | Permission you need (label in **Team**) |
| - | - |
| See **Orders** in the main navigation | Any of `orders.create`, `orders.read.all`, `approvals.decide`, `fulfillment.pick`, `fulfillment.dispatch`, `delivery.confirm`, `receipt.confirm`, `fulfillment.close`, `fulfillment.read` |
| Create a general order, add and change its supplies, submit it, cancel it | `orders.create` (**Create supply orders**) |
| Create a clinical order with a patient reference | `orders.create` **and** `orders.clinical.create` (**Create clinical orders**) |
| See every order of your locations, not only your own | `orders.read.all` (**View all orders**), or `approvals.decide`, or any delivery permission |
| See the **Order value** | `orders.value.read` (**View order values**) |
| See the **Patient reference** of a clinical order | `orders.patient_ref.read` (**View external patient references**) |

None of these permissions comes with a role: an **Owner** or an **Administrator** also needs them granted explicitly. Location access applies on top: you can only order for a location assigned to you, deliver to a warehouse assigned to you, and see orders of your assigned locations. See [Roles and permissions](/docs/en/account/roles-and-permissions).

Only the person who created an order can edit, submit or cancel it. Nobody else can, whatever their permissions.

## Which orders you see

The server decides which orders appear in your list and which ones you can open:

| Your permissions | Orders you see |
| - | - |
| `orders.read.all`, `approvals.decide` or any delivery permission | Every order whose location is assigned to you |
| Only `orders.create` | Only the orders you requested, in locations assigned to you |
| None of the above | None: the list is refused with **Your account does not have permission for this action.** |

If you open an order you are not allowed to see, the console answers exactly as if it did not exist: **This order does not exist or you cannot see it.**

## The Orders list

Open **Orders** in the main navigation. The screen is titled **Orders** and lists orders newest first, 25 at a time; **Load more orders** brings the next page.

| Column | What it shows |
| - | - |
| **Order** | The order number, for example `#42`. It opens the order detail. Numbers are sequential within your dental clinic. |
| **Status** | The current status (see [Order statuses](#order-statuses)). |
| **Type** | **General** or **Clinical**. |
| **Clinic** | The location the order is for. |
| **Deliver to** | The destination warehouse. |
| **Requested by** | The requester by name, or **You** for your own orders. |
| **Created** | Creation date and time. |

The **Show** selector narrows the list:

| Option | Statuses included |
| - | - |
| **All orders** | Every status |
| **Drafts** | `draft` |
| **Waiting for approval** | `submitted`, `pending_approval`, `approved` |
| **To prepare** | `allocated`, `picking` |
| **On the way** | `dispatched`, `delivered` |
| **Received** | `received`, `partially_fulfilled`, `closed` |
| **Delivery problems** | `exception` |
| **Rejected or cancelled** | `rejected`, `cancelled` |

When the list is empty you see **No orders here. You see the orders you requested, or those of your clinics if you approve, prepare or receive them.** If no location is assigned to you, you see **You have no locations assigned. Ask an administrator for access.**

On **Home**, the **Pending work** section shows an **Order drafts** card when you have drafts waiting to be submitted.

## Create an order

### Before you start

* The location must be active and have at least one active warehouse that belongs to it. See [Locations](/docs/en/locations/clinics) and [Warehouses](/docs/en/locations/warehouses).
* The supplies must be active in the catalog, with their unit fixed. See [Supplies](/docs/en/catalog/items).
* If you want an order value (and value-based approval rules), the supplies need a cost confirmed for their current unit. See [Costs](/docs/en/catalog/costs).

### Step 1: the order header

<Steps>
  <Step title="Open New order">
    Go to **Orders** and select **New order**. The link only appears if you have `orders.create`. The screen is titled **New order**: "Choose the clinic and where to deliver. You add the supplies next."
  </Step>

  <Step title="Choose the Clinic">
    Pick the location in **Clinic**. Only active locations assigned to you are offered. If you have exactly one, it is shown as text and already selected.
  </Step>

  <Step title="Choose Deliver to warehouse">
    Pick the destination in **Deliver to warehouse**. The list holds the active warehouses that belong to the chosen location and are assigned to you. Until you choose a location it reads **Choose the clinic first.** If only one warehouse qualifies, it is shown as text and already selected.
  </Step>

  <Step title="Optionally choose Take stock from">
    **Take stock from** defaults to **Any central warehouse**. You can instead name one active central warehouse as the preferred source. Despite the label, an order with no named source can have its stock reserved from any usable box in any warehouse of the dental clinic, express warehouses included; check **Take from** on the [pick list](/docs/en/deliveries/picking) before you walk to a shelf.
  </Step>

  <Step title="Optionally write a Reason">
    **Reason (optional)** is free text for the approvers and the delivery team. It must not contain personal data (see [The reason and personal data](#the-reason-and-personal-data)).
  </Step>

  <Step title="Mark it as clinical, if it is">
    If you have `orders.clinical.create`, you see the box **It is for a patient's treatment**. Tick it to create a clinical order; the field **Patient reference (optional)** then appears, with the hint "Use your clinic's internal code, never a name or an ID number."
  </Step>

  <Step title="Create the order">
    Select **Create order**. The console opens the new order in **Draft**, ready for its supplies.
  </Step>
</Steps>

| Field | Required | Rules |
| - | - | - |
| **Clinic** | Yes | Must be an active location assigned to you. Empty: **Choose the clinic.** |
| **Deliver to warehouse** | Yes | Must be active, belong to the chosen location and be assigned to you. Empty: **Choose where to deliver.** |
| **Take stock from** | No | An active central warehouse, or **Any central warehouse**. |
| **Reason (optional)** | No | Up to 2000 characters. Leading and trailing spaces are removed. No personal data. |
| **It is for a patient's treatment** | No | Only offered with `orders.clinical.create`. Unticked means a general order. |
| **Patient reference (optional)** | No | Clinical orders only. Up to 200 characters. |

The header cannot be changed after the order is created: there is no way to edit the location, the destination, the source, the reason or the patient reference. If one of them is wrong, cancel the draft and create a new order.

If the chosen location has warehouses but none is assigned to you, you see **You have no warehouse of this clinic assigned. Ask an administrator for access.** If it has no active warehouse at all, you see **This clinic has no active warehouse yet. Create one in Warehouses first.**

### General and clinical orders

| | General (`general`) | Clinical (`clinical`) |
| - | - | - |
| Permissions | `orders.create` | `orders.create` and `orders.clinical.create` |
| Patient reference | Never | Optional |
| Approval policy | Rules can target it with **General orders** | Rules can target it with **Clinical orders** |
| Everything else | Same fields, same lifecycle | Same fields, same lifecycle |

<Warning>
  The patient reference is an opaque code from your own clinical system, for example `ext-7f3a`. Never enter a name, an ID number, a phone number or anything that identifies a person. muveya never looks the code up. It is stored encrypted and shown only to members with `orders.patient_ref.read`, and only on the order detail: it never appears in the orders list, the approvals screens or the public API.
</Warning>

### The reason and personal data

A patient is linked to an order only through the patient reference. To keep identifiers out of the free text, the server refuses a **Reason** that contains any of the following, and shows **The reason seems to include personal data. Remove names, phone numbers or ID numbers.**

* An email address.
* A card number written as four groups of four digits.
* One of the words `rut`, `dni`, `mrn`, `nhs`, `ssn`, `cpf`, `paciente` or `patient` immediately followed by a value that contains a digit (for example "patient 12").
* Nine or more digits in a row. Dots or hyphens between digits do not break the run, so `12.345.678-9` counts as nine digits. Dates and times are not affected.

Rewrite the reason without the identifier and create the order again.

### Step 2: add the supplies

While the order is a draft, you (the requester) see the **Add a supply** form below the **Supplies** table.

<Steps>
  <Step title="Pick the supply">
    Choose it in **Supply**. The list shows active supplies as name and SKU, for example "Nitrile gloves M · GLV-NIT-M".
  </Step>

  <Step title="Check the unit">
    The console reads the supply's unit and shows **Counted in:** followed by the unit (for example **Box**). The quantity you enter is in that unit.
  </Step>

  <Step title="Enter the quantity and add it">
    Type a whole number greater than zero in **Quantity** and select **Add supply**.
  </Step>
</Steps>

When a line is added, the order keeps a copy of the supply's name, SKU, unit, category, high-value flag and, if the supply has one, the unit cost in force at that moment. Later changes in the catalog do not alter the line.

To change a quantity, edit it in the **Quantity** column and select **Save**. To take a supply off, select **Remove**. Adding the same supply twice creates two separate lines; change the existing line instead if you only need more.

| Message | Why | What to do |
| - | - | - |
| **Enter a whole quantity greater than zero.** | The quantity is empty, zero, negative or has decimals. | Enter a whole number, 1 or more. |
| **The unit of this supply changed in the catalog. Choose it again to see the current unit.** | The unit changed after the form read it. | Choose the supply again and check **Counted in:**. |
| **The unit of this supply has not been reviewed in the catalog yet.** | The supply's unit is not fixed yet. | Ask a catalog manager to fix the unit. See [Supplies](/docs/en/catalog/items). |
| **This supply is not active in the catalog.** | The supply was deactivated. | Choose another supply. |
| **The record changed or already exists. Review it before trying again.** | The supply has a cost that is not confirmed for its current unit (`catalog.cost_unverified`). | Ask a catalog manager to confirm the cost. See [Costs](/docs/en/catalog/costs). |
| **That supply is no longer on the order.** | The line was already removed, for example in another tab. | Review the refreshed order. |

### Step 3: submit the order

Select **Submit order**. The button stays disabled until the order has at least one supply.

When you submit, the system:

1. Moves the order from `draft` to `submitted` and records the submission time.
2. Freezes the order value from the line costs.
3. Queues the order for the approval policy. Within seconds the order moves to **Waiting for approval** (someone must decide) or straight to **Approved** (the policy needs no decision). While it moves, the order shows **The order is moving to its next step. This screen refreshes by itself in a few seconds.**

<Note>
  If your dental clinic has never published an approval policy, a submitted order stays in **Submitted**. Publishing the first policy does not move it by itself: orders already waiting are processed the next time any order is submitted in your dental clinic. People who manage the policy see the Home card **No approval policy yet: submitted orders wait until one is published**. See [Approval policy](/docs/en/orders/approval-policy).
</Note>

After submission the supplies can no longer be changed; trying to shows **This order can no longer be changed.**

## Order statuses

The order lifecycle is a closed state machine. A status only changes through one of the transitions below; anything else is refused.

| Status | Label | Meaning | What moves it on |
| - | - | - | - |
| `draft` | **Draft** | Being prepared by the requester. | The requester submits or cancels it. |
| `submitted` | **Submitted** | Sent; waiting for the approval policy to be applied. | The system: to `pending_approval` if the policy requires a decision, to `approved` if it does not. The requester can cancel it. |
| `pending_approval` | **Waiting for approval** | Waiting for the decisions its approval plan requires. | Approvers with `approvals.decide`: to `approved` when every stage is approved, to `rejected` when any stage is rejected. The requester can cancel it. See [Order approvals](/docs/en/orders/approvals). |
| `approved` | **Approved** | Approved by people or by the policy. Cannot be cancelled anymore. | The system reserves stock and moves it to `allocated`. If stock is short it stays **Approved** until the reservation succeeds. |
| `rejected` | **Rejected** | An approver rejected it. Final. | Nothing. Create a new order if the supplies are still needed. |
| `cancelled` | **Cancelled** | The requester cancelled it. Final. | Nothing. |
| `allocated` | **Stock reserved** | Stock is reserved in the source warehouse. | The first validated box scan (`fulfillment.pick`) moves it to `picking`. |
| `picking` | **Being prepared** | Boxes are being picked. | Dispatch (`fulfillment.dispatch`) moves it to `dispatched`. |
| `dispatched` | **Dispatched** | The boxes left the source warehouse. | Delivery confirmation (`delivery.confirm`): to `delivered`, or to `exception` if a problem is reported. |
| `delivered` | **Delivered** | Delivered at the destination. | Receipt confirmation (`receipt.confirm`): to `received`, or to `partially_fulfilled` if the receipt is disputed. |
| `exception` | **Delivery problem** | A problem was reported at delivery. | No console action moves it on. The order shows "A delivery problem was reported. Its resolution is pending with the clinic's owner." |
| `received` | **Received** | Received in full. | Closing (`fulfillment.close`) moves it to `closed`. |
| `partially_fulfilled` | **Partially received** | Received with a dispute (damaged, missing or partial). | Closing (`fulfillment.close`) moves it to `closed`. |
| `closed` | **Closed** | Administratively closed. Final. | Nothing. |

```mermaid theme={null}
stateDiagram-v2
  [*] --> draft : create
  draft --> submitted : submit
  draft --> cancelled : cancel
  submitted --> pending_approval : approval needed
  submitted --> approved : no approval needed
  submitted --> cancelled : cancel
  pending_approval --> approved : every stage approved
  pending_approval --> rejected : a stage rejected
  pending_approval --> cancelled : cancel
  approved --> allocated : stock reserved
  allocated --> picking : first box scanned
  picking --> dispatched : dispatch
  dispatched --> delivered : delivery confirmed
  dispatched --> exception : delivery with a problem
  delivered --> received : receipt confirmed
  delivered --> partially_fulfilled : receipt disputed
  received --> closed : close
  partially_fulfilled --> closed : close
  rejected --> [*]
  cancelled --> [*]
  closed --> [*]
```

Everything from `allocated` onwards is described in [Deliveries overview](/docs/en/deliveries/overview).

## The order detail

Open an order from the list. The header shows **Order #** and the number, with the status next to it, and **Back to orders**.

### Facts

| Fact | When it appears |
| - | - |
| **Type** | Always. |
| **Clinic** | Always. |
| **Deliver to** | Always. |
| **Take stock from** | Always; **Any central warehouse** if no source was chosen. |
| **Requested by** | Always. |
| **Reason** | If the order has one. |
| **Patient reference** | Clinical orders with a reference, and only if you have `orders.patient_ref.read`. |
| **Order value** | If you have `orders.value.read` and at least one line has a cost. |

### Next step

The **Next step** panel tells you what happens now:

| Status | What the panel says or offers |
| - | - |
| **Draft** | To the requester: "Add the supplies and submit the order when it is complete." To others: the requester's name and "is still preparing this order." |
| **Submitted**, **Approved** | "The order is moving to its next step. This screen refreshes by itself in a few seconds." The screen refreshes every few seconds while the order is in one of these statuses. |
| **Waiting for approval** | "Waiting for approval." and, for each stage of the plan, its name and the number of approvals it needs. To the requester: "You requested this order, so another person has to approve it." To someone with `approvals.decide`: the link **Review and decide**. |
| **Rejected** | "This order was rejected. Create a new one if the supplies are still needed." |
| **Cancelled** | "This order was cancelled." |
| **Stock reserved** to **Delivered** | "The order is being prepared and delivered." |
| **Received**, **Partially received**, **Closed** | "The order was received." |
| **Delivery problem** | "A delivery problem was reported. Its resolution is pending with the clinic's owner." |

From **Stock reserved** onwards, members with any delivery permission also see **Follow the delivery**, which opens the delivery screen. See [Deliveries overview](/docs/en/deliveries/overview).

### Supplies

The **Supplies** table lists each line as **Supply** (name and SKU) and **Quantity** (quantity and unit, for example "10 × Box"). If the order has no lines you see **No supplies yet. Add at least one to submit the order.** While the order is your draft, a **Change** column holds **Save** and **Remove**.

## Cancel an order

**Who:** only the requester, with `orders.create`.
**When:** while the order is **Draft**, **Submitted** or **Waiting for approval**.

<Steps>
  <Step title="Open the order">
    Open it from **Orders**.
  </Step>

  <Step title="Select Cancel order">
    The dialog **Cancel order #1042?** (with the order's number) explains: "The order stops here and nobody will prepare it. This cannot be undone."
  </Step>

  <Step title="Confirm">
    Select **Yes, cancel it**, or **Keep the order** to go back.
  </Step>
</Steps>

**What the system records:** the order moves to `cancelled`, a final status. Nothing is reserved or prepared. If it was waiting for approval, it leaves the approvers' inbox; decisions already recorded stay in its history.

Once an order is **Approved**, it can no longer be cancelled from the console, and no other member (not even an **Owner** or an **Administrator**) can cancel someone else's order. If an approved order must be stopped, write to [team@muveya.com](mailto:team@muveya.com).

## Value and hidden data

* **Order value** is the sum, over the lines that have a cost, of quantity times the unit cost copied when the line was added. It is kept in minor units (cents, or whole pesos for a currency without decimals) and shown formatted in the order's currency. Lines without a cost add nothing; if no line has a cost, the order has no value. The value is frozen when the order is submitted.
* The value is shown only to members with `orders.value.read`. Without it, the **Order value** fact (and the value column of the approvals inbox) is simply not there. Line costs follow `catalog.cost.read`; this screen does not display them.
* The **Patient reference** is shown only with `orders.patient_ref.read`, and only on the order detail.
* Hidden data is removed by the server before it reaches your browser, so it is absent rather than blank.

## What can go wrong

| Message | Code | Why | What to do |
| - | - | - | - |
| **You cannot create orders. Ask your clinic's administrator for permission to request supplies.** | | You lack `orders.create`. | Ask a member manager to grant **Create supply orders**. |
| **You have no locations assigned to create orders. Ask an administrator for access.** | | Your location access is empty. | Ask for location access. |
| **That clinic is not active.** | `orders.clinic_unavailable` | The location is inactive, does not exist, or is not assigned to you. | Choose another location or ask for access. |
| **That warehouse is not active.** | `orders.warehouse_unavailable` | The destination is inactive, belongs to another location or is not assigned to you, or the chosen source warehouse is inactive. | Choose another warehouse or ask for access. |
| **The reason seems to include personal data. Remove names, phone numbers or ID numbers.** | `orders.justification_rejected` | The reason matched a personal data pattern. | Remove the identifier. |
| **You cannot add a patient reference.** | `orders.patient_ref_forbidden` | You tried to create a clinical order without `orders.clinical.create`. | Create a general order, or ask for **Create clinical orders**. |
| **This supply is not active in the catalog.** | `orders.catalog_item_unavailable` | The supply is inactive or does not exist. | Choose another supply. |
| **The unit of this supply changed in the catalog. Choose it again to see the current unit.** | `catalog.measurement_conflict` | The unit changed after you picked the supply. | Pick it again. |
| **The unit of this supply has not been reviewed in the catalog yet.** | `catalog.measurement_unverified` | The unit is not fixed. | Ask a catalog manager. |
| **This order can no longer be changed.** | `orders.not_editable` | The order is no longer a draft. | Nothing to change; follow its status. |
| **That supply is no longer on the order.** | `orders.line_not_found` | The line was removed meanwhile. | Review the order. |
| **Someone changed this order a moment ago. The screen now shows the latest version; review it and try again.** | `orders.version_conflict` | The order changed since your screen loaded it (for example, submitted or cancelled in another tab). | Review the refreshed order and repeat the action if it still applies. |
| **The order is no longer at a step where this can be done.** | `orders.transition_not_allowed` | The status does not allow the action (for example, cancelling an approved order). | See [Order statuses](#order-statuses). |
| **This order does not exist or you cannot see it.** | `orders.not_found` | Wrong link, another location, or someone else's order without the permission to see it. | Check the link and your access. |
| **Your account does not have permission for this action.** | `common.forbidden` | A permission is missing. | Ask for the permission listed in the section **Who can do what**. |

## Orders outside the console

Orders can only be created in the console. Read-only access also exists:

* The public API lists and reads orders with `GET /v1/orders` and `GET /v1/orders/{orderId}` (scope `orders:read`). The order value and the patient reference are always hidden for an API key. See [API scopes](/docs/en/api-reference/scopes).
* The MCP tool `orders.get` reads one order, and the resource `muveya://orders/status-model` describes this lifecycle. See [MCP tools](/docs/en/mcp/tools) and [MCP resources](/docs/en/mcp/resources).

## Related pages

<CardGroup cols={2}>
  <Card title="Order approvals" icon="circle-check" href="/docs/en/orders/approvals">
    Decide the orders waiting for your approval.
  </Card>

  <Card title="Approval policy" icon="scale-balanced" href="/docs/en/orders/approval-policy">
    Which orders need approval, and from whom.
  </Card>

  <Card title="Deliveries overview" icon="truck" href="/docs/en/deliveries/overview">
    What happens after an order is approved.
  </Card>

  <Card title="Costs" icon="coins" href="/docs/en/catalog/costs">
    Where the order value comes from.
  </Card>

  <Card title="Roles and permissions" icon="user-shield" href="/docs/en/account/roles-and-permissions">
    Grant order permissions and location access.
  </Card>

  <Card title="Concepts" icon="book" href="/docs/en/concepts">
    Dental clinic, locations, warehouses and orders.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.