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

cancel_full_accepted

Goal: Send a full ticket cancel and receive an accepted cancel reply (sandbox also fills an accepted cancel-ack in the same underlying reply).

Sandbox module name: cancel_full_accepted.

How to build the request (Java SDK)

1

Build CancelRequest with a unique cancellationId

2

Set full ticket cancel details

Use CancelDetails.newTicketCancelDetailsBuilder() (JSON type "ticket") for a full cancel, not a partial cancel.

3

Route the request

Use either:

  • Magic ticketId: "mock_cancel_accepted" (preferred for pure Ticket 3.0 / SDK clients; no punter required), or

  • meta.punter.id: "customer_cancel_accepted" with any normal ticketId (dataplane Transaction).

4

Set ticketSignature

Ticket 3.0 requires a ticket signature on cancel details.

5

Send the request

mbsSdk.getTicketProtocol().sendCancel(request)

CancelRequest has no ticket context / mobile channel — those apply only when a nested ticket context appears (placement, max-stake, ticket-inform).

Java example

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-1")
    .setDetails(CancelDetails.newTicketCancelDetailsBuilder()
        .setTicketId("mock_cancel_accepted")
        .setTicketSignature("sandbox-signature")
        .build())
    .build();

CancelResponse response = mbsSdk.getTicketProtocol().sendCancel(request);
// expect: response.getStatus() == AcceptanceStatus.ACCEPTED, getCode() == 0

Equivalent routing without a magic id: keep any ticketId and ensure the sandbox Transaction has meta.punter.id = "customer_cancel_accepted".

Wire JSON (what the SDK sends)

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-1"

Mandatory

string

No (echoed in reply)

content.details.type

"ticket"

Mandatory

string

No (routing: full cancel)

content.details.ticketId

"mock_cancel_accepted"

Mandatory (sandbox)

string

No (routing via magic id; echoed)

content.details.ticketSignature

"sandbox-signature"

Mandatory

string

Yes

Ignored by sandbox means the field is not used for routing and not used when building the reply (schema-only for the WebSocket / Ticket 3.0 envelope). Magic map: mock_cancel_acceptedcustomer_cancel_accepted.

Expected response

On the Java client, assert against CancelResponse (sendCancel):

Java getter
Expected value

getStatus()

AcceptanceStatus.ACCEPTED

getCode()

0

getMessage()

"accepted" (sandbox)

getCancellationId()

"cncl-1" (echo)

getTicketId()

"mock_cancel_accepted" (echo)

Wire JSON (content type "cancel-reply"):

The sandbox also fills an accepted cancel-ack (same cancellationId / ticketId / message) in the same internal reply. sendCancel surfaces the cancel-reply as CancelResponse.

Assert on getStatus(), getCode(), and getMessage().

Common mistakes

Mistake
Result

Wrong / missing magic ticketId and no meta.punter.id = customer_cancel_accepted

Fallback rejection (-999)

Using newTicketPartialCancelDetailsBuilder()

Routes to partial-cancel scenarios (or fallback)

Expecting reject -2013

That is cancel_full_rejected (mock_cancel_rejected / customer_cancel_rejected)

See also: Error responses in the parent manual.

Was this helpful?