Top Selling Products

The /products/top-selling endpoint returns a list of the top-selling products for a given period. This helps you identify your best performers, plan promotions, and optimize inventory.

Top Selling Products

Returns a list of the top-selling products based on quantity sold and revenue.

Product
Quantity Sold
Revenue
Optional query parameters: limit, periodv1.0

Response model

  • Name
    product_id
    Type
    string
    Description

    Unique identifier of the product.

  • Name
    product_name
    Type
    string
    Description

    Display name of the product.

  • Name
    quantity_sold
    Type
    integer
    Description

    Total quantity sold in the selected period.

  • Name
    revenue
    Type
    float
    Description

    Total revenue generated from this product.

  • Name
    formatted_revenue
    Type
    string
    Description

    Human-friendly version of revenue (e.g., € 1.234,56).


GET/api/products/top-selling

Retrieve top sellers

Returns a list of the top-selling products based on quantity sold and revenue.

Optional query parameters

  • Name
    limit
    Type
    integer
    Description

    Number of products to return (default: 10).

  • Name
    period
    Type
    string
    Description

    Timeframe to use for sales (e.g., 7d, 30d). View all periods →

Request

GET
/api/products/top-selling
curl -G http://localhost:3000/api/products/top-selling \
  -H "Authorization: Bearer {token}" \
  -d period=30d \
  -d limit=5

Response

[
  {
    "product_id": "SKU-123",
    "product_name": "EcoFlow Water Bottle",
    "quantity_sold": 187,
    "revenue": 2457.55,
    "formatted_revenue": "€ 2.457,55"
  },
  {
    "product_id": "SKU-456",
    "product_name": "FlexFit Running Shoes",
    "quantity_sold": 162,
    "revenue": 4050.00,
    "formatted_revenue": "€ 4.050,00"
  }
]

Use cases

  • Track best-selling SKUs by week or month
  • Identify products to promote based on popularity
  • Power internal dashboards and merchandising reports

Was this page helpful?