Search lab test results

distru-search-test-resultsRead

Searches lab test results — the potency records a COA file can be attached to.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
limitintegerNoDefault: 10
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.
batchIdsstring[]NoFilter to results that apply to any of these batches: uploaded to the batch or inherited from the batches it was assembled from. Resolve via distru-search-batches.
packageIdsstring[]NoFilter to results that apply to any of these packages: uploaded to the package or inherited from the packages it was split or assembled from. Resolve via distru-search-packages.
productIdsstring[]NoFilter to results uploaded to a batch or package of any of these products, not ones they only inherited (use batchIds / packageIds for those). Resolve via distru-search-products.
sortByobjectNoSort options. Defaults to most recently updated first when omitted.
sortBy.directionenum
ASCDESC
Yes
sortBy.fieldenum
INSERTED_ATNAMEUPDATED_AT
YesField to sort by. NAME orders by the test result name.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].labNamestringCan be null
items[].releaseDatestringCan be null
items[].thcPercentagestringCan be null
items[].thcPercentageTotalstringCan be null
items[].cbdPercentagestringCan be null
items[].cbdPercentageTotalstringCan be null
items[].batchobjectCan be null
items[].batch.idstringAlways
items[].batch.namestringAlways
items[].batch.batchNumberstringCan be null
items[].packageobjectCan be null
items[].package.idstringAlways
items[].package.metrcLabelstringAlways
What the AI reads

Searches lab test results — the potency records a COA file can be attached to. Returns one row per result: name, lab name, release date, THC %, total THC %, CBD % and total CBD % (each null when not recorded), and where the result was uploaded: `batch` or `package`, the other one null. `package` is often a lab sample package split off for testing; the result then also applies to the package it was split from, unless the sample was made outside Distru. A result also applies to the packages and batches made from the one it was uploaded to, so batchIds / packageIds can return results uploaded elsewhere. A result uploaded to a package never applies to a batch, not even the package's own. If the user's teams can't see every batch and package: batchIds / packageIds skip the ones they can't see and return every result applying to the rest; without those filters only results uploaded to a batch or package they can see are returned, even if a result also applies to a visible one. `batch` / `package` is null when the user's teams can't see it. Results default to most recently updated first. Requires authentication via Authorization header.