Skip to main content

Get Rotation Report

GET /api/v1/reports/rotation

Retrieves the inventory rotation report with turnover metrics for products over a specified period.

Query Parameters

days
integer
default:"30"
Number of days to analyze for rotation calculations
product_id
string
Filter rotation report for a specific product ID (UUID format)
category
string
Filter rotation report by product category

Authorization

Requires one of the following roles:
  • admin
  • gestor
  • consultor

Response

{
  "status": "success",
  "period_days": 30,
  "products": [
    {
      "product_id": "123e4567-e89b-12d3-a456-426614174000",
      "product_name": "Product A",
      "sku": "SKU-001",
      "category": "Electronics",
      "rotation_index": 2.5,
      "average_stock": 100,
      "units_sold": 250,
      "turnover_days": 12,
      "classification": "fast_moving"
    },
    {
      "product_id": "223e4567-e89b-12d3-a456-426614174001",
      "product_name": "Product B",
      "sku": "SKU-002",
      "category": "Accessories",
      "rotation_index": 0.5,
      "average_stock": 50,
      "units_sold": 25,
      "turnover_days": 60,
      "classification": "slow_moving"
    }
  ]
}

Response Fields

rotation_index
number
Number of times the inventory turned over during the period. Higher values indicate faster movement.
average_stock
number
Average inventory quantity during the analysis period
units_sold
number
Total units sold or consumed during the period
turnover_days
number
Average number of days to sell through current inventory
classification
string
Product movement classification:
  • fast_moving - High turnover products
  • medium_moving - Average turnover products
  • slow_moving - Low turnover products
  • non_moving - Products with no movement

Filtering Examples

Filter by Product

curl -X GET "https://api.example.com/api/v1/reports/rotation?days=30&product_id=123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer YOUR_TOKEN"

Filter by Category

curl -X GET "https://api.example.com/api/v1/reports/rotation?days=60&category=Electronics" \
  -H "Authorization: Bearer YOUR_TOKEN"

Custom Time Period

curl -X GET "https://api.example.com/api/v1/reports/rotation?days=90" \
  -H "Authorization: Bearer YOUR_TOKEN"

Use Cases

Identify Slow Movers

Find products with low rotation indexes that may need promotional campaigns or clearance.

Optimize Stock Levels

Use turnover days to adjust reorder points and maintain optimal inventory levels.

Category Analysis

Compare rotation metrics across different product categories to identify trends.

Performance Tracking

Monitor inventory efficiency over different time periods (30, 60, 90 days).

Code Reference

Implemented in backend/Report/Adapters/report_controller.py:220

Build docs developers (and LLMs) love