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

# Why doesn't my order quantity match the prescribed quantity?

> They measure different things. A prescription quantity is in the prescriber's units — 20 mL. An order line quantity counts sellable units — 2 vials. Set quantity explicitly on every order line.

Blend tracks quantity at three different layers, and they are not interchangeable.

* **Prescription quantity** — what the prescriber wrote, in clinical units. *20 mL.*
* **Order line quantity** — how many sellable units to dispense. *2 vials.*
* **Dispensed quantity** — what was actually pulled at pick time, recorded on the fill.

## When you create the order

<Warning>
  Blend does **not** compute the line quantity for you. If you omit `quantity` on an order line, it defaults to **1** — regardless of what the prescription says. A 90-capsule prescription with no `quantity` on the order line ships one bottle.
</Warning>

Send it explicitly:

```json theme={null}
{
  "patient": { "external_id": "clinic-pt-4471" },
  "products": {
    "prescription": [
      { "product_code": "HC-RAPA31", "quantity": 2 }
    ]
  }
}
```

## How many fills does that consume?

At pick time, Blend works out how many refills the dispensed amount represents:

| Prescription               | Ordered     | Fills consumed |
| -------------------------- | ----------- | -------------- |
| 90 capsules, 90 per bottle | 1 bottle    | 1              |
| 30 capsules, 90 per bottle | 90 capsules | 3              |
| 20 mL, 10 mL vials         | 2 vials     | 1              |

`fills_remaining` on the prescription is the number to trust — it accounts for how much each fill actually consumed, and it excludes fills created by [replacement orders](/guides/replacement-orders), which deliberately don't count against the prescription.

<CardGroup cols={2}>
  <Card title="Create an order" icon="prescription-bottle" href="/api-reference/orders/create-an-order">
    Set `quantity` on every line
  </Card>

  <Card title="Update order item quantity" icon="pen" href="/api-reference/orders/update-order-item-quantity">
    Correct a line in `received`
  </Card>

  <Card title="Get a prescription" icon="prescription" href="/api-reference/prescriptions/get-a-prescription">
    `quantity`, `units`, `fills_remaining`
  </Card>

  <Card title="Get quantity units" icon="ruler" href="/api-reference/electronic-prescriptions/get-quantity-units">
    NCPDP unit codes
  </Card>
</CardGroup>
