Calculate Reseller Score API
POST /calculateResellerScore
Description
This API endpoint allows an admin to calculate the current score of a reseller by providing the reseller's unique identifier. The score is calculated based on various metrics and coefficients associated with the reseller's activities.
Request Body
The request utilizes GraphQL to perform the calculateResellerScore
mutation.
Mutation:
mutation calculateResellerScore ($resellerId: Int) {
calculateResellerScore (resellerId: $resellerId) {
resellerScore
resellerId
}
}
Variables:
{
"resellerId": 0
}
- resellerId (Int): The unique identifier of the reseller whose score is being calculated.
Response:
-
Success (200 OK):
- If the score calculation is successful, the response will return the reseller's current score and their ID.
{
"data": {
"calculateResellerScore": {
"resellerScore": "<Reseller_Score>",
"resellerId": "<Reseller_ID>"
}
}
} -
Error (4XX/5XX):
- Appropriate error messages and status codes will be returned in cases of invalid reseller ID, missing required fields, or server errors.
Note:
Ensure that the resellerId
corresponds to an existing reseller within the platform. The score calculation may depend on various metrics and coefficients associated with the reseller, and the API should be used by admins with the necessary permissions to manage and assess reseller scores.