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

# Void Order

> Cancel one or more shipping orders

Voids (cancels) one or more orders by tracking number. Voided orders cannot be shipped.

<Warning>
  Orders cannot be voided after they enter `IN_TRANSIT` status.
</Warning>

## Request Body

<ParamField body="idempotencyKey" type="string" required>
  Unique key to prevent duplicate void operations (8-64 characters).
</ParamField>

<ParamField body="trackingNumbers" type="array" required>
  List of tracking numbers to void (1-100 items).
</ParamField>

<ParamField body="reason" type="string" required>
  Reason for voiding (5-500 characters). Required for audit purposes.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request succeeded
</ResponseField>

<ResponseField name="voided" type="array">
  List of successfully voided tracking numbers
</ResponseField>

<ResponseField name="failed" type="array">
  List of tracking numbers that could not be voided

  <Expandable title="Failed item fields">
    <ResponseField name="trackingNumber" type="string">
      The tracking number that failed
    </ResponseField>

    <ResponseField name="reason" type="string">
      Why the void operation failed
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```json Example Request theme={null}
  {
    "idempotencyKey": "void-2024-001",
    "trackingNumbers": [
      "CBECUSD123456789",
      "CBECUSD987654321"
    ],
    "reason": "Customer cancelled order before shipment"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "voided": ["CBECUSD123456789", "CBECUSD987654321"],
    "failed": []
  }
  ```

  ```json 200 - Partial Success theme={null}
  {
    "success": true,
    "voided": ["CBECUSD123456789"],
    "failed": [
      {
        "trackingNumber": "CBECUSD987654321",
        "reason": "Parcel is already in transit and cannot be voided"
      }
    ]
  }
  ```

  ```json 400 - Validation Error theme={null}
  {
    "success": false,
    "error": {
      "code": "VALIDATION_FAILED",
      "message": "Reason must be at least 5 characters",
      "message_es": "La razón debe tener al menos 5 caracteres",
      "requestId": "req_abc123"
    }
  }
  ```
</ResponseExample>

## Void Rules

| Parcel Status        | Can Void?                      |
| -------------------- | ------------------------------ |
| `ORDERED`            | ✅ Yes                          |
| `LABEL_GENERATED`    | ✅ Yes                          |
| `MANIFEST_SUBMITTED` | ⚠️ Depends on carrier          |
| `CUSTOMS_CLEARANCE`  | ❌ No                           |
| `IN_TRANSIT`         | ❌ No                           |
| `DELIVERED`          | ❌ No                           |
| `ALREADY_VOIDED`     | ✅ Returns success (idempotent) |

## Idempotency

If you retry a void request with the same `idempotencyKey`, the original response is returned:

* If the original void succeeded, success is returned again
* Already-voided parcels return success without error
