Skip to content

Reject a lab order

Request

Reject a submitted order with a free-text reason and an optional machine-readable reason code. Moves the order SUBMITTED -> REJECTED (terminal) and returns the updated order. Idempotent: re-rejecting a rejected order is a no-op.

Security
PartnerApiKey and PartnerOAuth
Path
labOrderIdinteger, (int64)required

Lab order id

Example:9001
accountIdinteger, (int64)required

Account identifier

locationIdinteger, (int64)required

Location identifier

Bodyapplication/jsonrequired
errorsArray of objects(PartnerErrorFieldError)

Per-field validation errors, using the platform's property/message shape

reasonstringrequired

Free-text rejection reason (always present)

Example:"Ordering provider NPI is not recognized by the lab"
reasonCodestring

Vendor-neutral category a partner maps its own rejection reason onto; the free-text reason is always present, this code is optional automation. INVALID_ORDER_CODE: an ordered test or panel code is not recognized. INVALID_AOE_ANSWER: a required Ask-on-Entry answer is missing or invalid. INVALID_PROVIDER: the ordering provider NPI is missing, invalid, or not authorized with the lab. INVALID_PATIENT: patient demographics are missing or invalid. INVALID_ACCOUNT: the ordering account/client is not recognized or set up with the lab. DUPLICATE_ORDER: the lab already has this order. TEST_NOT_AVAILABLE: a requested test is not offered for this account or location. VALIDATION_ERROR: the order is malformed or missing a required field. OTHER: none of the above; see the free-text reason.

Enum:"INVALID_ORDER_CODE""INVALID_AOE_ANSWER""INVALID_PROVIDER""INVALID_PATIENT""INVALID_ACCOUNT""DUPLICATE_ORDER""TEST_NOT_AVAILABLE""VALIDATION_ERROR""OTHER"
Example:"INVALID_PROVIDER"
curl -i -X POST \
  'https://api-docs.lobbie.com/_mock/openapi/partner/v2/account/{accountId}/location/{locationId}/lab-order/9001/reject' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '{
    "errors": [
      {
        "message": "must be 10 digits",
        "property": "phone"
      }
    ],
    "reason": "Ordering provider NPI is not recognized by the lab",
    "reasonCode": "INVALID_PROVIDER"
  }'

Responses

Order rejected (or idempotent no-op)

Bodyapplication/json
createdAtstring, (date-time)

Creation timestamp (UTC)

Example:"2025-01-15T14:00:00Z"
idinteger, (int64)

Lab order id

Example:9001
labIdinteger, (int64)

Id of the linked /lab record, so a partner can navigate to the existing lab read view

Example:12345
locationIdinteger, (int64)

Location id

Example:200
orderNumberstring

The account's order reference number

Example:"ORD-100245"
orderingProviderIdinteger, (int64)

Ordering provider (staff) id (resolve via /staff)

Example:412
patientIdinteger, (int64)

Patient id (resolve via /patient)

Example:300
statusstring

Lifecycle status of a lab order, from staff placement through partner fulfilment. The server owns every transition; the partner never sets the status directly. SUBMITTED: placed by staff and awaiting partner pickup. ACCEPTED: the partner acknowledged the order and recorded its thirdPartyLabId. REJECTED: the partner declined the order; terminal, staff correct and re-release as a new order. PARTIALLY_RESULTED: some ordered tests have results, others are still pending. RESULTED: every ordered test has a final result. CORRECTED: a previously delivered result was superseded by a correction. CANCELLED: the order was cancelled before fulfilment.

Enum:"SUBMITTED""ACCEPTED""REJECTED""PARTIALLY_RESULTED""RESULTED""CORRECTED""CANCELLED"
Example:"SUBMITTED"
testsArray of objects(LabOrderTestDTO)

Ordered tests with their Ask-on-Entry answers

thirdPartyLabIdstring

Lab-assigned order identifier (accession / requisition number); null until the order is accepted

Example:"ACC-8837162"
updatedAtstring, (date-time)

Last update timestamp (UTC)

Example:"2025-01-15T14:00:00Z"
Response
{ "createdAt": "2025-01-15T14:00:00Z", "id": 9001, "labId": 12345, "locationId": 200, "orderNumber": "ORD-100245", "orderingProviderId": 412, "patientId": 300, "status": "SUBMITTED", "tests": [ { … } ], "thirdPartyLabId": "ACC-8837162", "updatedAt": "2025-01-15T14:00:00Z" }