Skip to navigation

Submission

View as Markdown

Create a submission

Create one submission containing individual samples and optional composites. Each composite has its own fields and tests and refers to individual samples by their client references.

Request: POST https://one.mtxsci.com/api/1.1/wf/submission-v2

Success: 200 OK with a JSON body containing sample_submission_id and status. The recorded response media type is text/plain;charset=utf-8.

Authentication: Authorization: Bearer <token>, using response.token from authenticate-v2.

Headers: Content-Type: application/json and Accept: application/json.

Request body: JSON containing submission fields, individual samples, and optional composites.

Before you submit

Obtain the lab enum supplied to the customer and the applicable catalog endpoints. The saved request uses type placeholders instead of real values. Replace them with authorized values before sending.

Submission fields

FieldTypeRequirementDescription
customer_idStringRequiredAuthorized customer from customers-v2; identifies the division or plant.
requested_byString or nullCaller-derivedRequester identifier, such as an email address. null derives the requester from the authenticated caller. Arbitrary caller identities require authorization.
labStringRequiredExact value from the lab enum supplied to the customer.
po_numberString or nullOptionalPurchase order reference; preserve leading zeros.
submission_typeStringRequiredExactly Product or Environmental.
additional_infoString or nullOptionalSubmission-level information.
special_instructionsString or nullOptionalSubmission-level instructions.
samplesArray of objectsAt least oneIndividual samples, declared once each.
compositesArray of objectsOptionalComposite definitions; omit or supply an empty array when none are needed.

Sample and composite fields

These fields apply to each object in both samples and composites. Composite values are independent of the values on their members.

FieldTypeRequirementDescription
client_sample_refStringRequiredNonempty reference, unique across both arrays within this submission. May repeat in different submissions; store with the corresponding external sample record.
descriptionString or nullDescription of this individual sample or composite.
product_idStringRequired for samples and compositesProduct ID from product-ids-v2.
product_descString or nullProduct description. Read responses use prodDescription instead.
lotString or nullLot reference, preserved as text.
collection_dateString or nullDate in YYYY-MM-DD format, without an inferred timezone.
request_numberString or nullClient request reference, distinct from the generated sample_submission_id.
site_idString or nullOptionalSite ID from sites-v2, not its name. Preserve numeric-looking IDs as strings, such as "4".
emp_zoneString or nullOptionalEMP zone encoded as a string, matching the saved request. Omit or use null when blank.
testsArray of stringsTests for this row’s material, as exact test codes (the code field of tests-v2) rather than test descriptions.
client_sample_refsArray of stringsRequired for compositesComposite-only membership list, referencing samples[].client_sample_ref.

Optional nullable fields may be omitted or sent as null.

Environmental site and zone behavior

site_id and emp_zone are optional for both submission types. For an Environmental row with a supplied site_id and omitted or null emp_zone, the application looks up the zone from that site’s existing information. A composite uses its own site; its zone is not inferred from its members. Neither field becomes required when no site is supplied.

Composite membership and tests

  • Declare each individual sample once in samples.

  • Each composite has its own unique client_sample_ref and a nonempty client_sample_refs membership list.

  • Members must reference individual samples in this request. Missing references, self references, composite references, and duplicate members within one composite are rejected.

  • A sample may belong to several composites.

  • Composite tests apply to the combined material independently of tests on individual samples and other composites. Do not add tests to constituents unless this is the desired outcome.

Response fields

FieldTypeDescription
sample_submission_idStringServer-generated submission identifier. Store beside your internal request identifier; use it as the sample_submission_id filter on samples-v2 and results-v2.
statusString"Success" in the saved acceptance response. Preserve the capital S.

The 200 OK example is {"sample_submission_id":"string","status":"Success"}. Check that status is "Success" before recording acceptance. Authentication uses lowercase "success" in its own response.

Samples and composites are created after acceptance and can take up to five minutes to appear. Wait at least five minutes before querying with both customer_id and sample_submission_id. The response does not return per-sample identifiers. Webhook SampleSubmissionID refers to the submission saved from this response; correlate samples using client_sample_ref within that submission.

Customer mappings

Use Matrix test codes from tests-v2. A customer result name is not required in the request. Maintain test mappings and Matrix test code plus analyte-to-result-name mappings in your own system, including the originally selected result name where a mapping is one-to-many.

Errors

Inspect both the HTTP response and submission status. The documented malformed-payload status is BLOCKING_ERROR; a full error response example is not supplied. Authentication failures return 401 Unauthorized; obtain a new token as needed. Reconcile an uncertain submission outcome before resending a creation request.

Authentication

AuthorizationBearer

Use response.token from authenticate-v2. response.expires is the lifetime in seconds (86400 = 24 hours).

Request

This endpoint expects an object.
customer_idstringRequired

Authorized customer from customers-v2; identifies the division or plant.

labstringRequired
Exact value from the lab enum supplied to the customer.
submission_typestringRequired

Exactly Product or Environmental.

sampleslist of objectsRequired
Individual samples, declared once each.
requested_bystring or nullOptional

Requester identifier, such as an email address. null derives the requester from the authenticated caller. Arbitrary caller identities require authorization.

po_numberstring or nullOptional

Purchase order reference; preserve leading zeros.

additional_infostring or nullOptional

Submission-level information.

special_instructionsstring or nullOptional

Submission-level instructions.

compositeslist of objectsOptional

Composite definitions; omit or supply an empty array when none are needed.

Response

OK