Calculate Reseller Score API

Calculate a reseller's current score based on performance metrics, credit usage, and activity coefficients

Score Calculation

Calculate Reseller Score API

Compute a reseller's performance score in real-time. Scores are calculated using configurable coefficients for credit usage, sales volume, subscription count, and membership duration.

Real-time Calculation

Scores computed on-demand with current data and coefficients.

Multi-metric Scoring

Credit, sales, subscriptions, and duration all contribute.

Automatic Updates

Recalculate anytime to reflect latest reseller activity.


Endpoint Overview

MUTATION/graphql

Calculate the current score for a specific reseller based on their activity metrics and the configured scoring coefficients. Returns the computed score and reseller ID.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

resellerIdInt!Required

The unique identifier of the reseller whose score should be calculated.


How Scoring Works

Credit Metrics

Monthly credit usage and current balance contribute to the score.

Sales Metrics

Total historical sales and monthly sales performance.

Subscription Count

Number of active subscriptions under management.

Membership Duration

How long the reseller has been active in the program.


GraphQL Mutation

mutation calculateResellerScore($resellerId: Int!) {
  calculateResellerScore(resellerId: $resellerId) {
    resellerId
    resellerScore
    level {
      id
      name
      discountPercent
    }
    breakdown {
      creditScore
      salesScore
      subscriptionScore
      durationScore
    }
  }
}

Variables:

{
  "resellerId": 12345
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation calculateResellerScore($resellerId: Int!) { calculateResellerScore(resellerId: $resellerId) { resellerId resellerScore } }",
    "variables": {
      "resellerId": 12345
    }
  }'

Response

200Score Calculated Successfully
{
  "data": {
    "calculateResellerScore": {
      "resellerId": "12345",
      "resellerScore": "7850",
      "level": {
        "id": "3",
        "name": "Gold",
        "discountPercent": 25.0
      },
      "breakdown": {
        "creditScore": 1500,
        "salesScore": 3200,
        "subscriptionScore": 2150,
        "durationScore": 1000
      }
    }
  }
}
400Reseller Not Found
{
  "errors": [
    {
      "message": "Reseller not found",
      "path": ["calculateResellerScore"],
      "extensions": {
        "code": "RESELLER_NOT_FOUND"
      }
    }
  ],
  "data": null
}
403Insufficient Permissions
{
  "errors": [
    {
      "message": "Admin access required to calculate reseller scores",
      "path": ["calculateResellerScore"],
      "extensions": {
        "code": "FORBIDDEN"
      }
    }
  ],
  "data": null
}

Score Breakdown Example

Credit: 1,500

Monthly usage (800) + Current balance (700). Capped at configured maximum.

Sales: 3,200

Total sales (2,000) + Monthly sales (1,200). Highest contributor.

Subscriptions: 2,150

85 active subscriptions at configured coefficient rate.

Duration: 1,000

24-month membership at configured duration weight.


Use Cases

Level Verification

Check if a reseller qualifies for promotion to a higher tier.

Performance Review

Audit reseller performance for partnership evaluations.

Coefficient Testing

Test how coefficient changes affect specific reseller scores.

Batch Assessment

Calculate scores for multiple resellers for reporting purposes.


Best Practices

Verify ID First

Ensure the reseller ID exists before calling to avoid errors.

Cache Results

Scores are computed on-demand. Cache results for batch operations.

Review Coefficients

Understand current coefficients to interpret score breakdowns.

Handle Level Changes

If score crosses threshold, consider level update notifications.



Admin Access Required

This endpoint requires admin-level permissions. Resellers cannot calculate their own scores directly; they can only view their current score through their profile.

Configure Your Scoring System

Customize how scores are calculated by adjusting coefficients and limits. Fine-tune the algorithm to reward the metrics that matter most to your reseller program.

Update Coefficients