# Successive Partial Ticket Cancellations (with Acknowledgements)

This is an example of a sequence of successive partial cancellation requests relating to the same ticket.

<br>

The **first cancellation request** cancels 50% of the original ticket stake, leaving the remaining 50% of the stake active.

<details>

<summary><strong>Cancellation Request</strong></summary>

```json5
{
  "operatorId": 9985,
  "content": {
    "type": "cancel",
    "cancellationId": "CANC8787501",
    "details": {
      "type": "ticket-partial",
      "ticketId": "Ticket_3691",
      "ticketSignature": "HHDut7XIEl+SmjWB3xDB0AIB6fUZVFOvmGKm6Rcvxm0=",
      "code": 101,
      "percentage": "0.5"
    }
  },
  "correlationId": "1Uwqphd45n3",
  "timestampUtc": 1678981603000,
  "operation": "ticket-cancel",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Cancellation Response</strong></summary>

```json
{
  "content": {
    "type": "cancel-reply",
    "cancellationId": "CANC8787501",
    "signature": "dl8PCPAchg38UTJT6M+ZWwognVHpzW44CJ/RQQaf2J0=",
    "status": "accepted",
    "ticketId": "Ticket_3691",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "1Uwqphd45n3",
  "timestampUtc": 1678981604000,
  "operation": "ticket-cancel",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Acknowledgement Message</strong></summary>

```json
{
  "operatorId": 9985,
  "content": {
    "type": "cancel-ack",
    "cancellationId": "CANC8787501",
    "ticketId": "Ticket_3691",
    "cancellationSignature": "dl8PCPAchg38UTJT6M+ZWwognVHpzW44CJ/RQQaf2J0=",
    "acknowledged": true
  },
  "correlationId": "L01Ba63Z2",
  "timestampUtc": 1678981607000,
  "operation": "ticket-cancel-ack",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Acknowledgement Reply Message</strong></summary>

```json
{
  "content": {
    "type": "cancel-ack-reply",
    "cancellationId": "CANC8787501",
    "signature": "T9t8n7p3U/w2o+SlrNpT3oL251GP7Y0TCCKq8E8W2E4=",
    "status": "accepted",
    "ticketId": "Ticket_3691",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "L01Ba63Z2",
  "timestampUtc": 1678981608000,
  "operation": "ticket-cancel-ack",
  "version": "3.0"
}
```

</details>

Although 50% of the stake has been cancelled, the full original stake is still shown as turnover in the MTS Console. However, the P/L (profit loss) figures of the displayed ticket have been updated according to the cancellation.

\ <br>

The **second cancellation request** cancels further 30% of the original ticket stake. Now the cancelled portion of the stake will increase to 80%, while 20% of the original stake will still be active.\
Since the request has to contain the latest intended percentage (usually the accumulated percentage of this and all previous cancellation requests), its value is : "percentage": "0.8".

<details>

<summary><strong>Cancellation Request</strong></summary>

```json
{
  "operatorId": 9985,
  "content": {
    "type": "cancel",
    "cancellationId": "CANC8850406",
    "details": {
      "type": "ticket-partial",
      "ticketId": "Ticket_3691",
      "ticketSignature": "HHDut7XIEl+SmjWB3xDB0AIB6fUZVFOvmGKm6Rcvxm0=",
      "code": 101,
      "percentage": "0.8"
    }
  },
  "correlationId": "nsG39xYika2",
  "timestampUtc": 1696944035000,
  "operation": "ticket-cancel",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Cancellation Response</strong></summary>

```
{
  "content": {
    "type": "cancel-reply",
    "cancellationId": "CANC8850406",
    "signature": "LnjC9aeE4RfBXyvnVeeiNogGBHIU8ykmmuG3y9Wc6SM=",
    "status": "accepted",
    "ticketId": "Ticket_3691",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "nsG39xYika2",
  "timestampUtc": 1696944036000,
  "operation": "ticket-cancel",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Acknowledgement Message</strong></summary>

```
{
  "operatorId": 9985,
  "content": {
    "type": "cancel-ack",
    "cancellationId": "CANC8850406",
    "ticketId": "Ticket_3691",
    "cancellationSignature": "LnjC9aeE4RfBXyvnVeeiNogGBHIU8ykmmuG3y9Wc6SM=", 
    "acknowledged": true
  },
  "correlationId": "bqc82h64x0e",
  "timestampUtc": 1696944039000,
  "operation": "ticket-cancel-ack",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Acknowledgement Reply Message</strong></summary>

```json
{
  "content": {
    "type": "cancel-ack-reply",
    "cancellationId": "CANC8850406",
    "signature": "Ut0Bb+0t9h8FKWn3AtiydcZ4cujTZgBRhdxUW665Rcg=",
    "status": "accepted",
    "ticketId": "Ticket_3691",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "bqc82h64x0e",
  "timestampUtc": 1696944040000,
  "operation": "ticket-cancel-ack",
  "version": "3.0"
}
```

</details>

<br>

The **third cancellation request** intends to cancel the remaining 20% of the original ticket stake. Now 100% of the original stake will be cancelled.\
In this request the details.type value should be "type": "ticket" (which does not include the percentage field).

<details>

<summary><strong>Cancellation Request</strong></summary>

```json
{
  "operatorId": 9985,
  "content": {
    "type": "cancel",
    "cancellationId": "CANC8852612",
    "details": {
      "type": "ticket",
      "ticketId": "Ticket_3691",
      "ticketSignature": "HHDut7XIEl+SmjWB3xDB0AIB6fUZVFOvmGKm6Rcvxm0=",
      "code": 101
    }
  },
  "correlationId": "ikz38sm2by5",
  "timestampUtc": 1696944342000,
  "operation": "ticket-cancel",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Cancellation Response</strong></summary>

```json
{
  "content": {
    "type": "cancel-reply",
    "cancellationId": "CANC8852612",
    "signature": "BKHPDBcCfOq8P1wE9ZORCty9T8YziM4b+7Hxj60djRo=",
    "status": "accepted",
    "ticketId": "Ticket_3691",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "ikz38sm2by5",
  "timestampUtc": 1696944343000,
  "operation": "ticket-cancel",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Acknowledgement Message</strong></summary>

```json
{
  "operatorId": 9985,
  "content": {
    "type": "cancel-ack",
    "cancellationId": "CANC8852612",
    "ticketId": "Ticket_3691",
    "cancellationSignature": "BKHPDBcCfOq8P1wE9ZORCty9T8YziM4b+7Hxj60djRo=", 
    "acknowledged": true
  },
  "correlationId": "d82myk2pl5c",
  "timestampUtc": 1696944345000,
  "operation": "ticket-cancel-ack",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Acknowledgement Reply Message</strong></summary>

```json
{
  "content": {
    "type": "cancel-ack-reply",
    "cancellationId": "CANC8852612",
    "signature": "9O5SJ327E7V+VmkVp67coLAe8IXa0sdyOlbPJyy0/dk=",
    "status": "accepted",
    "ticketId": "Ticket_3691",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "d82myk2pl5c",
  "timestampUtc": 1696944346000,
  "operation": "ticket-cancel-ack",
  "version": "3.0"
}
```

</details>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sportradar.com/mts/transaction-3.0-api/mts-related-transaction-examples/cancellation-examples/successive-partial-ticket-cancellations-with-acknowledgements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
