---
title: "cancel_partial"
canonical_url: "https://docs.sportradar.com/resources/transaction/docs/sandbox/user-manual/cancel_partial"
markdown_url: "https://docs.sportradar.com/resources/transaction/docs/sandbox/user-manual/cancel_partial.md"
last_updated: "2026-11-11T13:15:15Z"
---

# cancel_partial

**Goal:** Exercise the three partial-cancel sandbox steps for customer `customer_cancel_partial` (or magic ticketId `mock_cancel_partial`).

Sandbox modules: `cancel_partial_step1`, `cancel_partial_step2`, `cancel_partial_step3`.

## Routing

| Step | Details builder                          | Percentage | Expected message          |
| ---- | ---------------------------------------- | ---------- | ------------------------- |
| 1    | `newTicketPartialCancelDetailsBuilder()` | `0.5`      | `accepted;percentage=0.5` |
| 2    | `newTicketPartialCancelDetailsBuilder()` | `0.8`      | `accepted;percentage=0.8` |
| 3    | `newTicketCancelDetailsBuilder()` (full) | —          | `accepted`                |

Route with `mock_cancel_partial` as `ticketId`, or `meta.punter.id` = `"customer_cancel_partial"`.

## How to build the request (Java SDK)

1. **Build the **

   Use a unique `cancellationId` for each call.

2. **Send partial cancellation step 1**

   Use `CancelDetails.newTicketPartialCancelDetailsBuilder()` with percentage `0.5`.

3. **Send partial cancellation step 2**

   Use `CancelDetails.newTicketPartialCancelDetailsBuilder()` with percentage `0.8`.

4. **Send the full ticket cancellation**

   Switch to `CancelDetails.newTicketCancelDetailsBuilder()` for a full ticket cancel.

Send each step with `mbsSdk.getTicketProtocol().sendCancel(request)`.

## Java example (all three steps)

```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;
import java.math.BigDecimal;

// Step 1 — percentage 0.5
CancelResponse step1 = mbsSdk.getTicketProtocol().sendCancel(
    CancelRequest.newBuilder()
        .setCancellationId("cncl-p1")
        .setDetails(CancelDetails.newTicketPartialCancelDetailsBuilder()
            .setTicketId("mock_cancel_partial")
            .setTicketSignature("sandbox-signature")
            .setPercentage(new BigDecimal("0.5"))
            .build())
        .build());
// expect: ACCEPTED, message "accepted;percentage=0.5"

// Step 2 — percentage 0.8
CancelResponse step2 = mbsSdk.getTicketProtocol().sendCancel(
    CancelRequest.newBuilder()
        .setCancellationId("cncl-p2")
        .setDetails(CancelDetails.newTicketPartialCancelDetailsBuilder()
            .setTicketId("mock_cancel_partial")
            .setTicketSignature("sandbox-signature")
            .setPercentage(new BigDecimal("0.8"))
            .build())
        .build());
// expect: ACCEPTED, message "accepted;percentage=0.8"

// Step 3 — full ticket cancel
CancelResponse step3 = mbsSdk.getTicketProtocol().sendCancel(
    CancelRequest.newBuilder()
        .setCancellationId("cncl-p3")
        .setDetails(CancelDetails.newTicketCancelDetailsBuilder()
            .setTicketId("mock_cancel_partial")
            .setTicketSignature("sandbox-signature")
            .build())
        .build());
// expect: ACCEPTED, message "accepted"
```

## Wire JSON — step 1

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

## Wire JSON — step 2

Same as step 1 with `cancellationId` `"cncl-p2"` and `"percentage": "0.8"`.

## Wire JSON — step 3

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

## Request fields

| Field name                        | Value                                                | Mandatory / Optional  | Data type | Ignored by sandbox   |
| --------------------------------- | ---------------------------------------------------- | --------------------- | --------- | -------------------- |
| `operatorId`                      | `9985`                                               | Mandatory             | integer   | Yes                  |
| `correlationId`                   | *(string)*                                           | Mandatory             | string    | No (echoed in reply) |
| `timestampUtc`                    | *(integer)*                                          | 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`          | per step                                             | Mandatory             | string    | No (echoed in reply) |
| `content.details.type`            | `"ticket-partial"` (steps 1–2) / `"ticket"` (step 3) | Mandatory             | string    | No (routing)         |
| `content.details.ticketId`        | `"mock_cancel_partial"`                              | Mandatory (sandbox)   | string    | No (routing; echoed) |
| `content.details.percentage`      | `"0.5"` / `"0.8"`                                    | Mandatory (steps 1–2) | string    | No (routing)         |
| `content.details.ticketSignature` | `"sandbox-signature"`                                | Mandatory             | string    | Yes                  |

Magic map: `mock_cancel_partial` → `customer_cancel_partial`. Percentage facet is the float parsed from the string (`0.5` / `0.8`).

## Expected responses

| Step | `getStatus()` | `getCode()` | `getMessage()`            |
| ---- | ------------- | ----------- | ------------------------- |
| 1    | `ACCEPTED`    | `0`         | `accepted;percentage=0.5` |
| 2    | `ACCEPTED`    | `0`         | `accepted;percentage=0.8` |
| 3    | `ACCEPTED`    | `0`         | `accepted`                |

Example wire reply (step 1; content type `"cancel-reply"`):

```json
{
  "correlationId": "corr-1",
  "timestampUtc": 1710000001000,
  "operation": "ticket-cancel",
  "version": "3.0",
  "content": {
    "type": "cancel-reply",
    "cancellationId": "cncl-p1",
    "ticketId": "mock_cancel_partial",
    "status": "accepted",
    "code": 0,
    "message": "accepted;percentage=0.5",
    "signature": "sandbox-signature"
  }
}
```

## Common mistakes

| Mistake                             | Result                                                                                                                                                                         |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Percentage `0.6` / `0.9` on cancel  | Those percentages belong to [`cashout_partial`](https://docs.sportradar.com/resources/transaction/docs/sandbox/user-manual/cashout_partial.md); cancel falls through to `-999` |
| Step 3 still using `ticket-partial` | Does not match step 3 route (`ticket` + `customer_cancel_partial`)                                                                                                             |
| Wrong magic id                      | Fallback or a different cancel scenario                                                                                                                                        |

See also: [Error responses](https://docs.sportradar.com/resources/transaction/docs/sandbox/user-manual.md#error-responses) in the parent manual.
