Package

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.

get/public/v1/packages

Query parameters

inserted_datetimestring

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.

pagestring

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.

location_idsstring[]

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.

license_numberstring

Keep only packages whose license has exactly this license number (exact string match, not a substring).

idsstring[]

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.

product_idsstring[]

Keep only packages of any of these product IDs (matches a package's product_id). Multiple ids are OR-ed.

distru_statusesstring[]

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.)

include_costsboolean

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.

updated_datetimestring

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.

custom_dataobject

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.

compliance_labelstring

Case-insensitive substring match on the package's compliance_label.

compliance_labelsstring[]

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.

batch_numberstring

Case-insensitive substring match on the package's batch_number.

batch_numbersstring[]

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.

compliance_product_namestring

Case-insensitive substring match on the package's compliance_product_name.

compliance_product_namesstring[]

Keep only packages whose compliance_product_name exactly matches (case-insensitive) any value in the list. Multiple values are OR-ed.

license_idsstring[]

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.

bin_idsstring[]

Keep only packages stored in any of these bins (matches an id in a package's bins[].id). Multiple ids are OR-ed.

owner_idsstring[]

Keep only packages owned by any of these users (matches a package's owner.id). Multiple ids are OR-ed.

unit_type_idsstring[]

Keep only packages with any of these unit types (matches a package's unit_type.id). Multiple ids are OR-ed.

product_category_idsstring[]

Keep only packages whose product is in any of these categories (matches the package's product.category.id). Multiple ids are OR-ed.

product_subcategory_idsstring[]

Keep only packages whose product is in any of these subcategories (matches the package's product.subcategory.id). Multiple ids are OR-ed.

product_group_idsstring[]

Keep only packages whose product is in any of these groups (matches the package's product.product_group.id). Multiple ids are OR-ed.

product_brand_idsstring[]

Keep only packages whose product has any of these brands (matches the package's product.brand.id). Multiple ids are OR-ed.

product_vendor_idsstring[]

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.

product_strain_idsstring[]

Keep only packages whose product has any of these strains (matches the package's product.strain.id). Multiple ids are OR-ed.

product_tag_idsstring[]

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.

product_skusstring[]

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.

lab_testing_statestring

Keep only packages whose lab_testing_state exactly equals this value (case-insensitive).

lab_testing_statesstring[]

Keep only packages whose lab_testing_state is any of these values (case-insensitive, OR-ed).

expiration_datetimestring

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.

finished_datetimestring

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.

inactivated_datetimestring

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.

harvest_datestring

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.

packaged_datestring

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.

is_test_sampleboolean

Keep only test-sample (true) or non-test-sample (false) packages. Omit to match either.

is_trade_sampleboolean

Keep only trade-sample (true) or non-trade-sample (false) packages. Omit to match either.

is_production_batchboolean

Keep only production-batch (true) or non-production-batch (false) packages. Omit to match either.

has_quantity_activeboolean

Keep only packages that currently hold active quantity (true, quantity_active > 0) or none (false, quantity_active = 0). Omit to match either.

has_coa_attachedboolean

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.

contains_remediated_materialboolean

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.