# Shipment usage

> Safecube charges every shipment monitored by a webhook endpoint, by month, until it is removed — remove delivered and untrackable shipments, check the validity of new ones and clean up monthly to avoid overages.

The Safecube webhook monitoring system tracks a shipment from the moment it is added to an endpoint until it is removed, either by you or automatically under the [auto-removal policy](/en/api/webhooks/guides/auto-removal-policy). Every monitored shipment is charged. Check the list of monitored shipments regularly to avoid overcharging; the practices below help.

## Remove old shipments

Monitor a shipment only as long as you need updates for it. Depending on your use case, stop after:

- its arrival at the port of discharge;
- its gate out;
- the moment you are certain no further movement will occur.

To remove shipments from the monitored list, use [`DELETE /easy-shipment`](/en/api/webhooks/reference/easy-shipment/easy-shipment-delete).

Deleting the endpoint itself, with [`DELETE /endpoint/{endpoint_id}`](/en/api/webhooks/reference/endpoints/endpoint-delete), also removes every shipment attached to it from the monitored list.

::callout{type="warning"}
Disabling an endpoint, with [`PATCH /endpoint/{endpoint_id}`](/en/api/webhooks/reference/endpoints/endpoint-patch), pauses the notifications but does not stop the tracking: Safecube keeps tracking its shipments, and you no longer receive their updates.
::

## Remove useless shipments

Safecube starts monitoring a shipment as soon as it is added to an endpoint, and sends the `shipment.added.to.endpoint` event when it receives the first tracking information. For some shipments, no information ever arrives: the shipping line cannot be autodetected (retry with the shipping line specified), the number is incorrect, or the shipping line is not supported. As long as these shipments stay in the endpoint list, Safecube keeps trying to monitor them, and they are charged.

Safecube sends the `shipment.in.error` event when the first attempt to retrieve information for a shipment fails. The [Adding shipments](/en/api/webhooks/guides/adding-shipments) page details each error code.

::callout{type="info"}
Subscribe to `shipment.in.error`. When you receive it, read the error message and decide whether to:

- keep monitoring the shipment — not recommended, as such a shipment may never be found nor auto-removed;
- delete the shipment;
- delete the shipment and add it again with added or corrected data, such as a corrected number or the shipping line.
::

## Check the validity of new shipments

Container numbers are reused periodically. After a reuse, the tracking information received may belong to a new voyage instead of the expected one, and be misleading or useless.

Specifying the shipping line makes sure the data comes from the right source. When you receive the `shipment.added.to.endpoint` event, also check the data against your own records, for example:

- the shipping line is the expected one;
- the date of the first event matches your internal records;
- the port of delivery is the expected one.

## Clean up monthly

Shipments are charged by month. A monthly check at the end of each month makes sure you pay only for useful data:

1. Retrieve every shipment of every endpoint with [`GET /easy-shipment`](/en/api/webhooks/reference/easy-shipment/easy-shipment-get).
2. Send a Container Tracking API request, [`GET /shipment`](/en/api/container-tracking/reference/get-shipment-detail), for each shipment — this incurs no extra charge. Remove the shipments that return an error.
3. Check that the data of each shipment is still accurate, for example by comparing the date of the first event or the POD location, and remove the shipments that are not.
