GET
/
api
/
v2.1
/
customers
/
individual
/
categorization
/
hierarchy
/
{tenantId}
{
  "tenantId": "<string>",
  "tenantName": "<string>",
  "categories": {
    "categoryId": "<string>",
    "categoryName": "<string>",
    "databaseId": "<string>",
    "features": [
      {
        "featureCode": "<string>",
        "featureName": "<string>",
        "databaseId": "<string>",
        "mandatoryKeys": [
          {}
        ],
        "allowedValues": {}
      }
    ]
  }
}

Overview

The Categorization Hierarchy endpoint provides a comprehensive view of available customer categories and their associated features. This is essential for the smart categorization system that automatically assigns appropriate risk profiles and compliance requirements during customer registration.

Path Parameters

tenantId
string
required
The unique identifier of the tenant

Headers

Authorization
string
required
Bearer token for authentication
X-Tenant-ID
string
required
Tenant identifier for multi-tenant operations

Response

tenantId
string
The real tenant ID from the system
tenantName
string
Display name of the tenant
categories
object
Map of available categories keyed by category ID

Example Request

curl --request GET \
  --url https://api.finhub.cloud/api/v2.1/customers/individual/categorization/hierarchy/97e7ff29-15f3-49ef-9681-3bbfcce4f6cd \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'X-Tenant-ID: fh_api_finsei_ltd_7f957f77'
```text`n## Example Response

```json
{
  "tenantId": "97e7ff29-15f3-49ef-9681-3bbfcce4f6cd",
  "tenantName": "Finsei Ltd",
  "categories": {
    "e50bb9ad-6a97-41da-8e66-4c3c0f7e2a3d": {
      "categoryId": "e50bb9ad-6a97-41da-8e66-4c3c0f7e2a3d",
      "categoryName": "Medium Risk Individual",
      "databaseId": "e50bb9ad-6a97-41da-8e66-4c3c0f7e2a3d",
      "features": [
        {
          "featureCode": "MEDIUM_RISK_PROFILE",
          "featureName": "Medium Risk Profile Parameters",
          "databaseId": "f7a8b9c0-d1e2-3f4g-5h6i-7j8k9l0m1n2o",
          "mandatoryKeys": [
            "riskLevel",
            "riskScore",
            "pep",
            "sanctionsCheck",
            "monthlyLimit"
          ],
          "allowedValues": {
            "riskLevel": ["LOW", "MEDIUM", "HIGH"],
            "pep": ["true", "false"],
            "sanctionsCheck": ["STANDARD", "ENHANCED"]
          }
        }
      ]
    },
    "a12bb8cd-5e87-42dc-9f55-5d4d1g8h2b4e": {
      "categoryId": "a12bb8cd-5e87-42dc-9f55-5d4d1g8h2b4e",
      "categoryName": "High Risk Individual",
      "databaseId": "a12bb8cd-5e87-42dc-9f55-5d4d1g8h2b4e",
      "features": [
        {
          "featureCode": "HIGH_RISK_PROFILE",
          "featureName": "High Risk Profile Parameters",
          "databaseId": "g8b9c0d1-e2f3-4g5h-6i7j-8k9l0m1n2o3p",
          "mandatoryKeys": [
            "riskLevel",
            "riskScore",
            "pep",
            "sanctionsCheck",
            "eddRequired",
            "monthlyLimit"
          ]
        }
      ]
    }
  }
}
```text`n## Usage in Registration Flow

The categorization hierarchy is used during customer registration to:

1. **Select appropriate category** - Based on customer profile and risk assessment
2. **Configure features** - Apply mandatory parameters with appropriate values
3. **Set compliance requirements** - Determine verification levels needed

### Smart Category Selection Example

```javascript
// Analyze categories to find suitable one for medium-risk clients
const mediumRiskCategories = Object.values(response.categories).filter(category => 
  category.categoryName.match(/MEDIUM.*RISK|MED.*RISK|STANDARD|VERIFIED/i)
);

// Select the most appropriate category
const selectedCategory = mediumRiskCategories[0] || 
  Object.values(response.categories).find(c => c.categoryName.includes('Individual'));

// Configure feature parameters for registration
const categoryFeatureRelations = selectedCategory.features.map(feature => ({
  feature: {
    id: feature.databaseId,
    code: feature.featureCode
  },
  enabled: true,
  parametrization: feature.mandatoryKeys.map(key => ({
    name: key,
    value: determineValue(key) // Custom logic based on risk profile
  }))
}));
```text`n### Risk-Based Parameter Values

| Parameter | Low Risk | Medium Risk | High Risk |
|-----------|----------|-------------|-----------|
| riskLevel | LOW | MEDIUM | HIGH |
| riskScore | 0-30 | 31-70 | 71-100 |
| pep | false | false | true |
| sanctionsCheck | BASIC | STANDARD | ENHANCED |
| eddRequired | false | false | true |
| monthlyLimit | 50000 | 20000 | 10000 |

## PowerShell Script Example

```powershell
# Get categorization hierarchy
$tenantId = "your-tenant-id"
$headers = @{
    "Content-Type"  = "application/json"
    "X-Tenant-ID"   = "your-x-tenant-id"
    "Authorization" = "Bearer $adminToken"
}

$categorizationUrl = "$baseUrl/api/v2.1/customer/individual/categorization/hierarchy/$tenantId"

try {
    $hierarchyResponse = Invoke-RestMethod -Uri $categorizationUrl -Method Get -Headers $headers
    
    Write-Host "Successfully retrieved categorization hierarchy" -ForegroundColor Green
    
    # Display tenant information
    Write-Host "Tenant Information:" -ForegroundColor Magenta
    Write-Host "  Real Tenant ID: $($hierarchyResponse.tenantId)" -ForegroundColor White
    Write-Host "  Tenant Name: $($hierarchyResponse.tenantName)" -ForegroundColor White
    
    # Analyze categories to find suitable one for medium-risk clients
    $mediumRiskCategories = @()
    $individualCategories = @()
    $generalCategories = @()

    foreach ($categoryKey in $hierarchyResponse.categories.PSObject.Properties.Name) {
        $category = $hierarchyResponse.categories.$categoryKey
        
        if ($category.categoryName -match "MEDIUM.*RISK|MED.*RISK|STANDARD|VERIFIED") {
            $mediumRiskCategories += $category
        }
        elseif ($category.categoryName -match "Individual|INDIVIDUAL|Person|PERSON|B2C|b2c") {
            $individualCategories += $category
        }
        else {
            $generalCategories += $category
        }
    }

    # Select appropriate category
    if ($mediumRiskCategories.Count -gt 0) {
        $selectedCategory = $mediumRiskCategories[0]
        Write-Host "Found medium-risk category: $($selectedCategory.categoryName)" -ForegroundColor Green
    }
    elseif ($individualCategories.Count -gt 0) {
        $selectedCategory = $individualCategories[0]
        Write-Host "Found individual category: $($selectedCategory.categoryName)" -ForegroundColor Green
    }
    else {
        $selectedCategory = $generalCategories[0]
        Write-Host "Using general category: $($selectedCategory.categoryName)" -ForegroundColor Yellow
    }
    
    Write-Host "  Category ID: $($selectedCategory.categoryId)" -ForegroundColor White
    Write-Host "  Database ID: $($selectedCategory.databaseId)" -ForegroundColor Gray
}
catch {
    Write-Host "Failed to get categorization: $($_.Exception.Message)" -ForegroundColor Red
}
```text`n## Related Endpoints

- [Create Individual Customer](/latest/api-reference/v2.1/customer/individual-register) - Uses categorization for smart registration
- [Get Customer Details](/latest/api-reference/v2.1/customerV0201/get-customer-by-id) - Shows applied categorization