Skip to main content

iGaming Integration Guide

This guide provides a comprehensive workflow for integrating Cryptofuse payment processing into your online iGaming platform. Follow these steps to implement a complete player journey from registration to deposits and withdrawals.

Cryptofuse iGaming Flow Overview

The Cryptofuse system handles all blockchain interactions internally, providing a simplified payment processing experience for your casino operation.

This multi-tier approach allows:

  • Master Account: Your main tenant account that manages all funds
  • Sub-Accounts (Wallets): Individual player wallets created under your master account

This structure enables seamless fund management between your platform and individual players while maintaining proper accounting and separation of funds.

Player Wallet Management

1. Creating Player Wallets

When a player registers, create a dedicated wallet for them:

POST /wallets/create

Request:

{
"name": "Player123_Wallet"
}

Response:

{
"result": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Player123_Wallet"
}
}

2. Listing All Wallets

To view all player wallets in your system:

POST /wallets

Response:

{
"result": {
"users": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Player123_Wallet"
},
{
"id": "661f9511-f29b-42d4-b826-557766551111",
"name": "Player456_Wallet"
}
],
"total": 2
}
}

3. Checking Specify Balance

View the available balances for a specific wallet:

POST /wallets

Request:

{
"wallet_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response:

{
"result": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Player123_Wallet",
"balances": [
{
"currency": "usdttrc20",
"amount": "1100.50",
"pendingAmount": "0.00"
}
]
}
}

4. Viewing All Balances

Get a comprehensive view of all balances across your master account and all player wallets:

GET /user/balances

Response:

{
"account": {
"usdtbsc": {
"amount": "1000.000000000000000000",
"pending_amount": "25.000000000000000000"
}
},
"sub_accounts": {
"usdtbsc": {
"total_amount": 5000,
"total_pending": 100,
"accounts": [
{
"account_name": "Player1",
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"amount": "3000.000000000000000000",
"pending_amount": "50.000000000000000000",
"available_balance": "2950.000000000000000000"
}
]
}
}
}

Deposit Flow

1. Displaying Available Currencies

Show players available cryptocurrencies with their details:

GET /currencies?full=true&min_max=true

Response:

{
"currencies": [
{
"currency": "USDTTRC20",
"name": "Tether",
"token": "USDT",
"network": "tron",
"is_popular": true,
"is_stable": true,
"min_amount": 11.0664131,
"max_amount": 8990.685536
}
]
}

2. Checking Minimum Payment Amount

Before creating a payment, check the minimum amount required:

GET /payments/min-amount?currency_from=USD&currency_to=USDTTRC20

Response:

{
"min_amount": 15.0
}

3. Creating a Payment Through Wallet

When a player initiates a deposit, create a payment through their wallet:

POST /wallets/payment/

Request:

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"currency": "USDTTRC20",
"amount": 100.00,
"is_fixed_rate": true,
"is_fee_paid_by_user": false,
"callback_url": "https://your-website.com/payment/callback"
}

Response:

{
"result": {
"payment_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"payment_status": "waiting",
"pay_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"price_amount": 75.00,
"price_currency": "usd",
"pay_amount": 75.00,
"amount_received": 0,
"pay_currency": "USDTTRC20",
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"order_description": "Player deposit",
"callback_url": "https://your-site.com/wallet/callback",
"created_at": "2025-05-05T10:49:27.414Z",
"updated_at": "2025-05-05T10:49:27.414Z",
"purchase_id": "e29b41d4-a716-4466-5544-000058cc4372",
"network": "tron",
"expiration_estimate_date": "2025-05-05T11:09:27.418Z",
"valid_until": "2025-05-05T11:09:27.418Z",
"type": "crypto2crypto"
}
}

4. Monitoring Payment Status

Check the status of a payment:

POST /payments/status/

Request:

{
"id": "550e8400-e29b-41d4-a716-446655440000"
}

Response:

{
"payment_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 100.00,
"currency": "USDTTRC20",
"status": "completed",
"created_at": "2025-04-30T12:34:56.789Z",
"completed_at": "2025-04-30T12:45:12.456Z"
}

Fund Management Between Accounts

1. Transferring Funds to Player Wallet

Transfer funds from your master account to a player's wallet:

POST /wallets/transfer-to-user/

Request:

{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"currency": "USDTTRC20",
"amount": 100.00
}

Response:

{
"result": {
"id": "transaction_123456",
"amount": 100.00,
"currency": "USDTTRC20",
"status": "completed"
}
}

2. Withdrawing Funds to Master Account

Transfer funds from a player's wallet to your master account:

POST /wallets/withdraw-to-master/

Request:

{
"wallet_id": "550e8400-e29b-41d4-a716-446655440000",
"currency": "USDTTRC20",
"amount": 50.00
}

Response:

{
"result": {
"id": "transaction_654321",
"amount": 50.00,
"currency": "USDTTRC20",
"status": "completed"
}
}

Withdrawal Flow

1. Checking Available Balances

View the player's available balances for withdrawal:

POST /wallets/

Request:

{
"wallet_id": "550e8400-e29b-41d4-a716-446655440000"
}

2. Validating Withdrawal Address

When a player enters a withdrawal address:

POST /withdrawal/validate-address/

Request:

{
"address": "TYN2WuEqttM5JjGk4ynGkxcnMRR9SZcvVx",
"blockchain": "TRX",
"token": "USDT"
}

Response:

{
"is_valid": true,
"address": "TYN2WuEqttM5JjGk4ynGkxcnMRR9SZcvVx",
"type": "TRX",
"blockchain": "TRX",
"token": "USDT"
}

3. Checking Minimum Withdrawal Amount

Verify the minimum withdrawal amount:

POST /withdrawal/min-amount/

Request:

{
"blockchain": "TRX",
"token": "USDT"
}

Response:

{
"min_amount": 20,
"blockchain": "TRX",
"token": "USDT"
}

4. Estimating Withdrawal Fee

Get an estimate of the withdrawal fee:

POST /withdrawal/fee-estimate/

Request:

{
"amount": 50.00,
"blockchain": "TRX",
"token": "USDT"
}

Response:

{
"currency": "USDTTRC20",
"fee": 1.50
}

5. Transferring Funds from Player Wallet to Master Account

This step is required before creating a withdrawal:

POST /wallets/withdraw-to-master/

Request:

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"currency": "USDTTRC20",
"amount": 50.00
}

6. Creating Withdrawal Request

Process the player's withdrawal from the master account:

POST /withdrawal/

Request:

{
"amount": 50.00,
"address": "TYN2WuEqttM5JjGk4ynGkxcnMRR9SZcvVx",
"blockchain": "TRX",
"token": "USDT",
"callback_url": "https://your-site.com/withdrawal/callback",
"custom_id": "Player123_Withdrawal",
"account_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response:

{
"withdrawal_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "pending",
"amount": 50.00,
"fee": 1.50,
"address": "TYN2WuEqttM5JjGk4ynGkxcnMRR9SZcvVx",
"blockchain": "TRX",
"token": "USDT",
"memo": null,
"created_at": "2025-04-30T12:34:56.789Z",
"custom_id": "Player123_Withdrawal"
}

7. Monitoring Withdrawal Status

Check the status of a withdrawal:

POST /withdrawal/

Request:

{
"id": "f49e8400-e29b-41d4-a716-446655440000",
}

Response:

{
"withdrawal_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "completed",
"amount": 50.00,
"fee": 1.50,
"address": "TYN2WuEqttM5JjGk4ynGkxcnMRR9SZcvVx",
"blockchain": "TRX",
"token": "USDT",
"transaction_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"created_at": "2025-04-30T12:34:56.789Z",
"completed_at": "2025-04-30T12:45:12.456Z"
}

Complete Cryptofuse Casino Integration Flow

The Cryptofuse system simplifies the standard casino flow by providing a multi-tier account structure with streamlined withdrawal processing:

Player Registration & Wallet Creation:

  1. When a player registers on your platform, create a dedicated wallet for them using the /wallets endpoint
  2. Store the wallet ID in your system, associated with the player's account
  3. Monitor the player's wallet balance using the /wallets/ with wallet_id in body endpoint

Deposit Process:

  1. Display available cryptocurrencies to the player using the /currencies endpoint
  2. When a player initiates a deposit, check the minimum payment amount using /payments/min-amount
  3. Create a payment for the player's wallet using /wallets/payment/ endpoint
  4. Show the deposit address and amount to the player
  5. Monitor the payment status using /payments/status/ with payment_id in body or webhooks
  6. Once the payment is complete, credit the player's balance in your system
  7. The funds will appear in your master account balance

Game Play & Internal Transfers:

  1. For game play, you may need to transfer funds from your master account to the player's wallet
    • Use /wallets/transfer-to-user/ to move funds from your master account to the player's wallet
  2. After game play, you may need to move winnings to the player's wallet
    • Use /wallets/transfer-to-user/ again for this purpose
  3. For internal accounting, you can move funds back to your master account
    • Use /wallets/withdraw-to-master/ to transfer funds from the player's wallet to your master account

Withdrawal Process:

  1. Player requests a withdrawal on your platform
  2. Validate the player's cryptocurrency address using /withdrawal/validate-address/
  3. Check if the amount meets the minimum requirement using /withdrawal/min-amount/
  4. Estimate the withdrawal fee using /withdrawal/fee-estimate/
  5. Transfer funds from the player's wallet to your master account using /wallets/withdraw-to-master/
  6. Create a withdrawal request from your master account using /withdrawal/
  7. Monitor the withdrawal status using /withdrawal/{id}/ or webhooks
  8. Update the player's status on your platform once the withdrawal is complete

Integration Workflow Diagram

  1. Account creation

Account creation

  1. Deposit

Deposit

  1. Manage assets

Manage

  1. Withdrawal

Withdrawal

Key Differences from Standard Casino Flow

The Cryptofuse system has several key differences from the standard casino flow described in other documentation:

  1. Multi-tier Account Structure:

    • Master account for the casino operator
    • Individual wallets (sub-accounts) for each player
    • Fund transfers between accounts using dedicated endpoints
  2. Simplified Withdrawal Process:

    • No 2FA/OTP verification step required
    • Withdrawals are processed automatically after creation
    • Status updates are provided via API or webhooks
  3. Additional Wallet Operations:

    • Transfer funds between master account and player wallets
    • Create payments directly from player wallets
    • Comprehensive balance viewing across all accounts

Implementation Notes

Wallet Management:

  • Each wallet represents a player's account in the system
  • Wallets can hold multiple cryptocurrencies with individual balances
  • Use the /user/balances endpoint for comprehensive balance monitoring
  • Keep track of wallet IDs in your system, associated with player accounts

Transaction Processing:

  • Cryptofuse handles all blockchain interactions
  • Monitor transaction statuses using API endpoints or webhooks
  • Implement proper error handling for all API requests
  • Create detailed logs for troubleshooting

Security Best Practices:

  • Validate all cryptocurrency addresses before processing withdrawals
  • Check minimum and maximum amounts for all transactions
  • Implement appropriate KYC/AML processes according to your jurisdiction
  • Set proper limits and monitoring for player activities

Integration Checklist:

  1. ✅ Implement wallet creation for new players
  2. ✅ Set up deposit flow with wallet payment creation
  3. ✅ Configure internal transfer mechanisms between accounts
  4. ✅ Implement withdrawal flow with address validation
  5. ✅ Set up webhooks for real-time status updates
  6. ✅ Implement comprehensive error handling
  7. ✅ Test the complete flow in a sandbox environment

Further Resources