API Reference
Get User Points

Get User Points

Retrieve a user's current game point balance by wallet address.

Endpoint Details

  • Method: GET
  • Path: /get-points-by-address
  • Content-Type: application/json
GET https://partner-api.example.com/get-points-by-address?address=0xabcd....a

Request Parameters

Query Parameters

ParameterTypeRequiredDescription
addressstringUser's wallet address (case-insensitive)

Headers

HeaderDescriptionExample
X-API-KEYYour API keyyour_api_key
X-API-REQUESTUnique UUID v701987d64-6519-747b-9200-beba98700464
X-API-SIGNATUREHMAC signature92aa703cc483ea2cc90488c05e699179...

Response Format

Success Response

HTTP Status: 200 OK

{
  "success": true,
  "partnerUserId": "123",
  "address": "0xabcd....a",
  "points": 1000,
  "chain": "abstract",
  // Optional: additional custom fields
}

Required Fields

FieldTypeDescription
successbooleanMust be true
partnerUserIdstringYour internal user ID
addressstringWallet address
pointsintegerCurrent point balance
chainstringBlockchain network

Supported Chains

  • abstract
  • ronin
  • ethereum
  • Custom chain identifiers

Example Implementation

app.get('/get-points-by-address', async (req, res) => {
  try {
    // Validate authentication
    if (!validateAuth(req.headers)) {
      return res.json({
        success: false,
        errorCode: 'ERR-AUTH-FAILED',
        errorMessage: 'Authentication failed'
      });
    }
    
    const { address } = req.query;
    
    // Find user by wallet address
    const user = await findUserByWallet(address);
    
    if (!user) {
      return res.json({
        success: false,
        errorCode: 'ERR-USER-NOT-FOUND',
        errorMessage: 'User not found'
      });
    }
    
    res.json({
      success: true,
      partnerUserId: user.id,
      address: address.toLowerCase(),
      points: user.points,
      chain: 'abstract'
    });
    
  } catch (error) {
    res.json({
      success: false,
      errorCode: 'ERR-INTERNAL',
      errorMessage: 'Internal server error'
    });
  }
});

Testing

🧪

Test your implementation with various scenarios:

  • Valid wallet address with points
  • Valid wallet address with zero points
  • Invalid/non-existent wallet address
  • Malformed wallet address
  • Missing authentication headers