> ## 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_CancelRQ

<Tip>Already know OTA messages? Jump straight into testing.</Tip>

<Card title="OTA_CancelRQ API call" icon="xmark" href="/api-reference/endpoint/bookingmgmt/cancel" arrow="true" horizontal>
  Skip & Hit the Playground.
</Card>

## Purpose

* Cancel a confirmed reservation (`CancelType="Commit"`).
* Request a penalty quote without cancelling (`CancelType="Quote"`).
* Target the booking by either the client reference or Axis Data internal reference (`UniqueID/@ID` with `ID_Context="Client"` or `ID_Context="Internal"`).

## Structure - Root Element

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

**Key Attributes:**

* `Version`: e.g., "2008.1".
* `CancelType`: "Commit" | "Quote" (required).
* `xmlns`: "[http://www.opentravel.org/OTA/2003/05](http://www.opentravel.org/OTA/2003/05)".

## Structure - Core Elements

### POS (Point of Sale)

Identifies the requesting party and contains credentials.

```xml theme={null}
<POS>
  <Source>
    <RequestorID ID_Context="AxisData" ID="TEST" Type="22"/>
  </Source>
  <Source>
    <RequestorID Type="88" ID="TEST" MessagePassword="testpass"/>
  </Source>
</POS>
```

### UniqueID

Required. Specifies the booking or component to be cancelled or quoted.

* `ID` (required): booking reference number (client or Axis Data internal).
* `ID_Context`: "Client" or "Internal".
* `Type`: "36".

```xml theme={null}
<UniqueID Type="36" ID="TEST_AXIS" ID_Context="Client"/>
```

#### Partial Cancellation

Add the component, not the whole booking.

* `ID` (required): booking reference number (client or Axis Data internal).
* `ID_Context`: "Client" or "Internal".
* `Type`: "37".

```xml theme={null}
<UniqueID Type="37" ID="TEST_AXIS_ac1" ID_Context="Client"/>
```

## Behavior & Rules

* `CancelType="Commit"` performs the cancellation if allowed.
* `CancelType="Quote"` returns penalty information; no cancellation performed.
* **Partial cancellation**: If you include a child item reference, only indicated item will be cancelled. If this removes the last valid item, the entire booking will be cancelled.
* **Response heads-up**: `OTA_CancelRS` will return `Status="Committed"` after a successful cancel, or `Status="Pending"` for quotes, and may include `CancelRule@CancelByDate` indicating the timestamp the cancel was registered.
* When a booking is already active, the API will not allow cancellations.

## Complete Examples

<CodeGroup>
  ```xml Cancel Booking expandable theme={null}
  <OTA_CancelRQ xmlns="http://www.opentravel.org/OTA/2003/05" Version="2008.1" CancelType="Quote">
    <POS>
      <Source>
        <RequestorID ID_Context="AxisData" ID="TEST" Type="22"/>
      </Source>
      <Source>
        <RequestorID Type="88" ID="TEST" MessagePassword="testpass"/>
      </Source>
    </POS>
    <UniqueID Type="36" ID="TEST_AXIS" ID_Context="Client"/>
  </OTA_CancelRQ>
  ```

  ```xml Partial Cancel expandable theme={null}
  <OTA_CancelRQ xmlns="http://www.opentravel.org/OTA/2003/05" Version="2008.1" CancelType="Quote">
    <POS>
      <Source>
        <RequestorID ID_Context="AxisData" ID="TEST" Type="22"/>
      </Source>
      <Source>
        <RequestorID Type="88" ID="TEST" MessagePassword="testpass"/>
      </Source>
    </POS>
    <UniqueID Type="36" ID="TEST_AXIS" ID_Context="Client"/>
    <UniqueID Type="37" ID="TEST_AXIS_ac1" ID_Context="Client"/>
  </OTA_CancelRQ>
  ```
</CodeGroup>

## Best Practices

1. Use the correct booking reference and matching `ID_Context` to avoid cancelling the wrong booking.
2. Prefer `CancelType="Quote"` before `Commit` to surface penalties and cutoffs to the user.
3. Keep credentials in `POS/Source/RequestorID` aligned with your test/production environment.

## Playground

<Card title="OTA_CancelRQ API call" icon="xmark" href="/api-reference/endpoint/bookingmgmt/cancel" arrow="true" horizontal>
  Try our API playground in real time.
</Card>

<Tip>Use the examples to hit the test environment;     </Tip>
