Create, update or delete a company address
distru-mutate-company-locationWriteCreates, updates or deletes one location (address) of a customer or vendor company.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| action | enumCREATEUPDATEDELETE | Yes | |
| id | string | No | Required for UPDATE and DELETE. Resolve via distru-get-company (includeLocations). |
| companyId | string | No | Required for CREATE; cannot change afterwards. The customer or vendor, not your own company. Resolve via distru-search-companies. |
| name | string | No | Required for CREATE. Write - for – and ' for ’. "()" written together is refused. Allowed: a-z, A-Z, 0-9, spaces and the symbols . , : ? ' ! @ # $ % ^ & * ( ) [ ] / \ | > + - _ |
| streetAddress | string | No | Required for CREATE. |
| apt | string or null | No | Send null to clear it. |
| city | string | No | Required for CREATE. |
| state | string | No | Required for CREATE. In the US, the two-letter state code, e.g. CA; full state names are converted. Elsewhere free text. |
| zip | string | No | Required for CREATE. In the US, ##### or #####-####, within the state. |
| country | string | No | Required for CREATE. ISO 3166-1 alpha-2 code, e.g. US; country names are converted. |
| licenseId | string or null | No | One of the same company's licenses. Resolve via distru-get-company (includeLicenses). Send null to clear it. |
Output
This tool returns one of 2 shapes, depending on its inputs.
Presence on a nested field assumes its parent exists.
Result with location
| Field | Type | Presence |
|---|---|---|
| location | object | Always |
| location. | string | Always |
| location. | string | Always |
| location. | string | Always |
| location. | string | Null or absent |
| location. | string | Always |
| location. | string | Always |
| location. | string | Always |
| location. | string | Always |
| location. | object | Null or absent |
| location. | string | Always |
| location. | string | Always |
Result with id
| Field | Type | Presence |
|---|---|---|
| id | string | Always |
What the AI reads
Creates, updates or deletes one location (address) of a customer or vendor company. A new or changed address must geocode, or the save is refused. Read current values with distru-get-company first (includeLocations). Your own company's locations can't be changed here; they are managed in Settings → Company Info. DELETE soft-deletes the location; refused while a sales order shipment uses it as its shipping or billing address. Sales orders and purchase orders that use it as their address keep it. CREATE and UPDATE return the location as distru-get-company does; DELETE returns its id. Sparse update: UPDATE changes only the fields sent; a field sent as null is cleared.