Create, update or delete a company license

distru-mutate-company-licenseWrite

Creates, updates or deletes one license of a customer or vendor company.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
actionenum
CREATEUPDATEDELETE
Yes
idstringNoRequired for UPDATE and DELETE. Resolve via distru-get-company (includeLicenses).
companyIdstringNoRequired for CREATE; cannot change afterwards. The customer or vendor, not your own company. Resolve via distru-search-companies.
licenseNumberstringNoRequired for CREATE. Unique within the company; not checked against Metrc.
licenseTypestringNoRequired for CREATE. Resolve via distru-search-lookups (type LICENSE_TYPE).
expiryDatetimestringNoRequired for CREATE. ISO 8601 with a UTC offset, e.g. "2026-09-01T00:00:00-07:00"; the company timezone is on distru-get-me.
issueDatetimestring or nullNoWhen it was issued. ISO 8601 with a UTC offset, e.g. "2026-09-01T00:00:00-07:00"; the company timezone is on distru-get-me. Send null to clear it.
isActivebooleanNoCREATE defaults to true.

Output

This tool returns one of 2 shapes, depending on its inputs.

Presence on a nested field assumes its parent exists.

Result with license

FieldTypePresence
licenseobjectAlways
license.idstringAlways
license.licenseNumberstringAlways
license.licenseTypestringAlways
license.complianceTypeenum
BIOTRACKMETRCNONE
Always
license.isActivebooleanAlways
license.issueDatetimestringNull or absent
license.expiryDatetimestringAlways

Result with id

FieldTypePresence
idstringAlways
What the AI reads

Creates, updates or deletes one license of a customer or vendor company. The license is never synced with Metrc. Read current values with distru-get-company first (includeLicenses). Your own company's licenses can't be changed here; they are managed in Settings → Licenses. DELETE removes the license for good; refused while a location is linked to it (unlink or delete the location with distru-mutate-company-location first). CREATE and UPDATE return the license as distru-get-company does; DELETE returns its id. Sparse update: UPDATE changes only the fields sent; a field sent as null is cleared.