UpdateEntityTypes
Adds types to an entity or removes them, as the entity’s Multi-Type tab does in TrakIT. Use it when a party TrakIT already has takes on another role, for example a customer that you now also need as the shipper of a work order. An entity can be chosen only where its main type or one of its other types is needed.
How to sign in and read the response: Authentication, Responses.
POST /api/v1/UpdateEntityTypesToken: your-tokenContent-Type: application/json{ "EntID": 48211, "Add": [8, 9], "Remove": [3]}| Field | Required | Meaning |
|---|---|---|
EntID |
Yes | The entity’s ID, a whole number: EntID in the answers of CreateEntity, GetEntity and GetEntitiesUpdated. |
Add |
One of the two | The types to give the entity, as a list of numbers: 0 carrier, 1 customer, 2 transporter, 3 bond agent, 4 clearing agent, 5 bank, 6 authority, 7 other, 8 shipper, 9 receiver. TrakIT Support names the types for your installation, so the names may differ: see Entity types. |
Remove |
One of the two | The types to take away from the entity, as a list of the same numbers. |
The field names are not case-sensitive: Add and add are the same.
The entity’s main type never changes: adding it is skipped, and removing it is refused. The other types the entity has and you leave out of both lists stay as they are.
Adding a type the entity already has, or removing one it does not have, changes nothing. So you can send the types your system needs without reading the entity first: when nothing changes, the answer is still a success.
TrakIT checks the request and stops at the first rule that fails. Nothing is saved unless every check passes.
| Rule | Info when it fails |
|---|---|
The Token header holds a valid token. |
Token missing in header, Invalid Token, or another answer listed in Login token |
| The user is a system administrator with API access. | API User must be SysAdmin with API Access |
| The request has a JSON body. | No request body found |
EntID is a whole number above 0. |
EntID missing or invalid |
Add and Remove, if sent, are lists of whole numbers. |
Add must be a list of entity type IDs, Remove must be a list of entity type IDs, Entity type IDs must be integers |
| At least one type is listed. | Add or Remove must list at least one entity type ID |
| No type is in both lists. | Entity type ... is in both Add and Remove |
| Each type to add exists and is in use. | Entity type ... does not exist or is not in use |
| Each type to remove exists. A type no longer in use can still be removed. | Entity type ... does not exist |
| An entity has that ID. | No such entity |
Remove does not hold the entity’s main type. |
Entity type ... is the entity's main type and cannot be removed |
Response
Section titled “Response”On success, Code is 1, Identity is the entity’s ID and RowsAffected is the number of types
added and removed. RetInfo holds the entity’s main type (EntType) and the other types it has now
(Types).
{ "Code": 1, "Info": "", "RetInfo": { "EntType": 1, "Types": [8, 9] }, "RowsAffected": 2, "Scalar": null, "Identity": 48211}When nothing changes, Code is 1, Info is No changes made, RowsAffected is 0 and
RetInfo holds the entity’s types.
GetEntity also returns the other types, in MultiTypes.
- Each type added or removed is recorded in the entity’s Action Log under the API user’s name.
- A change makes the entity appear in
GetEntitiesUpdated. - TrakIT calculates the computed data fields of the types added, and copies those that changed to the data of the entity’s work orders. The data fields of a type removed are kept.
- The entity keeps its approval.

