# Adding shipments

> Adding a shipment to a Safecube webhook endpoint triggers either shipment.added.to.endpoint, shipment.in.error or no event at all; each outcome, and each shipment.in.error code, calls for a specific action.

Adding a shipment to a Safecube webhook endpoint, with [`POST /easy-shipment-asynchronous`](/en/api/webhooks/reference/easy-shipment/easy-shipment-add-async), has three possible outcomes: the endpoint receives a `shipment.added.to.endpoint` event, a `shipment.in.error` event, or no event at all. Each outcome calls for a different action.

::callout{type="info"}
To be informed of each outcome, subscribe the endpoint to the `shipment.added.to.endpoint` and `shipment.in.error` events.
::

## Case 1: shipment.added.to.endpoint received

The shipment was added successfully. Use the payload of this event as the initial tracking data of the shipment.

## Case 2: shipment.in.error received

The shipment was added to the endpoint, and Safecube keeps tracking it as long as it stays in the shipment list of the endpoint. The payload of the event contains the error detected. The action depends on that error.

### Input errors

- `WRONG_NUMBER`
- `WRONG_SEALINE`
- `WRONG_TYPE`
- `SEALINE_NOT_SUPPORTED`
- `TYPE_NOT_SUPPORTED_FOR_SEALINE`

The shipment number, shipping line or shipment type sent is incorrect or unsupported. Delete the shipment, then add it again with the corrected number, shipping line or type.

### Autodetection errors

- `AUTO_CANT_DETECT_SEALINE`
- `AUTO_CANT_DETECT_TYPE`
- `AUTO_CANT_FIND_INFO`

The information sent was not enough, and Safecube could not autodetect the missing data. Delete the shipment, then add it again with more details, such as the shipping line or the shipment type.

### Shipping line issues

- `SEALINE_UNDER_MAINTENANCE`
- `SEALINE_TEMPORARY_DISABLED`
- `SEALINE_NO_RESPONSE`

Safecube has trouble retrieving data from the shipping line. Keep the shipment in the list: Safecube keeps trying to fetch its data.

### No tracking data available

- `SEALINE_HASNT_PROVIDE_INFO`

Safecube contacted the shipping line, but no tracking data is available yet. Keep the shipment in the list: Safecube keeps polling for updates.

### Shipment cancellation

- `SEALINE_CANCELED_SHIPMENT`

The shipping line canceled the shipment. Delete it from the list and contact the shipping line for more information.

## Case 3: no event received

When the endpoint receives neither `shipment.added.to.endpoint` nor `shipment.in.error`, the shipment was not added to the endpoint. Two reasons are possible:

- **The shipment is already tracked** — check whether it appears in the list of monitored shipments returned by [`GET /easy-shipment`](/en/api/webhooks/reference/easy-shipment/easy-shipment-get).
- **Internal error** — add the shipment again 5 minutes later. If the issue persists, [contact the Safecube team](https://app.safecube.ai/contact).
