> 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/sandbox/user-manual/cancel_full_rejected.md).

# cancel\_full\_rejected

**Goal:** Send a full ticket cancel and receive a **rejected** reply with code **-2013**.

Sandbox module name: `cancel_full_rejected`.

## How to build the request (Java SDK)

{% stepper %}
{% step %}

## Create the cancel request

Use the same shape as [`cancel_full_accepted`](broken://pages/7322265e3fb49e7375c76f0c6dee9a2f50c6c76c): `CancelRequest` + `CancelDetails.newTicketCancelDetailsBuilder()`.
{% endstep %}

{% step %}

## Route the request

Route with either:

* **Magic `ticketId`:** `"mock_cancel_rejected"`, or
* **`meta.punter.id`:** `"customer_cancel_rejected"` with any normal `ticketId`.
  {% endstep %}

{% step %}

## Send the request

Send with `mbsSdk.getTicketProtocol().sendCancel(request)`.
{% endstep %}
{% endstepper %}

## Java example

```java
import com.sportradar.mbs.sdk.entities.cancellation.CancelDetails;
import com.sportradar.mbs.sdk.entities.common.AcceptanceStatus;
import com.sportradar.mbs.sdk.entities.request.CancelRequest;
import com.sportradar.mbs.sdk.entities.response.CancelResponse;

CancelRequest request = CancelRequest.newBuilder()
    .setCancellationId("cncl-rej")
    .setDetails(CancelDetails.newTicketCancelDetailsBuilder()
        .setTicketId("mock_cancel_rejected")
        .setTicketSignature("sandbox-signature")
        .build())
    .build();

CancelResponse response = mbsSdk.getTicketProtocol().sendCancel(request);
// expect: response.getStatus() == AcceptanceStatus.REJECTED, getCode() == -2013
```

## Wire JSON (what the SDK sends)

```json
{
  "operatorId": 9985,
  "correlationId": "corr-1",
  "timestampUtc": 1710000000000,
  "operation": "ticket-cancel",
  "version": "3.0",
  "content": {
    "type": "cancel",
    "cancellationId": "cncl-rej",
    "details": {
      "type": "ticket",
      "ticketId": "mock_cancel_rejected",
      "ticketSignature": "sandbox-signature"
    }
  }
}
```

| Field name                        | Value                    | Mandatory / Optional | Data type | Ignored by sandbox                |
| --------------------------------- | ------------------------ | -------------------- | --------- | --------------------------------- |
| `operatorId`                      | `9985`                   | Mandatory            | integer   | Yes                               |
| `correlationId`                   | `"corr-1"`               | Mandatory            | string    | No (echoed in reply)              |
| `timestampUtc`                    | `1710000000000`          | Mandatory            | integer   | Yes                               |
| `operation`                       | `"ticket-cancel"`        | Mandatory            | string    | No                                |
| `version`                         | `"3.0"`                  | Mandatory            | string    | No (echoed in reply)              |
| `content.type`                    | `"cancel"`               | Mandatory            | string    | No                                |
| `content.cancellationId`          | `"cncl-rej"`             | Mandatory            | string    | No (echoed in reply)              |
| `content.details.type`            | `"ticket"`               | Mandatory            | string    | No (routing: full cancel)         |
| `content.details.ticketId`        | `"mock_cancel_rejected"` | Mandatory (sandbox)  | string    | No (routing via magic id; echoed) |
| `content.details.ticketSignature` | `"sandbox-signature"`    | Mandatory            | string    | Yes                               |

Magic map: `mock_cancel_rejected` → `customer_cancel_rejected`.

## Expected response

| Java getter           | Expected value                           |
| --------------------- | ---------------------------------------- |
| `getStatus()`         | `AcceptanceStatus.REJECTED`              |
| `getCode()`           | `-2013`                                  |
| `getMessage()`        | `"Ticket time for cancellation expired"` |
| `getCancellationId()` | `"cncl-rej"` (echo)                      |
| `getTicketId()`       | `"mock_cancel_rejected"` (echo)          |

Wire JSON (content type `"cancel-reply"`; no cancel-ack on this reject path):

```json
{
  "correlationId": "corr-1",
  "timestampUtc": 1710000001000,
  "operation": "ticket-cancel",
  "version": "3.0",
  "content": {
    "type": "cancel-reply",
    "cancellationId": "cncl-rej",
    "ticketId": "mock_cancel_rejected",
    "status": "rejected",
    "code": -2013,
    "message": "Ticket time for cancellation expired",
    "signature": "sandbox-signature"
  }
}
```

{% hint style="info" %}
This is a successful protocol round-trip with a rejected `CancelResponse` — handle with `if` on `getCode()` / `getStatus()`, not try/catch.
{% endhint %}

## Common mistakes

| Mistake                                                   | Result                                                                                         |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Using `mock_cancel_accepted` / `customer_cancel_accepted` | Hits [`cancel_full_accepted`](broken://pages/7322265e3fb49e7375c76f0c6dee9a2f50c6c76c) instead |
| Wrong magic id and no matching punter                     | Fallback `-999`                                                                                |
| Treating `-2013` as a transport / schema error            | It is a sandbox scenario reject on `cancel-reply`                                              |

See also: [Error responses](broken://pages/3cdf760ce49fd6992d47d7772f4a4b9f67f0519f#error-responses) in the parent manual.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.sportradar.com/transaction30api/sandbox/user-manual/cancel_full_rejected.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
