Company

Upsert a company's license

Upsert a single license held by one of the companies in your CRM — one POST handles both create and update. Include an existing license id in the body to update that license, 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 license. The license also appears in the company's licenses array on the company endpoints, and the company can be found by its licenses via the license_number filter of GET /public/v1/companies; it is not returned by GET /public/v1/licenses, which lists only your own company's licenses.

This endpoint only manages the licenses of your partner companies: the {id} in the path must be a company in your CRM other than your own company. Your own company's licenses cannot be created or modified through the API — contact Distru support to change those. Licenses created here exist only in Distru (their compliance_type is NONE): writing one does not move inventory and does not sync to Metrc or BioTrack.

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.

Required permission: licenses_permissions_create to create a license, licenses_permissions_edit to update an existing one.

post/public/v1/companies/{id}/licenses

Request

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

Path parameters

idstring required

ID of the company (as returned by GET /public/v1/companies) that holds the license. Must be a company in your CRM other than your own company; an ID that doesn't exist for your company returns 404, and one your team restrictions hide returns 403.

Request body

idstring

ID of the license. Provide it to update that license — it must belong to the company in the path, otherwise the request returns 404. Omit it to create a new license.

license_numberstring

License number as issued by the state (e.g. C11-0000001-LIC). Required on create. Surrounding whitespace is trimmed, and the number must be unique among the company's licenses. Cannot be set to null.

license_typestring

Type of the license. Required on create. Must be one of the values valid for your company's US state — call GET /public/v1/license-types for the exact strings, which are also listed on that endpoint's documentation. Any other value is rejected with a 400. Cannot be set to null.

activeboolean

Whether the license is currently active. Defaults to true when omitted on create. Cannot be set to null.

expiry_datetimestring

ISO 8601 datetime the license expires (e.g. 2030-01-01T00:00:00Z). Required on create. Cannot be set to null.

issue_datetimestring

ISO 8601 datetime the license was issued, or null to clear it. Optional.

Response

An updated license

Example response

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

Changes

No recorded changes to this operation across all 17 revisions of this API.