# About label voiding

Your organization may find that you need to void a label because it will not be used. In this case, you can call the **cancellation** API endpoint to void a shipment label.

For most carriers, this should reverse any charges and make the label ineligible for use. However, there are exceptions and you should verify details of any particular carrier.

### Void is idempotent

If you make a call to void a label that has already been voided, you will receive a 200 response as your action (voiding a particular label) has already succeeded.

### Authentication for API calls

In the cURL examples on this page, the environment variable `AUTHSTRING` is used to handle authorization. The recipe below shows how to set it correctly for both API Key and OAuth users.

# Void a label

If you also need to cancel a shipment and/or carrier selection, Shipium recommends following the steps in [Cancel a Shipment](https://docs.shipium.com/docs/cancel-a-shipment).

To simply void a label, you can call the cancellation endpoint with either a `shipiumLabelId` or a `carrierTrackingId`, which you should have based on prior calls, whether you used the [Shipment Label API](https://docs.shipium.com/docs/shipment-label-api) endpoint or the [Carrier and Method Selection & Shipment Label API](https://docs.shipium.com/docs/carrier-and-method-selection-and-shipment-label-api) endpoint:

- **carrierTrackingId**. The carrier tracking ID of the label to be canceled and voided with the carrier
- **shipiumLabelId**. The unique Shipium ID of the label to be canceled and voided with the carrier

You also can include the `cancellationDateTime`, an optional timestamp for when the entity is canceled. This value defaults to now.

### cURL Example

```curl
curl --request POST \
     --url https://api.shipium.com/api/v1/deliveryexperience/cancel \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{
        "shipiumLabelId": "198edb20-1076-42d8-8723-830dd6f27ef4",
        "cancellationDateTime": "2024-08-21T18:30:55.558Z"
      }'
```

## Void a label with label ID

If you are only storing label IDs as part of your integration with Shipium, you may want to void a label without tracking order or shipment details. In this case, you can use the following call using only the label ID:

### cURL Example

```curl
curl --request POST \
  --url  https://api.shipium.com/api/v1/deliveryexperience/shipment/carrierselection/voidlabel \
  --header $AUTHSTRING \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"shipiumLabelId": "1234-5678-9012"}'
```

## Void a previously generated label

To void a previously generated shipment label, follow the guidance in the [API reference document](https://docs.shipium.com/reference/voidlabelv1).

### More information on the API responses

As with all Shipium API responses, this API follows the [API Response Codes](https://docs.shipium.com/docs/api-response-codes) standards unless otherwise specified.

# Resources

Your Shipium team member is available to help along the way. However, you might find these resources helpful:

- [Terms and Definitions](https://docs.shipium.com/docs/common-terms)
- [Troubleshooting Guide](https://docs.shipium.com/docs/troubleshooting-guide)
- [Contact Shipium Support](https://docs.shipium.com/docs/contacting-shipium-support)
