Metrc

Get Metrc locations

Changed on

Get the Metrc locations — the room/location definitions Distru caches from Metrc — across your licenses, filtered by various attributes. Results are ordered by Metrc's location id ascending and scoped to the company that owns the API key.

Each row mirrors a location as it exists in Metrc (name, location type, and which entity kinds it may hold), plus the owning license. Locations deleted in Metrc are included by default — use is_deleted to return only live or only deleted locations.

This is a read-only cache: it does not create, edit, or delete locations in Metrc. Data is eventually consistent — changes synced from Metrc can take up to ~1 second to appear here.

get/public/v1/metrc/locations

Request

  • Base URL
    https://app.distru.com
  • Auth
    HTTP bearer

Query parameters

license_idstring

Filter to locations belonging to this license, given as a Distru license resource ID (as returned by the licenses endpoint — not a Metrc or state license number). Omit to return locations across all of the company's licenses; a license ID that doesn't belong to your company simply returns no locations.

license_numberstring

Filter to locations belonging to the Metrc license with this license number (exact match, not a substring). A convenience alternative to license_id; combining the two is a 400. Unlike license_id, an unknown value is rejected — if your company has no Metrc license with this number the request fails with a 400.

searchstring

Filter to locations whose Metrc name contains this value (case-insensitive substring match against the location's name).

is_deletedboolean

Filter by whether the location is deleted in Metrc. true returns only deleted locations; false returns only live locations. Omit to return both.

idsinteger[]

Filter to locations with these Metrc location identifiers — Metrc's own integer IDs (the id in the response), not Distru IDs. Matches a location if its Metrc ID equals any of the listed values (OR semantics). An empty list is ignored (returns locations unfiltered by this parameter). At most 200 IDs may be given.

fetched_datetimestring

Filter by when Distru last fetched the location from Metrc (the fetched_datetime in the response). Accepts a comma-separated from,to range (ISO-8601 UTC); either side may be omitted, e.g. ,2022-07-10T00:00:00Z returns locations last fetched on or before that time.

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.

Response

A list of Metrc locations

next_pagestring

URL for the next page of results; null when there is no next page

Example response

{
  "data": [
    {
      "license": {
        "id": "02c88a3f-d759-4973-88f9-60049d682524",
        "license_number": "C11-1234567890"
      }
    }
  ]
}

Changes