Skip to main content
GET
/
api
/
reports
/
top-parts
Top Parts by Cost
curl --request GET \
  --url https://api.example.com/api/reports/top-parts
{
  "name": "<string>",
  "costo": 123,
  "cantidad": 123
}

Overview

Retrieve the top N parts by scrap cost to identify which parts are most expensive to waste.

Authentication

Requires valid JWT token with view_area_reports or view_global_reports permission.
Authorization: Bearer <token>

Query Parameters

fecha_inicio
string
Start date filter (YYYY-MM-DD format or ISO datetime)
fecha_fin
string
End date filter (YYYY-MM-DD format or ISO datetime)
limit
number
default:10
Number of top parts to return

Request Example

curl -X GET "http://localhost:3001/api/reports/top-parts?limit=10" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

Returns an array of part statistics ordered by cost (descending).
name
string
Part number (NP value)
costo
number
Total scrap cost for this part
cantidad
number
Total scrap quantity for this part

Response Example

[
  {
    "name": "12345678",
    "costo": 3250.00,
    "cantidad": 85
  },
  {
    "name": "87654321",
    "costo": 2890.50,
    "cantidad": 62
  },
  {
    "name": "11223344",
    "costo": 2450.75,
    "cantidad": 98
  }
]

Use Cases

  • Cost Reduction: Identify most expensive parts to prioritize process improvements
  • Supplier Quality: Track parts from specific suppliers with high scrap rates
  • Training Focus: Target operator training on high-cost parts

Top Failures

Most common failure modes

Summary Report

Overall statistics

Build docs developers (and LLMs) love