Skip to content

Get risk by customer ID

GET
/api/v4/partner/risk/by-customer/{customerId}

Retrieve risk history for all wallet addresses associated with a customer.

Authorizations

ApiKeyAuth
Type
API Key (header: X-Api-Key)

Parameters

Path Parameters

customerId*
Type
string
Required

Responses

OK

application/json
JSON
{
"status": "ok",
"payload": {
"addresses": {
"0x1111111111111111111111111111111111111111": {
"customerId": "customer_a1b2c3d4",
"addressEVM": "0x1111111111111111111111111111111111111111",
"registerTimestamp": 1724247261,
"riskScores": [
{
"risk": "LOW",
"reviewTimestamp": 1711097427,
"reviewType": "INITIAL",
"reviewComment": "Review comment example",
"reviewData": {
"fromAddress": "0x2222222222222222222222222222222222222222",
"amount": "10000",
"totalAmount": "99999"
}
}
]
}
}
}
}

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Within each returned RiskEntry, the riskScores array is ordered from newest to oldest. Read riskScores[0] to get the latest completed review for that address.

Code examples

bash
curl -X GET "https://api.brrr.network/api/v4/partner/risk/by-customer/cust_a1b2c3d4" \
  -H "X-Api-Key: YOUR_API_KEY"
javascript
const customerId = 'cust_a1b2c3d4';

const response = await fetch(
  `https://api.brrr.network/api/v4/partner/risk/by-customer/${customerId}`,
  {
    headers: {
      'X-Api-Key': process.env.BRRR_API_KEY,
    },
  }
);

if (!response.ok) {
  const error = await response.json();
  throw new Error(`Risk check failed: ${error.errorCode}`);
}

const data = await response.json();
const addresses = Object.values(data.payload?.addresses ?? {});
const latestScores = addresses
  .map((entry) => entry.riskScores?.[0])
  .filter(Boolean);
const blocked = latestScores.some(
  (score) => score.risk === 'HIGH' || score.risk === 'VERY HIGH'
);

if (blocked) {
  console.warn('Customer has at least one blocked address.');
}
python
import os
import httpx

customer_id = 'cust_a1b2c3d4'

response = httpx.get(
    f'https://api.brrr.network/api/v4/partner/risk/by-customer/{customer_id}',
    headers={'X-Api-Key': os.environ['BRRR_API_KEY']},
)
response.raise_for_status()
data = response.json()

# data['payload']['addresses'] is a mapping of address -> RiskEntry
addresses = data['payload']['addresses'].values()
latest_scores = [entry['riskScores'][0] for entry in addresses if entry.get('riskScores')]

blocked = any(
    score['risk'] in ('HIGH', 'VERY HIGH') for score in latest_scores
)
if blocked:
    print('Customer has at least one blocked address.')