Upsert a location
Changed onUpsert a single location belonging to your own company — one POST handles both create and update. Include an existing location id in the body to update that location, or omit id to create a new one. The create path returns 201 and the update path returns 200; either way the response body is the full location, including its geocoded latitude/longitude. Locations written here are the ones returned by GET /public/v1/locations and referenced across the API: • a purchase receives inventory into a location, and an order ships from one • every package sits at a location, and can be moved from one location to another • inventory quantities are always tracked per location • an assembly claims its inputs and produces its outputs at locations • stock adjustments add or remove inventory at a location
To manage the locations of your partner companies instead, use POST /public/v1/companies/{id}/locations.
latitude and longitude cannot be sent — they are derived by geocoding the address, because Distru uses these coordinates to generate directions for transfer templates and to optimize delivery routes. Since those features require coordinates, an address that cannot be geocoded is rejected: nothing is saved and the request returns 400 (correct the address fields and retry). If the geocoding service itself is temporarily unavailable the request returns 503 — the address may be fine; retry later. Previously geocoded addresses resolve without contacting the geocoding service.
Any location that will hold cannabis inventory must be associated with one of your licenses via license_id — compliance is tracked per license, so a location without one is only suitable for non-regulated items. Choose the license carefully: once a location is linked to a Metrc or BioTrack license, the link is permanent — it can never be changed or cleared. Only links to Distru-only licenses (compliance_type NONE) can be swapped or removed later.
This endpoint never writes to Metrc: it does not create Metrc rooms, and metrc_id is read-only — it stays null unless the location is synced through the Distru app. Linking the first location to a Metrc license that cannot assign locations to plant batches auto-assigns that location as the license's intake location.
Companies with a BioTrack integration cannot manage locations through the API at all — their requests return a 400, because BioTrack locations require room configuration and syncing this endpoint does not support.
Updates are sparse: only the fields you send are changed, any field you omit keeps its current value, and sending null for a nullable field clears it (a required field rejects null with a 400). Changing any address field re-geocodes the location and refreshes its coordinates.
Required permission: companies_permissions_create to create a location, companies_permissions_edit to update an existing one.
Request
- Base URLhttps://app.distru.com
- AuthHTTP bearer
Request body
Response
An updated location
Example response
{
"data": {
"address": "1234 Warehouse Street, Oakland, CA",
"company_id": "02c88a3f-d759-4973-88f9-60049d682524",
"id": "02c88a3f-d759-4973-88f9-60049d682524",
"license": {
"id": "02c88a3f-d759-4973-88f9-60049d682524",
"license_number": "C11-1234567890"
},
"license_id": "02c88a3f-d759-4973-88f9-60049d682524",
"name": "Warehouse 1"
}
}Changes
- info
endpoint added
- info