The Cancel Bet API is called when the Place Bet API is timed out or the Operator returns a response in the wrong format against Naga Games.

Request

API URL : {OperatorAPIDomain}/{OperatorEndpoint}
HTTP Method : POST

Body Parameters

  • data (JSON)
    must contain all fields below.
NameDescriptionData TypeStatus
betIdUnique ID of the betString (length: 36)Required
playerTokenUnique token of the player

Note:
When the player token is enabled in the cancel bet configuration, the player token will be included in the payload for every request
String (length: 255)Optional
  • dataHash (String)
    All request data received from Naga Games is hashed with SHA-256 as a data checksum, signed with the private key, and generated for each operator using the RSA signing algorithm.

Header Parameters

  • X-Signature (String)
    Must be generated from signing process with correct order of data fields & privateKey.

🚧

About Signing & Verifying dataHash & Signature

Refer ➡️ How to signing & verify dataHash and signature for Seamless mode?

Response

📘

Response Structure

Refer ➡️ Success Response Structure and Failure Response Structure for HTTP Response structure and codes.

Data Response

NameDescriptionData Type
betIdUnique ID of the betString (length: 36)
statusThe status of the betMust be "CANCELED"
curl --location --request POST 'https://api-demo-operator.stg.game.topplatform.asia/vendor/cancel-bet' \
--header 'Content-Type: application/json' \
--data-raw '{
    "data" : {
        "betId" : "41984486-2234-4aa8-be82-df58eab8b121"
    },
    "dataHash" : "7884a27f65954d52346fd51e43fbba9cdfeca81f08d67782e2addb99069434e9"
}'

Example of Response

Success Response Example (HTTP status code 200)

{
    data: {
      "betId": "41984486-2234-4aa8-be82-df58eab8b121",
      "status": "CANCELED"
    },
    error: null,
}
{
    "betId": "",
    "status": "CANCLED"
}

Success Response Example (HTTP Status code 201)

{
        data: {
          betId: '',
          status: "CANCELED",
        },
        error: null,
};

Fail Response Example (HTTP status code 400)

{
        data: null,
        error: {
          statusCode: 400,
          message: 'Transaction Seamless Already Resolved',
        },
}

Fail Response Example (HTTP status code 400)

{
        data: null,
        error: {
          statusCode: 404,
          message: "Transaction Not Found"
         },
}
Language
Click Try It! to start a request and see the response here!