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

# What is refill risk, and how do I check it?

> Refill risk compares a prescriber's license coverage against the predicted next fill date. Pass refill_risk=true on GET /prescriptions, GET /prescriptions/{id}, or GET /patients/{id}/prescriptions to get the assessment.

Refill risk answers a specific question: when this prescription next comes up for a fill, will the prescriber still be licensed in the state that matters? Blend predicts the next fill date from the last fill and the days supply, then checks the prescriber's state licenses against it. Add `refill_risk=true` to any prescriptions request and each prescription comes back with a nested `refill_risk` object.

It's a forward-looking check, not a status. A prescription can be perfectly valid today and still be at risk, because the license covering it expires before the patient is due for their next fill.

## Ask for the assessment

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

The same parameter works on a single prescription and on a patient's prescriptions:

```bash theme={null}
curl "https://api.byblend.com/api/v1/patients/clinic-pt-4471/prescriptions?refill_risk=true" \
  -H "Authorization: Bearer {access_token}"
```

<Note>
  The `refill_risk` object is **omitted entirely** unless you pass the parameter. Don't write code that expects it on every prescription response.
</Note>

## Reading the result

`at_risk` is the field to alert on. It's `true` when the covering license is missing today, or expires before the predicted next fill.

When `at_risk` is true, `reasons` tells you which:

| Reason code                   | Meaning                                                  |
| ----------------------------- | -------------------------------------------------------- |
| `prescriber_unlicensed`       | No valid license covering the relevant state today       |
| `prescriber_license_expiring` | Licensed now, but expires before the predicted next fill |

The assessment also returns `predicted_next_fill_date`, `last_fill_date`, `days_supply_used`, `relevant_states`, `covering_licenses`, `earliest_covering_expiration`, `days_until_next_fill`, and `days_until_license_expiry` — enough to build a prioritized worklist rather than a flat alert.

## When it doesn't apply

`applicable: false` means Blend skipped the assessment, and `not_applicable_reason` says why:

* `cancelled` — the prescription is cancelled
* `rx_expired` — the prescription has already expired
* `no_fills_remaining` — nothing left to fill
* `no_prescriber` — no prescriber attached
* `no_relevant_states` — no state could be determined to check against

These are not problems to fix. A cancelled prescription has no next fill to be at risk for.

<Tip>
  Run this weekly across your active prescriptions and sort by `days_until_next_fill`. A license expiring in 90 days matters far less than one expiring before a fill that's due next week.
</Tip>

<Warning>
  Refill risk is a licensing check, not a clinical or timing one. It won't tell you whether a refill is too early to fill, or whether the prescription itself is close to expiring — check `expires_at` and `fills_remaining` on the prescription for those.
</Warning>

## Fixing what it finds

The remedy is almost always to update the prescriber's state license. Add or renew one with `POST /prescribers/{prescriber_id}/qualifications`, or manage licenses directly in the Blend Dashboard under Prescribers. Blend also monitors prescriber credentials on your behalf — see [does Blend track prescriber license status for me?](/guides/prescriber-license-monitoring)

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

  <Card title="Get a prescription" icon="file-lines" href="/api-reference/prescriptions/get-a-prescription">
    `refill_risk=true`
  </Card>

  <Card title="Create a license/qualification" icon="id-card" href="/api-reference/prescribers/create-a-licensequalification">
    Add a state license
  </Card>

  <Card title="Get a prescriber's details" icon="notes-medical" href="/api-reference/prescribers/get-a-prescribers-details">
    Current licenses and credentials
  </Card>
</CardGroup>
