# Follow a pathology request

Each route on this page takes the `nodeLineageUuid` from the create response or the list, and answers `404` for a request your group didn't order.

## Progress

`GET /api/v1/marketplace/requests/{nodeLineageUuid}/progress`

Where the request is, the same as the patient sees it. Poll this until webhooks cover pathology requests.

**Example: Poll a request's progress**

Request:

```http
GET /api/v1/marketplace/requests/ffce4630-e0ad-4481-b2f8-a59bbb1f49e7/progress HTTP/1.1
Host: api.onearly.com
Authorization: Bearer oe_sk_live_au_8b2e4d6f0a1c3e5b7d9f1a2c4e6b8d0f
```

Response:

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "kind": "pathology",
  "detailsComplete": true,
  "payment": "to-pay",
  "amountPaid": null,
  "paidAt": null,
  "reviewChoice": null,
  "referralLetter": null,
  "resultsTaskUuid": "4c6d8e0f-2a3b-4c4d-9e5f-6a7b8c9d0e04",
  "resultsReleased": false,
  "medicareResultsReleased": false,
  "estimate": {
    "basis": "after-review",
    "amountCents": 4500,
    "currency": "aud",
    "reviewedAt": "2026-11-24T09:12:40.000Z"
  },
  "steps": [
    {
      "key": "details",
      "state": "done"
    },
    {
      "key": "centre",
      "state": "done"
    },
    {
      "key": "payment",
      "state": "current"
    },
    {
      "key": "complete-tests",
      "state": "upcoming"
    },
    {
      "key": "results",
      "state": "upcoming"
    }
  ]
}
```

| Field | Notes |
|---|---|
| `kind` | `pathology` |
| `steps` | The patient's steps in order, each a `key` and a `state`. See [Steps](#steps). |
| `detailsComplete` | Whether the patient's details are complete enough for the lab to accept the referral. `null` when the patient has no account. |
| `payment` | `nothing-to-pay` (every test is bulk billed), `to-pay` (something is due and unpaid) or `paid`. `null` until the patient chooses a collection centre, which prices the request. |
| `estimate` | What the patient is expected to pay. See [Payment](#payment). |
| `amountPaid` | What the patient was charged: `chargedAmountCents` and `currency`. `null` unless `payment` is `paid`. |
| `paidAt` | When the payment was recorded. `null` unless `payment` is `paid`. |
| `resultsReleased` | `true` once OnEarly has released the results for the tests the doctor referred to Medicare. It doesn't cover the results on [`…/results`](#results). |
| `medicareResultsReleased` | Deprecated. Read `resultsReleased`. |
| `resultsTaskUuid` | The request's results task, or `null` until it exists |
| `reviewChoice`, `referralLetter` | Radiology only. Always `null` for pathology. |

### Steps

| `key` | The patient… |
|---|---|
| `details` | Confirms their details. Present only when the patient has an account. |
| `centre` | Chooses a collection centre |
| `payment` | Pays for any tests not bulk billed |
| `complete-tests` | Gives their sample at the centre |
| `results` | Receives their results |

| `state` | Meaning |
|---|---|
| `done` | Finished |
| `current` | The step the patient acts on now |
| `waiting` | Waiting on the lab or OnEarly. Only the `results` step waits. |
| `upcoming` | Waiting behind an earlier step |
| `skipped` | Won't happen |

New keys and states may be added. Skip one you don't recognise.

### Payment

`estimate` is worked out each time you read it, from the request's tests and its Doctor Review as it stands, so it moves when the doctor amends the review.

| Field | Notes |
|---|---|
| `basis` | `before-review`: every test is priced, because the doctor hasn't given a verdict. `after-review`: only the tests the doctor didn't refer to Medicare, so `0` means nothing to pay. |
| `amountCents` | What checkout would charge today, in cents, before tax. Includes the collection fee when at least one test is charged. |
| `currency` | Lowercase ISO 4217, such as `aud`. `null` only when `amountCents` is `0` and no test has a price. |
| `reviewedAt` | When the doctor last settled which tests are private. `null` while `basis` is `before-review`. |

`estimate` is `null` once `payment` is `paid` (read `amountPaid`), and when it can't be worked out.

## Doctor review

`GET /api/v1/marketplace/requests/{nodeLineageUuid}/doctor-review`

An OnEarly doctor reviews the request's tests and decides which to refer under Medicare.

**Example: Read the doctor's review**

Request:

```http
GET /api/v1/marketplace/requests/ffce4630-e0ad-4481-b2f8-a59bbb1f49e7/doctor-review HTTP/1.1
Host: api.onearly.com
Authorization: Bearer oe_sk_live_au_8b2e4d6f0a1c3e5b7d9f1a2c4e6b8d0f
```

Response:

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "kind": "pathology",
  "verdict": "eligible",
  "decidedAt": "2026-11-24T09:12:40.000Z",
  "tests": [
    {
      "slug": "blood-panel",
      "title": "Full blood count",
      "referred": true
    },
    {
      "slug": "vitamin-d",
      "title": "Vitamin D",
      "referred": false
    }
  ],
  "letterLineageUuid": "5d7e9f1a-3b4c-4d5e-8f6a-7b8c9d0e1f05",
  "reviewLineageUuid": "6e8f0a2b-4c5d-4e6f-9a7b-8c9d0e1f2a06",
  "testInstructions": "No fasting needed.",
  "canAmend": true
}
```

| Field | Notes |
|---|---|
| `kind` | `pathology` |
| `verdict` | `pending` until the doctor decides, then `eligible` (a referral letter was generated) or `not_eligible`. `null` when no test on the request is one a doctor reviews. |
| `decidedAt` | When the doctor decided. `null` while `pending`. |
| `tests` | The tests reviewed, in order: `slug`, `title` and `referred`. `referred` is whether the doctor put the test in the referral, and `null` while the review is pending or for a test left undecided. |
| `testInstructions` | The doctor's preparation instructions for the patient, such as fasting. `null` when there are none. |
| `canAmend` | Whether OnEarly can still change the decision |
| `letterLineageUuid`, `reviewLineageUuid` | The referral letter and the review in OnEarly's content library. `letterLineageUuid` is `null` until a letter exists, and on a `not_eligible` verdict. `reviewLineageUuid` is `null` when no review is stored. |

Tests the doctor refers are bulk billed; the patient pays for the rest. See [Payment](#payment).

## Summary

`GET /api/v1/marketplace/requests/{nodeLineageUuid}/summary`

| Field | Notes |
|---|---|
| `kind` | `pathology` |
| `canDelete` | Whether you can [cancel the request](ordering.md#cancel-a-request) now |
| `group` | Your OnEarly group, which the request was ordered under: its current `name` and its `actorUuid`. Not the `group.name` you sent on the create. |
| `practitioner` | `name`: always `null` for a request made through this API. The `requester` you sent isn't returned here. |
| `selfOrder` | `false` for a request you ordered |

## Results

`GET /api/v1/marketplace/requests/{nodeLineageUuid}/results`

The lab's results, as structured values, for the tests the patient pays for: the tests the doctor didn't refer to Medicare. Results for tests referred to Medicare aren't on this route; `resultsReleased` on [Progress](#progress) says when OnEarly has released them.

Once the patient has paid and the referral has gone to the lab, reading this route also checks the lab for newer results.

**Example: Read a request's results**

Request:

```http
GET /api/v1/marketplace/requests/ffce4630-e0ad-4481-b2f8-a59bbb1f49e7/results HTTP/1.1
Host: api.onearly.com
Authorization: Bearer oe_sk_live_au_8b2e4d6f0a1c3e5b7d9f1a2c4e6b8d0f
```

Response:

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "kind": "pathology",
  "state": "available",
  "live": true,
  "results": [
    {
      "fulfillerKey": "bgt",
      "eirlyResultUuid": "7f9a1b3c-5d6e-4f7a-8b8c-9d0e1f2a3b07",
      "eirlyReferralUuid": "8a0b2c4d-6e7f-4a8b-9c9d-0e1f2a3b4c08",
      "reference": "40217735",
      "status": "COMPLETE",
      "complete": true,
      "resultDate": "2026-11-26T02:30:00.000Z",
      "biomarkerSummary": {
        "normal": 1,
        "abnormal": 1,
        "critical": 0,
        "total": 2
      },
      "biomarkers": [
        {
          "id": "haemoglobin",
          "name": "Haemoglobin",
          "commonName": "Haemoglobin",
          "value": "140",
          "valueType": "numeric",
          "formattedValue": "140 g/L",
          "unit": "g/L",
          "refIntervalLow": 130,
          "refIntervalHigh": 180,
          "isAbnormal": false,
          "sampleType": "whole-blood"
        },
        {
          "id": "ferritin",
          "name": "Ferritin",
          "commonName": "Ferritin",
          "value": "18",
          "valueType": "numeric",
          "formattedValue": "18 ug/L",
          "unit": "ug/L",
          "refIntervalLow": 30,
          "refIntervalHigh": 500,
          "isAbnormal": true,
          "sampleType": "serum"
        }
      ],
      "report": {
        "fileContentUuid": "9b1c3d5e-7f8a-4b9c-8d0e-1f2a3b4c5d09",
        "url": "/api/download/file/9b1c3d5e-7f8a-4b9c-8d0e-1f2a3b4c5d09",
        "storedAt": "2026-11-26T03:05:12.000Z",
        "sizeBytes": 184320
      },
      "fetchedAt": "2026-11-26T03:05:10.000Z",
      "updatedAt": "2026-11-26T03:01:44.000Z"
    }
  ]
}
```

| Field | Notes |
|---|---|
| `kind` | `pathology` |
| `state` | `none` while the lab has reported nothing; `pending` when it has and OnEarly is fetching it (poll again shortly); `available` once at least one result is stored |
| `live` | `true` when the lab was reached just now. `false` when it couldn't be, or when there is no referral at the lab yet, and `results` is what OnEarly already holds. |
| `results` | Stored results, oldest first |

A result is updated in place as the lab completes it, so read the whole of `biomarkers` each time rather than adding to what you held. Each result:

| Field | Notes |
|---|---|
| `status`, `complete` | `PARTIAL_RESULTS` while the lab is still reporting; `COMPLETE`, with `complete` `true`, once every test on this result is back |
| `biomarkers` | Every value reported so far. See below. |
| `biomarkerSummary` | Counts: `normal`, `abnormal`, `critical`, `total`. Optional. |
| `report` | The lab report PDF, once stored: `fileContentUuid`, `url`, `storedAt`, `sizeBytes`. See [Download the lab report](#download-the-lab-report). |
| `resultDate` | When the lab processed the sample. Optional. |
| `fetchedAt`, `updatedAt` | When OnEarly fetched this revision; the lab's own last-updated time |
| `reference` | The lab network's 8-digit reference for the order. Optional. |
| `fulfillerKey` | The lab that reported the result |
| `eirlyResultUuid`, `eirlyReferralUuid` | The lab network's ids for the result and the referral |
| `reviewedBy` | Who reviewed the result. Left out when the lab doesn't say. |

Each biomarker has `id`, `name`, `commonName`, `value`, `valueType` (`numeric` or `string`), `formattedValue` (such as `140 g/L`) and `isAbnormal` (`null` when the lab gives no flag, as for a blood group). Where the lab supplies them it also has `unit`, `refIntervalLow`, `refIntervalHigh`, `additionalRanges`, `sampleType`, `category`, `description` and `notes`.

The patient sees these results as soon as OnEarly stores them.

### Download the lab report

`GET /api/download/file/{fileContentUuid}` with the `fileContentUuid` from `results[].report`, using the same group API key. `report.url` is this path. Your group can read the report because the result and its report are recorded under your group.

The response is the file's bytes. This endpoint reports errors in a different shape from the rest of the API: `error` holds the message string and there is no `message` field. Branch on `code`.

| Status | `code` |
|---|---|
| `401` | A code from [Authentication errors](index.md#authentication-errors), such as `API_KEY_EXPIRED` |
| `403` | `INSUFFICIENT_PERMISSIONS` |
| `404` | `NOT_FOUND` |
| `416` | A `Range` header outside the file |
| `500` | `INTERNAL_ERROR`, `CONTAINER_ERROR` |

A request with no `Authorization` header is treated as anonymous, so a report it can't see answers `403` or `404`, not `401`.

Source: https://docs.staging.onearly.com/api/pathology/tracking/
