Description
Use this endpoint to submit an order to Hill Labs and get immediate feedback on its submission status.
Key Features
- Submit an order request
- Get immediate data validation and feedback on submission status
- Include multiple order or sample references
- Include multiple contacts with different order roles, such as Submitter and Primary contact
- Submit composite samples
- Provide GPS coordinates (point or intersect) and named sampling locations
Endpoint
Testing: POST https://cat-api.hill-laboratories.com/client/api/v3/order-requests
Production: POST https://api.hill-laboratories.com/client/api/v3/order-requests
Required Headers
Content-Type: application/json Authorization: Bearer YOUR_ACCESS_TOKEN
Schema
Testing: ClientOrder.json
Production: ClientOrder.json
Request Object
Use this map to see how the objects in a ClientOrder request fit together. Select a field to jump to its definition or an example. [] indicates an array. For the complete request definition and validation rules, see the linked JSON schema.
Request structure
Order
Top-level order details, the organisations involved and the order lines.
| Field | Value type | Validation | Description |
|---|---|---|---|
orderReferences | array | Optional. | Customer-supplied references associated with the order. References should be unique within an account, but the API does not validate uniqueness. |
organisations | array | Required. | The Hill Labs organisation or organisations associated with the order. Use multiple organisations when the order has different owner and charging organisations. |
notes | string | Optional. Maximum 2,000 characters. | Instructions or additional information for the order. |
lines | array | Required. Provide 1–200 items. Supported line types: samplingSupplies, sample or sampleComposite. | Each item is one order line. The object for each line depends on its type. |
Order reference
Optional identifiers that help match the order to your records, a Hill Labs quote or a pre-registration.
| Field | Value type | Validation | Description |
|---|---|---|---|
name | string | Required when an order reference is supplied. Must not be null or blank. Maximum 30 characters. | Identifier for the order reference. These names are reserved:
|
value | string | Required when an order reference is supplied. Maximum 64 characters. | Value associated with the order reference name. |
Organisation
Identifies the Hill Labs organisation or organisations involved, along with their contacts and addresses.
| Field | Value type | Validation | Description |
|---|---|---|---|
hillLabsAccountId | string | Optional. | Unique Hill Labs identifier for the organisation. If neither |
name | string | Optional. | Name of the organisation. This is not required when If neither |
orderRoles | array | Required. Include PRIMARY_ORGANISATION. CHARGE_TO is optional. | Roles for the organisation in this order:
The primary and charge-to roles can belong to different organisations. |
contacts | array | Required. | Contacts within the organisation who are associated with the order. |
addresses | array | Optional. Required when Sampling Supplies must be delivered somewhere other than the primary contact’s default delivery address. | Delivery and invoice addresses for the account. If omitted, both addresses default to those of the primary contact. |
Contact
Identifies the people associated with the order and the roles they fulfil, including submitter and primary contact.
| Field | Value type | Validation | Description |
|---|---|---|---|
orderRoles | array | Required. Include both SUBMITTER and PRIMARY. They can be assigned to different contacts. | Roles for the contact in this order:
|
hillLabsContactId | string | Optional. Supply this identifier or the complete lookup set below. | Unique Hill Labs identifier for the contact. |
firstName | string | Required when hillLabsContactId is not supplied. | Contact’s first name. Used with |
lastName | string | Required when hillLabsContactId is not supplied. | Contact’s last name. Used with |
email | string | Required when hillLabsContactId is not supplied. | Contact’s email address. Used with |
Address
Provides delivery or invoice address details and identifies how each address is used.
| Field | Value type | Validation | Description |
|---|---|---|---|
address1 | string | Required. Maximum 40 characters. | First line of the address. |
address2 | string | Optional. Maximum 40 characters. | Second line of the address, if needed. |
city | string | Required. Maximum 40 characters. | City or town. |
postCode | string | Required. Maximum 10 characters. | Postcode for the address. |
country | string | Required. Maximum 40 characters. | Country for the address. |
orderRoles | array | Required when supplied. Include DELIVERY when a Sampling Supplies order line is present. INVOICE is optional. | Roles describing how the address is used:
|
Order line types
The lines array accepts 1–200 items. Each item uses one of the supported order-line structures shown in the request map above.
| Field | Value type | Validation | Description |
|---|---|---|---|
samplingSupplies | object | — | Order line for a product from the Hill Labs catalogue. It contains an item code and quantity. |
sample | object | — | Order line for a sample and the analytical tests to perform on it. |
sampleComposite | object | — | Composite order line that names the samples to combine and the analytical tests to perform. |
Sampling supplies
Adds a product from the Hill Labs catalogue to the order.
| Field | Value type | Validation | Description |
|---|---|---|---|
code | string | Required. Maximum 32 characters. | Hill Labs catalogue item code for the product. |
quantity | number | Required. Maximum value: 100. | Quantity of the product to order. |
Sample
Describes a sample and the identifiers, collection details, containers and tests associated with it.
| Field | Value type | Validation | Description |
|---|---|---|---|
name | string | Required. Maximum 255 characters. | Textual identifier for the sample. |
clientSampleId | string | Optional. Maximum 255 characters. | Additional sample identifier included in results. |
dateTime | string | Optional. UTC timestamp in ISO format: yyyy-mm-ddThh:mm:ss.ffffff. | Date and time when the sample was collected. |
sampleType | object | Required. | Defines the substance to be tested. |
location | object | Optional. | Location where the sample was collected:
|
references | array | Optional. | References to include in results published by the API. |
containers | array | Optional. | One or more containers for the sample. |
analyticalTests | array | Required. Include at least one analytical test. | Analytical tests to perform on the sample. |
sampleParameters | array | Optional. Currently supported for UMFCert only. Do not send for other test codes. | Parameters for a supported analytical test. Ask your Hill Labs contact during onboarding about support for additional tests. |
Sample type
Identifies the substance being tested and any attributes needed to describe it.
| Field | Value type | Validation | Description |
|---|---|---|---|
sampleTypeCode | string | Required. | Hill Labs Sample Type Code that defines the substance type of the sample. |
sampleAttributes | array | Optional. Invalid attribute pairs cause the order to fail. | Name and value pairs that describe attributes for the sample type being tested. |
Sample attribute
Provides a name and value for an attribute of the selected sample type.
| Field | Value type | Validation | Description |
|---|---|---|---|
attributeName | string | Required when an attribute value is supplied. Must not be null or blank. Maximum 100 characters. | Label or identifier for the attribute. |
attributeValue | string | Required when an attribute name is supplied. May be null or blank. Maximum 100 characters. | Value of the attribute. |
Location
Records where a sample was collected as a point or an intersect, with an optional location name.
| Field | Value type | Validation | Description |
|---|---|---|---|
point.latitudeor intersect[].latitude | number | Optional. Required when a matching longitude value is supplied. | Latitude coordinate for a point or intersect location. |
point.longitudeor intersect[].longitude | number | Optional. Required when a matching latitude value is supplied. | Longitude coordinate for a point or intersect location. |
name | string | Optional. Maximum 50 characters. | Name for the location. |
Sample reference
Adds a customer-defined reference to the sample for inclusion in results published by the API.
| Field | Value type | Validation | Description |
|---|---|---|---|
name | string | Maximum 30 characters. | Name of the sample reference. |
value | string | Maximum 64 characters. | Value of the sample reference. |
Container and barcode
Defines the barcode format and value associated with a sample container.
| Field | Value type | Validation | Description |
|---|---|---|---|
barcode | object | — | Barcode details associated with the container. |
type | string | Required when a barcode value is supplied. | Barcode format. |
value | string | Required when a barcode type is supplied. | Barcode value. |
Analytical test
Identifies a Hill Labs catalogue test to perform on a sample.
| Field | Value type | Validation | Description |
|---|---|---|---|
code | string | Required. Maximum 32 characters. | Hill Labs analytical test catalogue item code that identifies the test to perform on the sample. |
Sample parameter
Supplies a parameter code and value for a supported test. Current support is limited to UMFCert.
| Field | Value type | Validation | Description |
|---|---|---|---|
parameterCode | string | Required. Between 1 and 255 characters. | Code for a sample parameter, such as |
parameterValue | string or number | Required. String values can contain up to 255 characters. | Value for the sample parameter, such as |
Example Submissions
Use these examples as starting points for common order submissions.
Generic Use Cases
A single sample, in a barcoded container, requesting an Analytical Test
Order Submission – Single Sample, Single Test
{
"orderReferences":[
{
"name":"ClientRef",
"value":"Test"
}
],
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION",
"CHARGE_TO"
],
"contacts":[
{
"orderRoles":[
"PRIMARY",
"SUBMITTER"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
],
"addresses":[
{
"address1":"1023 Rocky Road",
"city":"Smalltown",
"country":"New Zealand",
"postCode":"1234",
"orderRoles":[
"INVOICE"
]
}
]
}
],
"notes":"Single Sample, Single Test Example",
"lines":[
{
"sample":{
"name":"Selenium",
"sampleType":{
"sampleTypeCode":"P3",
"sampleAttributes":[
]
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242128"
}
}
],
"analyticalTests":[
{
"code":"Se"
}
]
}
}
]
}
An order for Supplied Items
Order Submission – Supplied Item
{
"orderReferences":[
{
"name":"ClientRef",
"value":"Test001"
}
],
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION"
],
"contacts":[
{
"orderRoles":[
"SUBMITTER",
"PRIMARY"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
]
}
],
"notes":"My notes to the lab",
"lines":[
{
"samplingSupplies":{
"code":"HoneyKit",
"quantity":10
}
},
{
"samplingSupplies":{
"code":"BagsP",
"quantity":5
}
}
]
}
An order with multiple references
Order Submission – Multiple order references
{
"orderReferences":[
{
"name":"PreRegReference",
"value":"my pre-reg reference"
},
{
"name":"ClientRef",
"value":"my client reference"
},
{
"name":"AdditionalClientRef",
"value":"additional reference"
},
{
"name":"ClientOrderNr",
"value":"my order number"
},
{
"name":"QuoteNr",
"value":"140648"
}
],
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION",
"CHARGE_TO"
],
"contacts":[
{
"orderRoles":[
"PRIMARY",
"SUBMITTER"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
],
"addresses":[
{
"address1":"1023 Rocky Road",
"city":"Smalltown",
"country":"New Zealand",
"postCode":"1234",
"orderRoles":[
"INVOICE"
]
}
]
}
],
"notes":"",
"lines":[
{
"sample":{
"name":"Selenium",
"sampleType":{
"sampleTypeCode":"P3",
"sampleAttributes":[
]
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242128"
}
}
],
"analyticalTests":[
{
"code":"Se"
}
]
}
}
]
}
An order with multiple sample references
Order Submission – Multiple sample references
{
"orderReferences":[
{
"name":"ClientRef",
"value":"Test"
}
],
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION",
"CHARGE_TO"
],
"contacts":[
{
"orderRoles":[
"PRIMARY",
"SUBMITTER"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
],
"addresses":[
{
"address1":"1023 Rocky Road",
"city":"Smalltown",
"country":"New Zealand",
"postCode":"1234",
"orderRoles":[
"INVOICE"
]
}
]
}
],
"notes":"",
"lines":[
{
"sample":{
"name":"Sample 1",
"clientSampleID":"My client sample ID value",
"references":[
{
"name":"SampleRef1",
"value":"My sample reference 1"
},
{
"name":"SampleRef2",
"value":"My sample reference 2"
}
],
"sampleType":{
"sampleTypeCode":"HoneyD",
"sampleAttributes":[
]
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"33194719211"
}
}
],
"analyticalTests":[
{
"code":"Honey3in1"
}
]
}
}
]
}
An order for an Analytical Test with a sample spanning two containers
Order Submission – Multiple containers for a sample
{
"orderReferences":[
{
"name":"ClientRef",
"value":"Test"
}
],
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION",
"CHARGE_TO"
],
"contacts":[
{
"orderRoles":[
"PRIMARY",
"SUBMITTER"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
],
"addresses":[
{
"address1":"1023 Rocky Road",
"city":"Smalltown",
"country":"New Zealand",
"postCode":"1234",
"orderRoles":[
"INVOICE"
]
}
]
}
],
"notes":"",
"lines":[
{
"sample":{
"name":"Selenium",
"sampleType":{
"sampleTypeCode":"P3",
"sampleAttributes":[
]
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242128"
}
},
{
"barcode":{
"type":"LINEAR",
"value":"331000242130"
}
}
],
"analyticalTests":[
{
"code":"Se"
}
]
}
}
]
}
An order for Analytical Tests with spatial data, Sampling Supply Items and providing a delivery address
Order Submission – Analytical Test & Sampling Supplies, giving delivery address
{
"orderReferences":[
{
"name":"ClientRef",
"value":"my client reference"
}
],
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION"
],
"contacts":[
{
"orderRoles":[
"SUBMITTER",
"PRIMARY"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
],
"addresses":[
{
"address1":"1023 Rocky Road",
"city":"Smalltown",
"country":"New Zealand",
"postCode":"1234",
"orderRoles":[
"DELIVERY"
]
}
]
}
],
"notes":"My notes to the lab",
"lines":[
{
"sample":{
"name":"Test1",
"sampleType":{
"sampleTypeCode":"P162"
},
"dateTime":"2018-06-15T20:16:30.449Z",
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242126"
}
}
],
"location":{
"point":{
"latitude":-37.734485,
"longitude":175.401761
},
"name":"Silage Shed 1, Bale 3"
},
"analyticalTests":[
{
"code":"Silage"
}
]
}
},
{
"sample":{
"name":"Test2",
"sampleType":{
"sampleTypeCode":"P162"
},
"dateTime":"2018-06-15T20:16:30.449Z",
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"033154024555"
}
}
],
"location":{
"point":{
"latitude":-37.734485,
"longitude":175.401761
},
"name":"Silage Shed 1, Bale 8"
},
"analyticalTests":[
{
"code":"Silage"
}
]
}
},
{
"sample":{
"name":"Test3",
"sampleType":{
"sampleTypeCode":"S180",
"sampleAttributes":[
{
"attributeName":"Depth (mm)",
"attributeValue":"0-150"
},
{
"attributeName":"Soil Type",
"attributeValue":"Peat"
}
]
},
"dateTime":"2018-06-15T20:16:30.449Z",
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242127"
}
}
],
"location":{
"intersect":[
{
"latitude":-37.734485,
"longitude":175.401761
},
{
"latitude":-37.97516,
"longitude":175.39941
}
],
"name":"Paddock F, line 2"
},
"analyticalTests":[
{
"code":"BS"
},
{
"code":"B"
},
{
"code":"AN"
}
]
}
},
{
"samplingSupplies":{
"code":"SoilBagPack100",
"quantity":25
}
},
{
"samplingSupplies":{
"code":"AugAg",
"quantity":1
}
}
]
}
An order using hillLabsAccountId and hillLabsContactId
Order Submission – hillLabsAccountId and hillLabsContactId
{
"orderReferences": [
{
"name": "ClientRef",
"value": "ABC12345"
}
],
"organisations": [
{
"orderRoles": ["OWNER"],
"contacts": [
{
"hillLabsContactId": "f757adc8-59b8-11ef-91d2-00505687e13a",
"orderRoles": ["PRIMARY"]
},
{
"hillLabsContactId": "f757adc8-59b8-11ef-91d2-00505687e13a",
"orderRoles": ["SUBMITTER"]
}
]
},
{
"hillLabsAccountId": "c1414a4a-a856-11ef-a6c4-00505687e13a",
"orderRoles": ["CLIENT", "CHARGE_TO"]
}
],
"notes": "Single sample test order for demonstration purposes.",
"orderLines": [
{
"sample": {
"name": "Paddock A - Topsoil",
"sampleType": {
"sampleTypeCode": "S6"
},
"containers": [
{
"barcode": {
"type": "LINEAR",
"value": "012345678901"
}
}
],
"references": [
{
"name": "Reference",
"value": "Demo"
}
],
"analyticalTests": [
{
"code": "Maize"
}
],
"sampleParameters": [
{
"parameterCode": "SType",
"parameterValue": "Peat"
},
{
"parameterCode": "Depth",
"parameterValue": "0-150"
}
]
}
}
]
}
Request for Composite Testing
Order submissions for Analytical Tests with composites
- Currently, you can use composite testing only for Tutin and Meth
Order Submission – Analytical Test with composites – Meth
{
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION",
"CHARGE_TO"
],
"contacts":[
{
"orderRoles":[
"PRIMARY",
"SUBMITTER"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
]
}
],
"notes":"Meth Comp",
"lines":[
{
"sample":{
"name":"SAMPLE 1",
"sampleType":{
"sampleTypeCode":"cMiscWipe"
}
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242128"
}
}
]
},
{
"sample":{
"name":"SAMPLE 2",
"sampleType":{
"sampleTypeCode":"cMiscWipe"
}
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242128"
}
}
]
},
{
"sample":{
"name":"SAMPLE 3",
"sampleType":{
"sampleTypeCode":"cMiscWipe"
}
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242128"
}
}
]
},
{
"sample":{
"name":"SAMPLE 4",
"sampleType":{
"sampleTypeCode":"cMiscWipe"
}
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242128"
}
}
]
},
{
"sampleComposite":{
"samples":[
"SAMPLE 1",
"SAMPLE 2",
"SAMPLE 3",
"SAMPLE 4"
],
"name":"",
"analyticalTests":[
{
"code":"Meth_CompR"
}
]
}
}
]
}
Order Submission – Analytical Test with composites – Honey
{
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION",
"CHARGE_TO"
],
"contacts":[
{
"orderRoles":[
"PRIMARY",
"SUBMITTER"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
]
}
],
"notes":"Honey Comp",
"lines":[
{
"sample":{
"name":"SAMPLE 1",
"sampleType":{
"sampleTypeCode":"HoneyD"
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242126"
}
}
]
}
},
{
"sample":{
"name":"SAMPLE 2",
"sampleType":{
"sampleTypeCode":"HoneyD"
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242127"
}
}
]
}
},
{
"sample":{
"name":"SAMPLE 3",
"sampleType":{
"sampleTypeCode":"HoneyD"
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242128"
}
}
]
}
},
{
"sample":{
"name":"SAMPLE 4",
"sampleType":{
"sampleTypeCode":"HoneyD"
},
"containers":[
{
"barcode":{
"type":"LINEAR",
"value":"331000242129"
}
}
]
}
},
{
"sampleComposite":{
"samples":[
"SAMPLE 1",
"SAMPLE 2",
"SAMPLE 3",
"SAMPLE 4"
],
"name":"",
"analyticalTests":[
{
"code":"TutinComp_RLP"
}
]
}
}
]
}
Request for Honey UMF Certificate
Honey Analytical Test with sample parameters
{
"organisations":[
{
"orderRoles":[
"PRIMARY_ORGANISATION",
"CHARGE_TO"
],
"contacts":[
{
"orderRoles":[
"PRIMARY",
"SUBMITTER"
],
"lastName":"Smith",
"firstName":"John",
"email":"my.email@mybusiness.com"
}
]
}
],
"notes":"Honey UMFCert with sample parameters",
"lines": [
{
"sample": {
"name": "SAMPLE 1",
"sampleType": {
"sampleTypeCode": "HoneyD"
},
"containers": [
{
"barcode": {
"type": "LINEAR",
"value": "331000242126"
}
}
],
"analyticalTests": [
{
"code": "UMFCert"
}
],
"sampleParameters": [
{
"parameterCode": "UMFLicence",
"parameterValue": "9999"
},
{
"parameterCode": "BatchNumber",
"parameterValue": "9999"
},
{
"parameterCode": "ExpectedGrade",
"parameterValue": "50"
},
{
"parameterCode": "BatchWeight",
"parameterValue": "9999"
},
{
"parameterCode": "BestBefore",
"parameterValue": "99"
}
]
}
}
]
}
Example Response
When your submission succeeds, the API returns an orderId. Here is an example:
Order Response
{
"orderId": 989
}
Possible Responses
| Code | Description | When |
|---|---|---|
| 200 | Order request accepted | Your request passes validation and the API returns an orderId for processing. |
| 400 | Bad Request | The request body or order data is invalid, or it includes the unsupported PatientId field. Review the response messages and correct your request. |
| 401 | Unauthorized | Your access token is invalid or expired, the API cannot find your client user or your organisation/agent details fail validation. Check your credentials and account configuration. |
| 500 | Internal Server Error | An unexpected error occurs while validating or submitting your order. Try again later and contact the Hill Labs support team if it continues. |