Get packages
Get packages sorted by their creation date and filtered by various attributes
This endpoint returns eventually consistent data, with changes taking up to 1 second to propagate in responses.
Required permission: products_permissions_view. Results are filtered to only include packages the authenticated user can access under their team restrictions.
Query parameters
Filter by creation datetime, given as an inclusive after,before range of ISO 8601 timestamps separated by a comma. Either bound may be left empty: after, keeps only packages created on or after after; ,before only those created on or before before; after,before keeps those inside the closed range. A range with both bounds empty is rejected.
Page selector. Page size is fixed by the server; paginate by following the next_page URL in each response rather than building page selectors yourself — it is null on the last page. next_page uses page[after]=<cursor>, an opaque token marking where the next page resumes; pass it back exactly as given, and only to the endpoint that issued it. This is seek-based, so every page stays fast no matter how deep you page.
Keep only packages currently stored in any of these Distru location IDs (matches the location.id string in a package). Combined with the other filters by AND; multiple ids inside this filter are OR-ed. Ids that do not resolve to one of your locations simply match nothing.
Keep only packages whose license has exactly this license number (exact string match, not a substring).
Filter packages by package ID (the same string as each package's id in responses). Multiple ids are OR-ed. Values that do not decode to a known package id match no rows.
Keep only packages of any of these product IDs (matches a package's product_id). Multiple ids are OR-ed.
Keep only packages in any of these Distru statuses (multiple values are OR-ed). Case-insensitive. If any value is not one of the statuses below, the filter matches no rows. Allowed values: • ACTIVE — active in both Distru and the compliance system • ASSEMBLING — fully consumed by a pending assembly • DESTROYED — destroyed (BioTrack only; Metrc packages never reach this) • DISCONTINUED — discontinued in Metrc • FINISHED — finished (quantity 0) • ONHOLD — on hold in Metrc (Metrc only) • RETURNING — tied to a Metrc return that has shipped • SELLING — assigned to a Distru sales order • SOLD — sold on a Metrc-enabled sales order • TRANSFERRED — transferred out of its Metrc license
Note: the status field in responses is returned lowercase (e.g. active); this filter accepts either case. (The old statuses filter name still works but is deprecated.)
When true, each package in the response also carries its cost fields (total_cost_actual, total_cost_default, cost_per_unit_actual, cost_per_unit_default). Omitted or false leaves those fields out of the response entirely. These cost fields are available only on this list endpoint; the single-package GET (/packages/{id}) never returns them, so it is not a superset of the list.
Filter by last-modified datetime, given as an inclusive after,before range of ISO 8601 timestamps separated by a comma, with the same empty-bound rules as inserted_datetime.
Filter by custom field values, as custom_data[{id}]=value where {id} is a custom field's numeric id. Repeat with different ids to filter on several fields at once; a record must match every one (AND). Matching is case-sensitive exact against the value stored on the record. The id must be a filterable custom field defined on this entity — use GET /public/v1/custom-fields?parent_object=package to list the ids, their types, and which are filterable. A non-numeric id, an id not defined on this entity, or an id that isn't filterable returns a 400.
Case-insensitive substring match on the package's compliance_label.
Keep only packages whose compliance_label exactly matches (case-sensitive) any value in the list — send labels exactly as they appear in responses. Multiple values are OR-ed.
Case-insensitive substring match on the package's batch_number.
Keep only packages whose batch_number exactly matches (case-sensitive) any value in the list — send batch numbers exactly as they appear in responses. Multiple values are OR-ed.
Case-insensitive substring match on the package's compliance_product_name.
Keep only packages whose compliance_product_name exactly matches (case-insensitive) any value in the list. Multiple values are OR-ed.
Keep only packages whose license is any of these Distru license IDs (matches a package's license_id). Multiple ids are OR-ed; ids that do not resolve match nothing.
Keep only packages stored in any of these bins (matches an id in a package's bins[].id). Multiple ids are OR-ed.
Keep only packages owned by any of these users (matches a package's owner.id). Multiple ids are OR-ed.
Keep only packages with any of these unit types (matches a package's unit_type.id). Multiple ids are OR-ed.
Keep only packages whose product is in any of these categories (matches the package's product.category.id). Multiple ids are OR-ed.
Keep only packages whose product is in any of these subcategories (matches the package's product.subcategory.id). Multiple ids are OR-ed.
Keep only packages whose product is in any of these groups (matches the package's product.product_group.id). Multiple ids are OR-ed.
Keep only packages whose product has any of these brands (matches the package's product.brand.id). Multiple ids are OR-ed.
Keep only packages whose product is supplied by any of these vendors (matches the package's product.vendor.id; this is the company-relationship ID, not the raw company ID). Multiple ids are OR-ed.
Keep only packages whose product has any of these strains (matches the package's product.strain.id). Multiple ids are OR-ed.
Keep only packages whose product carries any of these tags (matches an id in the package's product.tags[].id). Multiple ids are OR-ed.
Keep only packages whose product SKU exactly matches (case-insensitive) any value in the list (matches the package's product.sku). Multiple values are OR-ed.
Keep only packages whose lab_testing_state exactly equals this value (case-insensitive).
Keep only packages whose lab_testing_state is any of these values (case-insensitive, OR-ed).
Filter by the package's expiration_datetime, given as an inclusive after,before range of ISO 8601 timestamps separated by a comma, with the same empty-bound rules as inserted_datetime.
Filter by the package's finished_datetime, an inclusive after,before range of ISO 8601 timestamps separated by a comma, same empty-bound rules as inserted_datetime.
Filter by the package's inactivated_datetime, an inclusive after,before range of ISO 8601 timestamps separated by a comma, same empty-bound rules as inserted_datetime.
Filter by the package's harvest_date, given as an inclusive after,before range of YYYY-MM-DD dates separated by a comma. Either bound may be empty; both empty is rejected.
Filter by the package's packaged_date, an inclusive after,before range of YYYY-MM-DD dates separated by a comma, same empty-bound rules as harvest_date.
Keep only test-sample (true) or non-test-sample (false) packages. Omit to match either.
Keep only trade-sample (true) or non-trade-sample (false) packages. Omit to match either.
Keep only production-batch (true) or non-production-batch (false) packages. Omit to match either.
Keep only packages that currently hold active quantity (true, quantity_active > 0) or none (false, quantity_active = 0). Omit to match either.
Keep only packages whose primary lab result has a file attached (true) or does not (false) — i.e. whether a downloadable COA exists. Omit to match either.
Keep only packages that contain remediated material (true) or do not (false). Omit to match either.
Response
A list of packages
Changes
No recorded changes to this endpoint across all 1 revision of this API.