> ## 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.

# How do I find orders that are missing prescriptions?

> Call GET /api/v1/orders?has_unmatched_prescriptions=true to list orders containing prescription products with no prescription attached. Use GET /prescriptions?has_order=false for the reverse.

An order containing a prescription product can't be filled until an active, non-expired prescription with fills remaining is attached to it. `GET /api/v1/orders?has_unmatched_prescriptions=true` returns exactly the orders in that state, so you can chase the missing prescriptions before they become stuck orders.

The mirror-image query — prescriptions that haven't been attached to any order — is `GET /api/v1/prescriptions?has_order=false`.

## Find the gap from the order side

```bash theme={null}
curl "https://api.byblend.com/api/v1/orders?has_unmatched_prescriptions=true&page_size=200" \
  -H "Authorization: Bearer {access_token}"
```

Each returned order includes `prescription_count` and its `products`, so you can see which line is unaccounted for.

## And from the prescription side

```bash theme={null}
curl "https://api.byblend.com/api/v1/prescriptions?has_order=false&page_size=200" \
  -H "Authorization: Bearer {access_token}"
```

<Warning>
  `has_order` only supports `false`. There is no `has_order=true` — to find prescriptions that *do* have orders, query the patient's orders directly with `GET /patients/{patient_id}/orders`.
</Warning>

## Narrow it down

The prescriptions list accepts filters that isolate exactly what's broken:

```bash theme={null}
# Prescriptions that arrived with no patient attached
curl "https://api.byblend.com/api/v1/prescriptions?patient_id=null" \
  -H "Authorization: Bearer {access_token}"

# Prescriptions that never matched one of your products
curl "https://api.byblend.com/api/v1/prescriptions?prescription_product_id=null" \
  -H "Authorization: Bearer {access_token}"
```

Passing `null` to `patient_id`, `prescription_product_id`, or `prescriber_id` finds prescriptions where that link is missing — which usually tells you *why* the order is unmatched, not just *that* it is.

## Fixing what you find

If the prescription genuinely never arrived, [send it](/guides/send-electronic-prescription). If it did arrive but didn't match, the Blend team will typically find and address the issue (the problem is nearly always the product or patient match). See [how matching works](/guides/prescription-matching) and [why Blend can't find a prescription you sent](/guides/find-a-missing-prescription).

<CardGroup cols={2}>
  <Card title="Get orders" icon="prescription-bottle" href="/api-reference/orders/get-orders">
    `has_unmatched_prescriptions=true`
  </Card>

  <Card title="Get prescriptions" icon="prescription" href="/api-reference/prescriptions/get-prescriptions">
    `has_order=false`, `patient_id=null`
  </Card>

  <Card title="Get a patient's orders" icon="user" href="/api-reference/patients/get-a-patients-orders">
    GET /patients/{'{'}patient\_id{'}'}/orders
  </Card>

  <Card title="Get a patient's prescriptions" icon="file-lines" href="/api-reference/patients/get-a-patients-prescriptions">
    GET /patients/{'{'}patient\_id{'}'}/prescriptions
  </Card>
</CardGroup>
