calculateSupplierRating
Requires permission suppliers:supplier:update.
Recomputes one supplier's rating from its goods receipts. Returns success false with a message when there is no goods receipt data. Needs the suppliers update permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CalculateSupplierRating($supplierId: ID!) {
calculateSupplierRating(supplierId: $supplierId) {
deliveryRating
message
overallRating
performanceRating
qualityRating
serviceRating
metricsUsed {
issuesReported
onTimeDeliveries
totalDeliveries
totalGRNs
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CalculateSupplierRating($supplierId: ID!) {\n calculateSupplierRating(supplierId: $supplierId) {\n deliveryRating\n message\n overallRating\n performanceRating\n qualityRating\n serviceRating\n metricsUsed {\n issuesReported\n onTimeDeliveries\n totalDeliveries\n totalGRNs\n }\n }\n}",
"variables": {
"supplierId": "id"
}
}
EOF
Variables:
{
"supplierId": "id"
}
Response:
{
"data": {
"calculateSupplierRating": {
"deliveryRating": 0,
"message": "string",
"overallRating": 0,
"performanceRating": 0,
"qualityRating": 0,
"serviceRating": 0,
"metricsUsed": {
"issuesReported": 0,
"onTimeDeliveries": 0,
"totalDeliveries": 0,
"totalGRNs": 0
}
}
}
}
calculateSupplierRating(
supplierId: ID!
): SupplierRatingResult!
Arguments
calculateSupplierRating.supplierId ● ID! non-null scalar
The ID of the supplier.
Type
SupplierRatingResult object
The result of working out a supplier's rating.