Introduction
Matrix Sciences Customer Portal API
Integrate customer catalogs, sample submissions, laboratory sample tracking, and test results with your own systems.
API reference
All request URLs use https://one.mtxsci.com/api/1.1/wf followed by the path below.
Authentication
Send POST https://one.mtxsci.com/api/1.1/wf/authenticate-v2 with Content-Type: application/json and your user’s credentials in the JSON body:
The saved response is:
Use response.token in the authorization header on every subsequent API request:
response.expires is the token lifetime in seconds: 86400 seconds is 24 hours. Authenticate again to obtain a new token when it expires. The authentication request itself does not require a Bearer token. In Postman, supply the returned token as the collection’s private local token value; requests inherit the collection’s Bearer authentication.
Customer selection
Call GET https://one.mtxsci.com/api/1.1/wf/customers-v2?page=1 with the Bearer token. Each customer includes company_name, division, customer_id, and lab. Select an authorized customer_id for the intended division or plant and keep the mapping to your own organizational identifiers in your system.
customer_id is required on all customer-scoped requests: include it in the query string for products, sites, tests, samples, and results, and in the JSON body for submissions. Authentication and customer discovery precede customer selection and do not take a customer_id.
Sample submission workflow
- Retrieve the authorized customer from customers-v2. Store the mapping between your division or plant and the Matrix
customer_id. - Retrieve tests-v2 for that customer and map your test identifiers to Matrix test
codevalues in your system. Retrieve product-ids-v2 and sites-v2 as needed. - Build the submission-v2 JSON body with the Matrix
customer_id, laboratory, product IDs, and Matrix test codes. Assign aclient_sample_refto every sample and composite and store it with the corresponding sample in your system. References must be unique across both arrays within one submission; they may repeat in different submissions. - Send the request. Check for
status: "Success"and store the returnedsample_submission_idalongside your internal request identifier. The authentication endpoint uses lowercase"success"; the submission example uses"Success". - Samples can take up to five minutes to appear after acceptance. Wait at least five minutes, then call samples-v2 or results-v2 with both
customer_idandsample_submission_id. Useclient_sample_refto match individual samples and composites to your records within that submission.
A customer result name is not required in the submission. Keep your result names and their Matrix test/analyte mappings in your own system. The saved request uses type placeholders; replace them with valid values, including distinct client references, before sending it.
Product specifications and customer items
product-ids-v2 returns product_ids[]. Each product has product_id, description, loc_code, and a specification object containing name, description, and items[]. Each item supplies item_number and item_name. Use these customer item codes to maintain the mapping to Matrix product IDs for specification management; submit the selected Matrix ID as product_id.
Results webhook workflow
Configure results delivery in the Customer Portal integrations module. The webhook’s shared secret is configured during setup and supplied in the agreed request header. Validate that header’s secret before accepting or processing the payload. Each secret is tied to a division or plant; use your stored secret-to-division mapping to identify its customer context. The webhook secret is separate from the Bearer token used for API requests.
- Use the webhook’s
SampleSubmissionIDto locate the internal request associated with thesample_submission_idsaved from submission creation. These field names have different casing in the webhook and API responses. - Within that submission, match samples to your records using
client_sample_ref. - Interpret test codes as the Matrix test codes used in the original submission. Maintain the mapping to your own test identifiers.
- Map each Matrix test code plus Matrix analyte to your result name. Where one pair maps to several result names, retain which name was originally requested with the submitted sample. For example, separate yeast or mold result names for 11 g and 25 g portions need that original context to select the correct destination field.
The results read response nests data at samples[].tests[].results[]: the test’s code identifies the Matrix test, and each result’s analyte identifies the analyte. Use the webhook’s configured payload field names when receiving events.
Pagination and data conventions
GET responses contain a string-valued page, a boolean hasNextPage, and a resource array (customers, product_ids, sites, tests, or samples). Start at page 1, preserve the customer and filters, and increment the requested page while hasNextPage is true. Stop when it is false.
Preserve exact field names, casing, and types. Identifiers and reported results are strings. Sample responses use sample_submission_id and client_sample_ref; submission inputs use product_id, product_desc, lot, and request_number, while read responses use productId, prodDescription, lotNo, and customerRequestNo.
The submission example represents emp_zone as a string; the site catalog represents emp_zone as an integer, and sample reads represent empZone as a string. Use the type documented for each payload. Date filters and submission collection dates use YYYY-MM-DD; read timestamps are strings. Preserve reported timestamps without assuming UTC.
Saved read and submission responses contain JSON recorded as text/plain;charset=utf-8; authentication returns application/json. Parse the JSON body accordingly. Response examples document the available structure and do not establish every possible status or error response.
