BITUP Partner API

Seamless Wallet Integration Guide

1. Overview

BITUP Partner API enables seamless integration between partner systems and the BITUP betting platform. Partners can manage user accounts, process bets, and handle payouts through a secure callback-based architecture.

Base URL

https://bet.bitupgo.com/api/partner.php

Authentication

All requests require the X-Partner-Key header with your assigned secret key.

X-Partner-Key: your_callback_secret_key

Response Format

All responses are JSON with success boolean field.

2. Partner API Endpoints

2.1 Login (SSO)

POST /api/partner.php?action=login

Generate a single sign-on URL for a user. Auto-registers if user doesn't exist.

Request

ParameterTypeRequiredDescription
user_idstringYesUsername
user_pwstringYesPassword
nicknamestringNoDisplay name (defaults to user_id)

Response

{
  "success": true,
  "login_url": "https://bet.bitupgo.com/auth/token_login.php?token=abc123...",
  "expires_in": 60
}
Token expires in 60 seconds. Redirect user to login_url for automatic authentication.

2.2 Balance

GET /api/partner.php?action=balance&user_id=xxx

ParameterTypeRequiredDescription
user_idstringYesUsername

Response

{
  "success": true,
  "data": {
    "user_id": "username",
    "nickname": "display_name",
    "balance": 500000.00
  }
}

2.3 Result

GET /api/partner.php?action=result&tx_id=xxx

Get bet result by transaction ID.

ParameterTypeRequiredDescription
tx_idstringYesTransaction ID from debit callback

Response

{
  "success": true,
  "data": {
    "tx_id": "tx_xxx",
    "user_id": "username",
    "game_id": "202601270001",
    "bet_type": "UP",
    "amount": 10000.00,
    "approved_amount": 10000.00,
    "win_amount": 19500.00,
    "profit": 9500.00,
    "result": "win",
    "start_price": 100000.50,
    "end_price": 101000.50,
    "round_result": "UP",
    "status": "approved",
    "created_at": "2026-01-27 12:34:56",
    "settled_at": "2026-01-27 12:35:30"
  }
}

2.4 History

GET /api/partner.php?action=history&user_id=xxx

ParameterTypeRequiredDescription
user_idstringYesUsername
limitintNoRecords per page (default 20, max 100)
offsetintNoPagination offset (default 0)

Response

{
  "success": true,
  "data": [
    {
      "tx_id": "tx_xxx",
      "bet_type": "UP",
      "amount": 10000.00,
      "win_amount": 19500.00,
      "result": "win",
      "game_id": "202601270001",
      "created_at": "2026-01-27 12:34:56"
    }
  ]
}

2.5 Create Sub-Partner

POST /api/partner.php?action=create_partner

ParameterTypeRequiredDescription
user_idstringYesUsername
user_pwstringYesPassword (min 4 chars)
nicknamestringNoDisplay name
commission_ratefloatNoCommission % (0 ~ your rate)
prefixstringYes3-16 chars, uppercase alphanumeric + underscore

Response

{
  "success": true,
  "partner": {
    "user_id": 123,
    "username": "PREFIX_username",
    "partner_code": "PREFIX_ABC123",
    "commission_rate": 2.0
  }
}
Prefix must be unique. Username is auto-prepended with parent's prefix. Prefix cannot be changed after creation.

2.6 Commission History

GET /api/partner.php?action=commission

ParameterTypeRequiredDescription
date_fromstringNoStart date Y-m-d (default: 7 days ago)
date_tostringNoEnd date Y-m-d (default: today)
game_typestringNo"30s" or "60s"

Response

{
  "success": true,
  "summary": {
    "total_count": 150,
    "total_commission": 50000.00,
    "total_bet_amount": 1000000.00
  },
  "data": [...]
}

3. Seamless Wallet Callbacks

When a partner enables seamless wallet mode, BITUP sends HTTP callbacks to the partner's configured URLs for all balance operations.

Callback Authentication

POST {your_callback_url}
Content-Type: application/json
X-Signature: HMAC-SHA256(request_body, callback_secret_key)
X-Partner-Id: {partner_id}
Verify X-Signature by computing HMAC-SHA256 of the raw request body using your callback_secret_key. Reject requests with mismatched signatures (HTTP 401).

Common Response Format

// Success
{ "success": true, "balance": 490000.00, "tx_id": "tx_xxx" }

// Failure
{ "success": false, "error": "Insufficient balance" }

3.1 Balance Inquiry

POST {callback_balance_url}

{
  "action": "balance",
  "user_id": "username",
  "timestamp": 1672531200
}

Expected Response:

{ "success": true, "balance": 500000.00 }

3.2 Debit (Bet Placement)

POST {callback_debit_url}

{
  "action": "debit",
  "user_id": "username",
  "game_id": "202601270001",
  "game_type": "30s",
  "amount": 10000.00,
  "tx_id": "tx_abc123",
  "timestamp": 1672531200
}

Expected Response:

{ "success": true, "balance": 490000.00, "tx_id": "tx_abc123" }
If debit fails (insufficient funds), the bet is automatically cancelled.

3.3 Credit (Payout)

POST {callback_credit_url}

{
  "action": "credit",
  "user_id": "username",
  "game_id": "202601270001",
  "game_type": "30s",
  "win_amount": 19500.00,
  "tx_id": "tx_abc123",
  "start_price": 100000.50,
  "end_price": 101000.50,
  "result": "UP",
  "timestamp": 1672531200
}

Expected Response:

{ "success": true, "balance": 509500.00 }

3.4 Cancel (Refund)

POST {callback_cancel_url}

{
  "action": "cancel",
  "user_id": "username",
  "game_id": "202601270001",
  "amount": 10000.00,
  "tx_id": "tx_abc123",
  "void_reason": "Round cancelled",
  "timestamp": 1672531200
}

Expected Response:

{ "success": true, "balance": 500000.00 }

4. Egg (R) System

Partners have an egg balance that acts as both a betting limit and GGR settlement ledger.

EventEgg ChangeDescription
User places bet-stakePartner egg decreases
User wins+payoutPartner egg increases (house covers)
User losesNo changeStake already deducted = partner profit
Bet cancelled/void+stakeRefunded to partner
If partner egg balance is insufficient, user bets are rejected with "Partner betting limit exceeded" error.

5. Error Codes

HTTP CodeDescription
200Success (check success field in body)
401Invalid or missing X-Partner-Key
400Missing required parameters or invalid action
500Server error

6. Game Types

TypeDurationPayout RateDescription
30s30 seconds1.95xBTC price UP/DOWN prediction
60s60 seconds1.95xBTC price UP/DOWN prediction

7. Security Recommendations