Telegram
API Documentation

API for Integrating with the CodeHub94 Gaming Platform

Overview

This API provides endpoints for integrating with the CodeHub94 gaming platform.

Key Features

Base URL

https://apis.codehub94.shop/api/

All endpoints use the POST method with JSON request bodies. Responses are JSON.

Authentication

Authentication is handled via the agency_uid field in the request body, which serves as your API key. The home_url host must match the whitelisted domain.

Common Parameters

The following parameters are common across most endpoints:

Parameter Type Required Description
agency_uid String Yes API key.
member_account String Yes Player account ID. Must start with 'hfb20f' followed by your custom identifier, and end with your assigned suffix (case-insensitive, trimmed). Contact support for your suffix.
timestamp Integer Yes Unix timestamp in milliseconds.
credit_amount Float Varies Amount for credit/transfer.
currency_code String Yes Currency code (e.g., "USD").
language String Yes Language code (e.g., "en").
platform String Yes Platform identifier (e.g., "web").
home_url String Yes Full home URL.
transfer_id String Yes Unique transfer ID.

Get Balance

Fetches the player's balance.

Endpoint

URL: /getBalance.php

Method: POST

Request Parameters

Uses common parameters; game_uid is optional. Set credit_amount to 0.

Example Request

{
  "agency_uid": "your_api_key",
  "member_account": "hfb20f_player123_yoursuffix",
  "timestamp": 1698755432000,
  "credit_amount": 0.0,
  "currency_code": "USD",
  "language": "en",
  "platform": "web",
  "home_url": "https://yourdomain.com/home",
  "transfer_id": "txn_abc123"
}

Example Response

Status: 200 OK

{
  "code": 0,
  "msg": "Succeed",
  "payload": { "after_amount": 150.5 }
}

Game Launch

Launches a game session.

Endpoint

URL: /gameLaunch.php

Method: POST

Request Parameters

Parameter Type Required Description
game_uid String Yes Game ID.

Example Request

{
  "agency_uid": "your_api_key",
  "member_account": "hfb20f_player123_yoursuffix",
  "game_uid": "game123",
  "timestamp": 1698755432000,
  "credit_amount": 100.0,
  "currency_code": "USD",
  "language": "en",
  "platform": "web",
  "home_url": "https://yourdomain.com/home",
  "transfer_id": "txn_abc123"
}

Example Response

Status: 200 OK

{
  "code": 0,
  "msg": "Succeed",
  "payload": { "game_launch_url": "https://codehub94.shop/game-launch?transfer_id=txn_abc123" }
}

Get Withdraw

Withdraws the balance if available.

Endpoint

URL: /getWithdraw.php

Method: POST

Request Parameters

Uses common parameters.

Example Request

{
  "agency_uid": "your_api_key",
  "member_account": "hfb20f_player123_yoursuffix",
  "timestamp": 1698755432000,
  "credit_amount": 0.0,
  "currency_code": "USD",
  "language": "en",
  "platform": "web",
  "home_url": "https://yourdomain.com/home",
  "transfer_id": "txn_abc123"
}

Example Response

Status: 200 OK

{
  "status": true,
  "message": "Withdraw successful",
  "amount": 150.5
}

Callback (Get Bet Transactions)

Retrieves bet transactions.

Endpoint

URL: /callback.php

Method: POST

Request Parameters

Parameter Type Required Description
agency_uid String Yes API key.

Example Request

{
  "agency_uid": "your_api_key"
}

Example Response

Status: 200 OK

{
  "code": 0,
  "msg": "Bet data retrieved successfully",
  "msgCode": 0,
  "serviceNowTime": "2025-10-08 12:34:56",
  "data": {
    "user_id": 1,
    "api_key": "your_api_key",
    "transactions": [
      {
        "id": 1,
        "user_id": 1,
        "txn_id": "bet123",
        "game_name": "Slots",
        "bet": 10.0,
        "win": 20.0,
        "result": "win",
        "created_at": "2025-10-08 12:00:00",
        "updated_at": "2025-10-08 12:00:00"
      }
    ],
    "timestamp": "2025-10-08 12:34:56"
  }
}

Best Practices