LOMS Integration API (2.0.0)

Download OpenAPI specification:

Overview and key workflows

Lab Order Management System API Documentation. This API provides endpoints to manage laboratory orders and their results, and to keep your customer account list in sync.

Authentication

Requests use an OAuth 2.0 client-credentials token from your lab's Cognito domain. erblue provides your client id, client secret and token URL, and sets which scopes your client may request: integration-api/order:read and integration-api/order:write for orders, integration-api/account:read and integration-api/account:write for lab accounts.

1. Get Latest Updates & Retrieve Orders

  • Fetch Updates:
    • Periodically poll for changes using GET /labs/{labId}/lab-orders/updates?since={timestamp}
    • Returns a list of reservation codes for orders that have been created or modified
  • List Orders:
    • When updates are found, retrieve full order details using GET /labs/{labId}/lab-orders?reservationCodes=code1,code2
    • Returns complete order information including samples, documents, and results for the specified orders
  • Update Order Status:
    • Update the status to In Progress of an order using PUT /labs/{labId}/lab-orders/{reservationCode}/status

2. Upload Sample Results Document

  • Get a pre-signed URL for results PDF (GET /labs/{labId}/lab-orders/{reservationCode}/documents/upload-sample-results-url)
  • Upload the document to the pre-signed URL
  • Confirm the upload (POST /labs/{labId}/lab-orders/{reservationCode}/documents/upload-sample-results-url)

3. Update Order Sample Results

  • Upload sample results for an existing order POST /v1/labs/{labId}/lab-orders/{reservationCode}/samples/results

4. Keep Your Account List in Sync

  • Send your accounts with POST /v1/labs/{labId}/lab-accounts in batches of up to 1000, matched on billing_id
  • New billing IDs are created and known ones are updated; accounts you leave out are never deleted
  • Re-sending an unchanged account is safe: it is reported as unchanged and not rewritten, so you can send your whole list each time rather than working out what changed

Lab Orders

API endpoints for managing lab orders and their samples and results

Get lab orders

Retrieves a list of lab orders by reservation codes

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

query Parameters
reservationCode
required
Array of strings

Filter orders by reservation code(s). Can be a single code or comma-separated list

Responses

Request samples

curl --request GET \
  --url 'https://loms-api.erblue.com/v1/labs/%7BlabId%7D/lab-orders?reservationCode=SOME_ARRAY_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

Response samples

Content type
application/json
[
  • {
    }
]

Get a specific lab order

Retrieves a lab order by reservation code

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

reservationCode
required
string

Reservation code for the lab order

Responses

Request samples

curl --request GET \
  --url https://loms-api.erblue.com/v1/labs/%7BlabId%7D/lab-orders/%7BreservationCode%7D \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

Response samples

Content type
application/json
{
  • "billing_id": "string",
  • "lab_location_id": "string",
  • "billing_to_id": "string",
  • "reservation_code": "string",
  • "status": "Submitted",
  • "project_name": "string",
  • "lab_order_id": "string",
  • "inspector_name": "string",
  • "inspector_email": "string",
  • "po_number": "string",
  • "project_id": "string",
  • "special_instructions": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "state_province": "string",
  • "zip_postal": "string",
  • "country": "string",
  • "submitted_at": "2019-08-24T14:15:22Z",
  • "samples": [
    ],
  • "results": [
    ]
}

Update lab order status

Updates a lab order status by reservation code

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

reservationCode
required
string

Reservation code for the lab order

Request Body schema: application/json
required
status
required
string
Enum: "Submitted" "In Progress" "Completed" "Cancelled"

The current status of the order

Responses

Request samples

Content type
application/json
{
  • "status": "Submitted"
}

Lab Order Updates

API endpoints for fetching lab order updates

Get lab order updates

Retrieves a list of lab orders updates since timestamp

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

query Parameters
since
required
string <date-time>

Filter orders updated after this timestamp (ISO 8601 format)

locationId
string

Filter orders updates by location id

Responses

Request samples

curl --request GET \
  --url 'https://loms-api.erblue.com/v1/labs/%7BlabId%7D/lab-orders/updates?since=SOME_STRING_VALUE&locationId=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

Response samples

Content type
application/json
[
  • {
    }
]

Lab Order Documents

API endpoints for managing lab order documents

Get URL to download Chain of Custody document, with optional watermarks

Returns a URL to download the Chain of Custody document for an order. With no body, or no watermarks, the URL is for the original document. A body must be sent as JSON with Content-Type: application/json. A body sent with another content type, or without one, returns a 415 response. With watermarks, a copy is created with the text printed on it, and the URL is for the copy. Each watermark places text in one corner: top_left, top_right, bottom_left or bottom_right, each used at most once. It has the pages it appears on ("all", or a list of page numbers starting at 1, "first" and "last"), up to 5 lines of 40 characters, and an optional color of black or red. Each request with watermarks creates a new copy from the original document, so send everything every time. Text is printed in 10 point Courier and is not wrapped or resized, so long text in two corners along the same edge can overlap on narrow pages.

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

reservationCode
required
string

Reservation code for the lab order

Request Body schema: application/json
optional
Array of objects <= 4 items

Text to print on the document. Each position can be used at most once. Repeating a position returns a 400 response. Leave this out, or send an empty list, to get the original document.

Array (<= 4 items)
position
required
string
Enum: "top_left" "top_right" "bottom_left" "bottom_right"

Where on the page the text is placed. Each position can be used at most once per request.

required
string or (Array of strings or strings or integers)

Pages the text appears on: "all", or a list of page numbers starting at 1, "first" and "last".

color
string
Enum: "black" "red"

Text color. Defaults to black.

lines
required
Array of strings [ 1 .. 5 ] items [ items [ 1 .. 40 ] characters ^[\x20-\x7E\xA0-\xFF]*$ ]

Lines of text, top to bottom. At most 5 lines of 40 characters. Spaces at the start and end of a line are removed, and a line cannot be only spaces.

Responses

Request samples

Content type
application/json
{
  • "watermarks": [
    ]
}

Response samples

Content type
application/json
{
  • "url": "string"
}

Get URL to upload sample results document

Retrieves a lab order sample results upload url by reservation code

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

reservationCode
required
string

Reservation code for the lab order

Responses

Request samples

curl --request GET \
  --url https://loms-api.erblue.com/v1/labs/%7BlabId%7D/lab-orders/%7BreservationCode%7D/documents/upload-sample-results-url \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

Response samples

Content type
application/json
{
  • "url": "string",
  • "identifier": "string"
}

Confirm sample results document upload

Completes a lab order sample results upload by reservation code

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

reservationCode
required
string

Reservation code for the lab order

Request Body schema: application/json
required
identifier
required
string

Lab order sample results upload identifier

Responses

Request samples

Content type
application/json
{
  • "identifier": "string"
}

Lab Order Sample Results

API endpoints for managing lab order sample results

Get lab order sample results

Retrieves a lab order samples results by reservation code

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

reservationCode
required
string

Reservation code for the lab order

Responses

Request samples

curl --request GET \
  --url https://loms-api.erblue.com/v1/labs/%7BlabId%7D/lab-orders/%7BreservationCode%7D/samples/results \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

Response samples

Content type
application/json
[
  • {
    }
]

Update a lab order samples results

Updates a lab order samples results for a given reservation code

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

reservationCode
required
string

Reservation code for the lab order

Request Body schema: application/json
required
Array
lab_sample_id
required
string

A unique identifier assigned to the sample by the laboratory.

lab_test_method
required
string

The specific laboratory method or protocol used to analyze the sample.

aliquot_id
required
string

A unique identifier for an aliquot of the sample.

result_qualifier
string
Enum: "<" ">"

Indicates additional information or qualifiers about the result value.

result_value
required
number

The numerical result of the analysis.

result_type
required
string

Classification of the type of result being reported.

unit
required
string

The unit of measurement for the result value.

mrl_value
required
number

The minimum reporting limit (MRL) for the analysis.

identifier
required
string

A unique identifier representing the type of analysis or target.

analysis_date
required
string <date-time>

The date and time when the analysis was completed.

comment
string

Any additional notes or observations about the result or analysis.

result_status
required
string
Enum: "Analyzed" "Not Analyzed"

The current sample result status of the sample.

sample_code
required
string

A unique identifier assigned to the sample when the order is created.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Lab Accounts

API endpoints for keeping your lab customer accounts in sync with an external system

Create or update lab accounts

Creates or updates accounts in bulk, matching on billing_id within your lab organization. Existing accounts are updated in place; accounts that are absent from the request are left untouched. Each request is applied as a single transaction, so send large sets as several requests of up to 1000 accounts.

Authorizations:
BearerAuth
path Parameters
labId
required
string

Your lab organization id

Request Body schema: application/json
required
Array ([ 1 .. 1000 ] items)
billing_id
required
string non-empty

The unique identifier for the account within your organization.

name
required
string non-empty

The account name.

contact_name
string or null non-empty

The primary contact name. Omitted or null values leave an existing contact name unchanged.

contact_email
string or null <email>

The primary contact email. Omitted or null values leave an existing contact email unchanged.

address1
string or null

The primary address line for the account.

address2
string or null

The secondary address line for the account.

city
string or null

The city for the account address.

state_province
string or null = 2 characters

The two-letter state or province code for the account address.

zip_postal
string or null

The postal or ZIP code for the account address.

country
string or null = 2 characters

The two-letter country code for the account address.

active
boolean or null

Whether the account is active. Defaults to true when omitted or null, on both insert and update.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "inserted": 0,
  • "updated": 0,
  • "unchanged": 0
}