> ## Documentation Index
> Fetch the complete documentation index at: https://terminal49.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Class: ContainerManager

> ContainerManager reference for the Terminal49 TypeScript SDK, used to list containers, fetch container details, and retrieve raw and mapped transport events.

# Class: ContainerManager

## Extends

* [`BaseManager`](https://terminal49.com/docs/sdk/reference/client/managers/classes/BaseManager)

## Constructors

### Constructor

> **new ContainerManager**(`transport`, `defaultFormat?`): `ContainerManager`

#### Parameters

| Parameter | Type | Default value |
| - | - | - |
| `transport` | [`Transport`](https://terminal49.com/docs/sdk/reference/client/transport/classes/Transport) | `undefined` |
| `defaultFormat?` | [`ResponseFormat`](https://terminal49.com/docs/sdk/reference/types/options/type-aliases/ResponseFormat) | `'raw'` |

#### Returns

`ContainerManager`

#### Inherited from

[`BaseManager`](https://terminal49.com/docs/sdk/reference/client/managers/classes/BaseManager).[`constructor`](https://terminal49.com/docs/sdk/reference/client/managers/classes/BaseManager#constructor)

## Methods

### addPartyRole()

> **addPartyRole**(`id`, `__namedParameters`, `options?`): `Promise`\<`any`>

Assign a party to a container in the given role.

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `__namedParameters` | [`ContainerAddPartyRoleParams`](https://terminal49.com/docs/sdk/reference/client/managers/interfaces/ContainerAddPartyRoleParams) |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### customFields()

> **customFields**(`id`, `options?`): `Promise`\<`any`>

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### deleteCustomField()

> **deleteCustomField**(`id`, `apiSlug`, `options?`): `Promise`\<`any`>

Remove a custom field value from a container.

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `apiSlug` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### demurrage()

> **demurrage**(`id`): `Promise`\<`any`>

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |

#### Returns

`Promise`\<`any`>

***

### events()

> **events**(`id`, `options?`): `Promise`\<`any`>

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### get()

> **get**(`id`, `include?`, `options?`): `Promise`\<`any`>

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `include?` | [`IncludeParam`](https://terminal49.com/docs/sdk/reference/types/options/type-aliases/IncludeParam)\<[`ContainerInclude`](https://terminal49.com/docs/sdk/reference/types/options/type-aliases/ContainerInclude)> |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### iterate()

> **iterate**(`filters?`, `options?`): `AsyncGenerator`\<[`Container`](https://terminal49.com/docs/sdk/reference/types/models/interfaces/Container), `void`, `unknown`>

#### Parameters

| Parameter | Type |
| - | - |
| `filters?` | [`ContainerListFilters`](https://terminal49.com/docs/sdk/reference/types/filters/interfaces/ContainerListFilters) \| `undefined` |
| `options?` | `Omit`\<[`ListOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/ListOptions), `"page"`> |

#### Returns

`AsyncGenerator`\<[`Container`](https://terminal49.com/docs/sdk/reference/types/models/interfaces/Container), `void`, `unknown`>

***

### list()

> **list**(`filters?`, `options?`): `Promise`\<`any`>

#### Parameters

| Parameter | Type |
| - | - |
| `filters?` | [`ContainerListFilters`](https://terminal49.com/docs/sdk/reference/types/filters/interfaces/ContainerListFilters) |
| `options?` | [`ListOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/ListOptions) |

#### Returns

`Promise`\<`any`>

***

### ~~map()~~

> **map**(`id`, `options?`): `Promise`\<`any`>

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

#### Deprecated

Use [ContainerManager.route](#route). Returns the GeoJSON
FeatureCollection unmapped: `raw` and `mapped` return it as is, and
`both` returns `{ raw, mapped }` with the FeatureCollection in each half.

***

### partyRoles()

> **partyRoles**(`id`, `options?`): `Promise`\<`any`>

List the party roles assigned to a container.

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### rawEvents()

> **rawEvents**(`id`, `options?`): `Promise`\<`any`>

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### refresh()

> **refresh**(`id`, `options?`): `Promise`\<`any`>

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### removePartyRole()

> **removePartyRole**(`id`, `partyRoleId`, `options?`): `Promise`\<`any`>

Remove a party role assignment from a container.

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `partyRoleId` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### route()

> **route**(`id`, `options?`): `Promise`\<`any`>

Fetch the container's route: ports, the current vessel, and vessel tracks.
The raw format is the GeoJSON FeatureCollection; the mapped format is a
`ContainerRoute`. Requires the Routing Data feature, otherwise the API
returns 403.

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### setCustomField()

> **setCustomField**(`id`, `apiSlug`, `value`, `options?`): `Promise`\<`any`>

Create a custom field value on a container.

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `apiSlug` | `string` |
| `value` | `unknown` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### summary()

> **summary**(`groupBy`, `filters?`, `options?`): `Promise`\<`any`>

Count the containers `list` would return for the same filters, grouped by
one dimension, in one request (`GET /containers/summary`).

#### Parameters

| Parameter | Type |
| - | - |
| `groupBy` | [`ContainerSummaryGroupBy`](https://terminal49.com/docs/sdk/reference/types/options/type-aliases/ContainerSummaryGroupBy) |
| `filters?` | [`ContainerListFilters`](https://terminal49.com/docs/sdk/reference/types/filters/interfaces/ContainerListFilters) |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>

***

### update()

> **update**(`id`, `attrs`, `options?`): `Promise`\<`any`>

Update a container's `ref_numbers`, `seal_number`, equipment type, length, and height, or `weight_in_lbs`.

#### Parameters

| Parameter | Type | Description |
| - | - | - |
| `id` | `string` | - |
| `attrs` | \{ `equipment_height?`: `"standard"` \| `"high_cube"` \| `"flexible"`; `equipment_length?`: `20` \| `40` \| `45` \| `24` \| `48` \| `53`; `equipment_type?`: `"dry"` \| `"reefer"` \| `"tank"` \| `"flat_rack"` \| `"open_top"` \| `"pallet_wide"` \| `"hard_top"`; `ref_numbers?`: `string`\[]; `seal_number?`: `string` \| `null`; `weight_in_lbs?`: `number` \| `null`; } | - |
| `attrs.equipment_height?` | `"standard"` \| `"high_cube"` \| `"flexible"` | - |
| `attrs.equipment_length?` | `20` \| `40` \| `45` \| `24` \| `48` \| `53` | - |
| `attrs.equipment_type?` | `"dry"` \| `"reefer"` \| `"tank"` \| `"flat_rack"` \| `"open_top"` \| `"pallet_wide"` \| `"hard_top"` | - |
| `attrs.ref_numbers?` | `string`\[] | - |
| `attrs.seal_number?` | `string` \| `null` | **Example** `SEAL1234567` |
| `attrs.weight_in_lbs?` | `number` \| `null` | - |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) | - |

#### Returns

`Promise`\<`any`>

***

### updateCustomField()

> **updateCustomField**(`id`, `apiSlug`, `value`, `options?`): `Promise`\<`any`>

Update an existing custom field value on a container.

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |
| `apiSlug` | `string` |
| `value` | `string` \| `number` \| `boolean` \| `string`\[] \| \{\[`key`: `string`]: `unknown`; } \| `null` |
| `options?` | [`CallOptions`](https://terminal49.com/docs/sdk/reference/types/options/interfaces/CallOptions) |

#### Returns

`Promise`\<`any`>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.