Get a company

distru-get-companyRead

Gets one customer, vendor or your own company, with its licenses, addresses and default order notes.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
idstringYesResolve via distru-search-companies.
includeContactsbooleanNocontacts is empty without permission to view contacts.
includeLocationsbooleanNoAddresses.
includeLicensesbooleanNoState cannabis licenses. Customer and vendor license numbers are user-entered, not checked against Metrc.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresenceDescription
companyobjectCan be null
company.idstringAlways
company.namestringNull or absent
company.isMyCompanybooleanAlways
company.customFieldsobject[]Always
company.customFields[].customFieldobjectAlways
company.customFields[].customField.idstringAlways
company.customFields[].customField.namestringAlways
company.customFields[].customField.fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
Always
company.customFields[].valuestringCan be nullNull when unset. DATE values are days (YYYY-MM-DD) in the company timezone; CHECKBOX values are the selected option names, separated by commas.
company.legalBusinessNamestringNull or absent
company.categorystringNull or absent
company.creditBalancestringNull or absent
company.outstandingBalancestringNull or absent
company.pastDueBalancestringNull or absent
company.outstandingBalanceThresholdintegerNull or absent
company.invoiceEmailstringNull or absent
company.defaultPaymentTermobjectNull or absent
company.defaultPaymentTerm.idstringAlways
company.defaultPaymentTerm.namestringNull or absent
company.ownerobjectNull or absent
company.owner.idstringAlways
company.owner.fullNamestringNull or absent
company.defaultInventoryLocationobjectNull or absent
company.defaultInventoryLocation.idstringAlways
company.defaultInventoryLocation.namestringNull or absent
company.lastOrderDatestringNull or absent
company.relationshipTypeobjectNull or absent
company.relationshipType.idstringAlways
company.relationshipType.namestringAlways
company.groupobjectNull or absent
company.group.idstringAlways
company.group.namestringAlways
company.emailstringNull or absent
company.phonestringNull or absent
company.websitestringNull or absent
company.qbCustomerIdstringNull or absent
company.qbCustomerobjectNull or absent
company.qbCustomer.displayNamestringAlways
company.qbCustomer.activebooleanAlways
company.qbCustomer.isDeletedbooleanAlways
company.qbVendorIdstringNull or absent
company.qbVendorobjectNull or absent
company.qbVendor.displayNamestringAlways
company.qbVendor.activebooleanAlways
company.qbVendor.isDeletedbooleanAlways
company.leaflinkBrandIdstringNull or absent
company.leaflinkCustomerIdstringNull or absent
company.usStatestringNull or absent
company.descriptionstringNull or absent
company.defaultSalesOrderNotesstringNull or absent
company.defaultPurchaseOrderNotesstringNull or absent
company.salesOrderEmailstringNull or absent
company.orderShipmentEmailstringNull or absent
company.purchaseOrderEmailstringNull or absent
company.contactsobject[]Can be absent
company.contacts[].idstringAlways
company.contacts[].firstNamestringAlways
company.contacts[].lastNamestringNull or absent
company.contacts[].titlestringNull or absent
company.contacts[].descriptionstringNull or absent
company.contacts[].emailstringNull or absent
company.contacts[].phonestringNull or absent
company.contacts[].workPhonestringNull or absent
company.contacts[].ownerobjectNull or absent
company.contacts[].owner.idstringAlways
company.contacts[].owner.fullNamestringNull or absent
company.contacts[].driverLicenseNumberstringNull or absent
company.contacts[].driverLicenseIssuingStatestringNull or absent
company.contacts[].customFieldsobject[]Always
company.contacts[].customFields[].customFieldobjectAlways
company.contacts[].customFields[].customField.idstringAlways
company.contacts[].customFields[].customField.namestringAlways
company.contacts[].customFields[].customField.fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
Always
company.contacts[].customFields[].valuestringCan be nullNull when unset. DATE values are days (YYYY-MM-DD) in the company timezone; CHECKBOX values are the selected option names, separated by commas.
company.locationsobject[]Can be absent
company.locations[].idstringAlways
company.locations[].namestringAlways
company.locations[].streetAddressstringAlways
company.locations[].aptstringNull or absent
company.locations[].citystringAlways
company.locations[].statestringAlways
company.locations[].zipstringAlways
company.locations[].countrystringAlways
company.locations[].licenseobjectNull or absent
company.locations[].license.idstringAlways
company.locations[].license.licenseNumberstringAlways
company.licensesobject[]Can be absent
company.licenses[].idstringAlways
company.licenses[].licenseNumberstringAlways
company.licenses[].licenseTypestringAlways
company.licenses[].complianceTypeenum
BIOTRACKMETRCNONE
Always
company.licenses[].isActivebooleanAlways
company.licenses[].issueDatetimestringNull or absent
company.licenses[].expiryDatetimestringAlways
What the AI reads

Gets one company by ID — a customer, a vendor, or the user's own company (isMyCompany): the distru-search-companies summary plus its US state, description, default sales and purchase order notes, and the emails its documents go to. Contacts, locations and licenses are left out unless you pass includeContacts, includeLocations or includeLicenses. Use for a specific company after resolving its ID via distru-search-companies; to browse companies use distru-search-companies. qbCustomerId and qbVendorId are its QuickBooks customer and vendor IDs, null when not mapped. qbCustomer and qbVendor are null when mapped but Distru has no current copy of the QuickBooks record. isDeleted means QuickBooks no longer has the record, and active indicates whether the record is active in QuickBooks. An invoice sync re-maps a deleted or missing customer by name, or creates one, but fails on an inactive one. Null if no company matches the ID; a permission error if the caller can't view it.