For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 CancelRequest

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)

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

Wire JSON — step 2

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

Wire JSON — step 3

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_partialcustomer_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"):

Common mistakes

Mistake
Result

Percentage 0.6 / 0.9 on cancel

Those percentages belong to cashout_partial; 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 in the parent manual.

Was this helpful?