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

# OTA_CancelRS

The `OTA_CancelRS` (Cancel Response) confirms a booking cancellation or returns a penalty quote depending on the originating `OTA_CancelRQ` `CancelType`. It follows OpenTravel Alliance (OTA) message patterns and retains original namespaces/prefixes.

## Purpose

This message is returned by Axis Data after an `OTA_CancelRQ`:

* `Status="Committed"` → cancellation has been executed and confirmed.
* `Status="Pending"` → quote mode; cancellation penalties/rules are provided but the booking is **not** cancelled yet.

## Structure – Root Element

```xml theme={null}
<OTA_CancelRS>
```

**Key Attributes:**

* `xmlns`: `"http://www.opentravel.org/OTA/2003/05"`.
* `Version`: OTA version string (e.g., `"2008.1"`).
* `TimeStamp` (optional): ISO-8601 date-time when the response was generated.
* `Status`: `Committed` (finalized cancellation) or `Pending` (quote only).

## Structure – Core Elements

### Booking References

Both the Axis Data internal booking reference and the client booking reference are returned.

```xml theme={null}
<UniqueID Type="36" ID="12345" ID_Context="Internal"/>
<UniqueID Type="36" ID="test-001" ID_Context="Client">
  <CompanyName Code="TEST"/>
</UniqueID>
```

### Cancellation Rules

When the cancellation is committed, the response includes the exact cancellation timestamp.

```xml theme={null}
<CancelRules>
  <CancelRule CancelByDate="2024-01-01T11:22:02"/>
</CancelRules>
```

For quotes (pending), cancellation rules may be returned describing applicable windows and penalties without performing the cancellation.

## Complete Examples

<CodeGroup>
  ```xml Committed (final) theme={null}
  <OTA_CancelRS xmlns="http://www.opentravel.org/OTA/2003/05" Version="2008.1" TimeStamp="2025-10-15T14:20:00Z" Status="Committed">
    <Success/>
    <UniqueID Type="36" ID="12345" ID_Context="Internal"/>
    <UniqueID Type="36" ID="test-001" ID_Context="Client">
      <CompanyName Code="TEST"/>
    </UniqueID>
    <CancelRules>
      <CancelRule CancelByDate="2024-01-01T11:22:02"/>
    </CancelRules>
  </OTA_CancelRS>
  ```

  ```xml Quote (pending) theme={null}
  <OTA_CancelRS xmlns="http://www.opentravel.org/OTA/2003/05" Version="2008.1" TimeStamp="2025-10-15T14:20:00Z" Status="Pending">
    <Success/>
    <UniqueID Type="36" ID="12345" ID_Context="Internal"/>
    <UniqueID Type="36" ID="test-001" ID_Context="Client">
      <CompanyName Code="TEST"/>
    </UniqueID>
    <CancelRules>
      <!-- Example date windows for informational penalty quote -->
      <CancelRule FromDate="2025-10-20T00:00:00" ToDate="2025-10-21T23:59:59"/>
      <CancelRule FromDate="2025-10-22T00:00:00" ToDate="2025-10-23T23:59:59"/>
    </CancelRules>
  </OTA_CancelRS>
  ```
</CodeGroup>

## Common Use Cases

* **Full cancellation confirmation**: Returned after `CancelRQ` with `CancelType="Commit"` → `Status="Committed"`.
* **Penalty quote**: Returned after `CancelRQ` with `CancelType="Quote"` → `Status="Pending"` plus cancellation windows/rules.

## Best Practices

1. Include `EchoToken` in requests to correlate `RQ/RS` pairs during cancellation workflows.
2. Provide `PrimaryLangID` in the request if you require localized descriptions in any returned text fields.
3. Preserve and store both internal and client `UniqueID` values in your system when processing responses.
4. Treat `Pending` responses as **advisory** only; send a subsequent `CancelRQ` with `CancelType="Commit"` to finalize.
