> For the complete documentation index, see [llms.txt](https://docs.sportradar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportradar.com/transaction30api/api-description/ticket-json-format-description/cancellation-description-and-flow/cancellation-response.md).

# Cancellation Response

<table><thead><tr><th width="114.609375" align="center">Destination</th><th width="54.75262451171875" align="center"></th><th width="115.19964599609375" align="center">Source</th></tr></thead><tbody><tr><td align="center"><strong>Client</strong></td><td align="center"><strong>←</strong></td><td align="center"><strong>MTS</strong></td></tr></tbody></table>

**Envelope and Content table:**

The envelope provides the Content's (Cancellation response) context and contains the following fields (besides Content):

* correlationId
* timestampUtc
* operation
* version

<table data-full-width="true"><thead><tr><th width="351">Example</th><th width="145.02337646484375">Field Name</th><th>Field Description</th><th width="100">Mandatory/ Optional</th><th width="100">Data Type</th></tr></thead><tbody><tr><td><pre><code>{
</code></pre></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><pre><code>  "content": {
</code></pre></td><td>content</td><td>See Content object description below</td><td>M</td><td>Object</td></tr><tr><td><pre><code>       ...........
</code></pre></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><pre><code>       ...........
</code></pre></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><pre><code>  },
</code></pre></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><pre><code>  "correlationId": "ew24faU66psM",
</code></pre></td><td>correlationId</td><td>Client defined string to facilitate the request-response pairing,<br>Sportradar is obliged to return the same string in every response</td><td>M</td><td>String</td></tr><tr><td><pre><code>  "timestampUtc": 1678265557000,
</code></pre></td><td>timestampUtc</td><td>Timestamp of ticket placement as submitted by the client (Unix time in milliseconds format),<br>minimal: 1,<br>maximum: 9223372036854776000</td><td>M</td><td>Integer</td></tr><tr><td><pre><code>  "operation": "ticket-cancel",
</code></pre></td><td>operation</td><td>Declaration of ticket content type, should be "ticket-cancel" in case of Cancellation response</td><td>M</td><td>String</td></tr><tr><td><pre><code>  "version": "3.0"
</code></pre></td><td>version</td><td>Indicates the ticket format version</td><td>M</td><td>String</td></tr><tr><td>}</td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table>

### Content object (Cancellation response) <a href="#mtscancellationresponse-v3.0-contentcontentobject-cancellationresponse" id="mtscancellationresponse-v3.0-contentcontentobject-cancellationresponse"></a>

The Content object includes the following fields:

* type
* cancellationId
* signature
* status
* ticketId
* code
* message

**Please note** that in the case of major ticket errors or internal system errors, the content object has a different structure and contains "type": "error-reply" instead of "type": "cancel-reply. For description, see [Error-reply Response](/transaction30api/api-description/ticket-json-format-description/error-reply-response.md).

**Content object table:**

<table data-full-width="true"><thead><tr><th width="356.1015625">Example</th><th width="143.18316650390625">Field Name</th><th>Field Description</th><th width="100">Mandatory/ Optional</th><th width="100">Data Type</th></tr></thead><tbody><tr><td><pre><code>"content": {
</code></pre></td><td><br></td><td><br></td><td><br></td><td>Object</td></tr><tr><td><pre><code>    "type": "cancel-reply",
</code></pre></td><td>type</td><td><p>Declaration of the content type, should be "cancel-reply" in the case of Cancellation response</p><p>or "error-reply" in the case of major ticket errors or internal system errors (see also <a href="/transaction30api/api-description/ticket-json-format-description/error-reply-response.md">Error-reply Response</a>).</p></td><td>M</td><td>String</td></tr><tr><td><pre data-overflow="wrap"><code>    "cancellationId": "CANC8787414", 
</code></pre></td><td>cancellationId</td><td>ID from the corresponding request,<br>minimal string length = 1,<br>maximum string length = 128</td><td>O</td><td>String</td></tr><tr><td><pre><code>    "signature": "ouHgh3Yn+1p9C0Ms
</code></pre><pre><code>3brurfLBlLTcweMdP0vM2HI+Lx8=",
</code></pre></td><td>signature</td><td>String calculated and sent by MTS to be used as a proof that the response has actually been provided by MTS,<br>minimal string length = 1,<br>maximum string length = 128</td><td>M</td><td>String</td></tr><tr><td><pre><code>    "status": "rejected",
</code></pre></td><td>status</td><td><p>Request outcome, enumerator:</p><ul><li>accepted</li><li>rejected</li></ul></td><td>M</td><td><br></td></tr><tr><td><pre><code>    "ticketId": "Ticket_3690",
</code></pre></td><td>ticketId</td><td>ID of the initial ticket (defined by client) which is to be affected with this cancellation</td><td>M</td><td>String</td></tr><tr><td><pre><code>    "code": -2013,    
</code></pre></td><td>code</td><td>Cancellation response code,<br>see list of codes below</td><td>M</td><td>Integer</td></tr><tr><td><pre data-overflow="wrap"><code>    "message": "Ticket time for cancellation expired"
</code></pre></td><td>message</td><td>Readable ticket response validation code, minimal string length = 1,<br>maximum string length = 128</td><td>O</td><td><br></td></tr><tr><td>}</td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table>

### Cancellation response codes <a href="#mtscancellationresponse-v3.0-cancellationresponsecodes" id="mtscancellationresponse-v3.0-cancellationresponsecodes"></a>

For general validation codes , please refer to [Validation codes](/transaction30api/api-description/validation-codes.md).

<table><thead><tr><th width="151.87066650390625">Code</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>0
</code></pre></td><td>Transaction processed</td></tr><tr><td><pre><code>-2010
</code></pre></td><td>Ticket not found</td></tr><tr><td><pre><code>-2011
</code></pre></td><td>Client (bookmaker) not found</td></tr><tr><td><pre><code>-2012
</code></pre></td><td>Cannot be cancelled because ticket contains live selection</td></tr><tr><td><pre><code>-2013
</code></pre></td><td>Ticket time for cancellation expired</td></tr><tr><td><pre><code>-2015
</code></pre></td><td>Cannot be cancelled because ticket contains pre-match selection</td></tr><tr><td><pre><code>-2016
</code></pre></td><td>Cannot be cancelled because particular cancellation option is not active</td></tr><tr><td><pre><code>-2017
</code></pre></td><td>Cannot be cancelled because ticket is already settled</td></tr><tr><td><pre><code>-2018
</code></pre></td><td>Cannot be cancelled because ticket is already cancelled</td></tr><tr><td><pre><code>-2019
</code></pre></td><td>Cancel factor is out of bounds (when the cancellation factor is outside the allowed range of 0-100%)</td></tr><tr><td><pre><code>-2020
</code></pre></td><td>Cancel factor is lower than existing (when the cancellation factor is lower than the previous one)</td></tr><tr><td><pre><code>-2021
</code></pre></td><td>Cannot be cancelled because bet id was not found</td></tr><tr><td><pre><code>-2022
</code></pre></td><td>Ticket already settled manually</td></tr><tr><td><pre><code>-2023
</code></pre></td><td>Cannot be cancelled because ticket contains inactive market</td></tr><tr><td><pre><code>-2024
</code></pre></td><td>Cannot be cancelled because code is not compatible with partial cancellation</td></tr><tr><td><pre><code>-999
</code></pre></td><td>Generic exception code</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sportradar.com/transaction30api/api-description/ticket-json-format-description/cancellation-description-and-flow/cancellation-response.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
