Redirect2U Operator API (1.0.0)

Download OpenAPI specification:

Redirect2U Operator API

Overview

This API suite provides a unified and standardized interface for accessing multiple game provider platforms through a single integration.

Instead of integrating with each game provider individually (each with their own authentication, request formats, and error handling), this platform aggregates and normalizes all supported game provider APIs into one consistent API specification.

All endpoints in this API suite:

  • Use HTTP POST

  • Accept JSON request bodies

  • Require HMAC-based authentication

  • Return a standardized response format

Important Credentials to be provided by Redirect2U to Operators

Credential Description
Base URL Base URL for all API requests
ApiKey Unique identifier for the operator, begins with key_
Secret Secret key used for HMAC signature generation, begins with secret_

Authentication & Security

All requests must be authenticated using API Key + HMAC Signature.

Required Request Headers

Header Required Description
ApiKey Yes Unique identifier for the operator, begins with key_
Timestamp Yes Unix timestamp in seconds representing request time
Signature Yes HMAC-SHA256 signature (Base64 encoded)

Signature Generation

Each request must include a valid Signature header.

Signature Algorithm

The signature is generated using HMAC-SHA256 and Base64 encoding.

Message Composition Order

message = raw_request_body + request_path + timestamp

Where:

  • raw_request_body = exact raw JSON payload (no formatting changes)

  • request_path = full request URL path (including query string if any)

  • timestamp = value of the Timestamp request header

PHP (Yii2) Example

$data = \Yii::$app->request->getRawBody();
$path = \Yii::$app->request->url;
$timestamp = \Yii::$app->request->headers->get('Timestamp');
$message = $data . $path . $timestamp;
$expected_signature = base64_encode(
    hash_hmac('sha256', $message, $secret, true)
);

The generated value must be sent in the Signature header.

Timestamp Validation

  • Requests are time-sensitive.

  • Requests with timestamps outside the allowed time window will be rejected.

  • Ensure server clocks are synchronized (NTP recommended).

Request Rules

  • HTTP Method: POST only

  • Content-Type: application/json

  • Body: JSON object (may be empty {} for some endpoints)

  • Character Encoding: UTF-8

  • Raw Body Integrity: Any modification (whitespace, formatting, ordering) after signature generation will invalidate the request.

Standard Response Format

All API responses follow the same structure:

{
  "code": 0,
  "message": "Success",
  "data": {}
}

Response Fields

Field Type Description
code integer Business-level response code (0 = success)
message string Human-readable description
data mixed Response payload (object or array)

Note:
Even when HTTP status is 200, the request may still fail logically. Always check the code field.

Error Codes

400 – Bad Request

Code Description
40000 Bad request
40001 API key is required
40002 Timestamp is required
40003 Signature is required
40004 Required parameter is missing
40005 Invalid parameter value
40006 Invalid game
40007 Game function not implemented
40008 Invalid username
40009 Username already used
40010 Operator reference ID already exists
40011 Insufficient credit limit
40012 Transaction not found

403 – Forbidden

Code Description
40300 Forbidden
40301 Unknown API key
40302 Expired request
40303 Signature mismatch

405 – Method Not Allowed

Code Description
40500 Method not allowed

500 – Internal Server Error

Code Description
50000 Internal server error
50001 Game provider API exception

Common Causes of Authentication Failure

  • Incorrect raw request body used during signature generation

  • Mismatch between request URL path and signed path

  • Timestamp drift between client and server

  • Invalid or inactive API key

  • Incorrect secret key

Best Practices

  • Always generate the signature after constructing the final request body

  • Do not pretty-print or re-encode JSON after signing

  • Use server-side time for timestamp generation

  • Log full request data when debugging signature issues (excluding secrets)

Get Operator Credit Balance

Get the Operator's remaining credit balance in Redirect2U.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": {
    }
}

Get Game List

Get the list of Game Providers that Redirect2U supports.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": [
    ]
}

Get Game Product List

Get the list of Products that the Game Provider has.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game to get the Product list.

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming"
}

Response samples

Content type
application/json
{}

Create Account

Create a new player account in Game Provider platform.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to create the player account in.

username
required
string

The desired username.

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": {
    }
}

Get Balance

Get the player's account's remaining balance in Game Provider platform.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to get player's account details from.

username
required
string

The username.

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": {
    }
}

Launch Game

Generate the login token or retrieve all necessary information needed for the player to login to their account in the Game Provider platform.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to launch game in.

username
required
string

The username.

product_id
string

The Product that the player wants to play.

If the Game Provider's login_mode=direct-game, this parameter is required. Otherwise, it is ignored.

Responses

Request samples

Content type
application/json
Example
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc"
}

Response samples

Content type
application/json
Example
{}

Logout Account

Logout the player's game session in the Game Provider platform.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to logout player's account from.

username
required
string

The username.

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": true
}

Deposit

Perform a Deposit into the player's account in the Game Provider platform.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to deposit into.

username
required
string

The username.

amount
required
integer

The amount to deposit into the Game Provider.

operator_reference_id
required
string

Operator's reference identifier.

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc",
  • "amount": 10,
  • "operator_reference_id": "00000009"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": {
    }
}

Withdraw

Perform a Withdraw from the player's account in the Game Provider platform.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to withdraw from.

username
required
string

The username.

amount
required
integer

The amount to withdraw from the Game Provider.

operator_reference_id
required
string

Operator's reference identifier.

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc",
  • "amount": 10,
  • "operator_reference_id": "00000010"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": {
    }
}

Check Transaction Status

Check the status of a Deposit or Withdraw transaction.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to withdraw from.

username
required
string

The username.

operator_reference_id
required
string

Operator's reference identifier.

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc",
  • "operator_reference_id": "00000002"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": {
    }
}

Get Game Log

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to pull the Game Log from.

username
string

The username.

start_time
required
integer

The start time to pull the Game Log from. Condition used: >= (inclusive)

end_time
required
integer

The end time to pull the Game Log until. Condition used: < (exclusive)

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc",
  • "start_time": 1767021054,
  • "end_time": 1767024655
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": {
    }
}

Get Credit Log

Get Credit Logs for a specific Game Provider platform.

header Parameters
ApiKey
string
Timestamp
string
Signature
string
Request Body schema: application/json
game_code
required
string

The Game Provider to pull the Credit Log from.

username
string

The username.

start_time
required
integer

The start time to pull the Credit Log from. Condition used: >= (inclusive)

end_time
required
integer

The end time to pull the Credit Log until. Condition used: < (exclusive)

Responses

Request samples

Content type
application/json
{
  • "game_code": "richgaming",
  • "username": "dddadgsdc",
  • "start_time": 1767021054,
  • "end_time": 1767024655
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "Success",
  • "data": {
    }
}