Submission
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
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.
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_refand a nonemptyclient_sample_refsmembership 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
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
Use response.token from authenticate-v2. response.expires is the lifetime in seconds (86400 = 24 hours).
Request
Authorized customer from customers-v2; identifies the division or plant.
Exactly Product or Environmental.
Requester identifier, such as an email address. null derives the requester from the authenticated caller. Arbitrary caller identities require authorization.
Purchase order reference; preserve leading zeros.
Submission-level information.
Submission-level instructions.
Composite definitions; omit or supply an empty array when none are needed.
