Skip to main content
GET
List products with sales and stock performance

Authorizations

Authorization
string
header
required

User session token issued by NextAuth. For human users accessing Solya via the web application.

Query Parameters

page
integer
default:1

Page number, 1-indexed (default: 1)

Required range: 1 <= x <= 9007199254740991
pageSize
integer
default:20

Number of items per page, max 100 (default: 20)

Required range: 1 <= x <= 100
q
string

Case-insensitive substring search query

brandId
string
period
enum<string>

Pre-aggregated time window to read product KPIs for (defaults to LAST_30_DAYS). The gold dim_product_summary tables hold one row per product per time_period; this selects which window's aggregates (sales, units, margin, stock) are returned. Choosing a different period changes the metric values, not the set of products.

Available options:
LAST_7_DAYS,
LAST_30_DAYS,
LAST_90_DAYS,
LAST_6_MONTHS,
LAST_12_MONTHS,
THIS_MONTH,
THIS_QUARTER,
THIS_YEAR,
YEAR_TO_DATE,
LAST_MONTH,
LAST_QUARTER,
LAST_YEAR,
ALL_TIME
sortBy
enum<string>
default:name

Column to sort by. Defaults to 'name' (alphabetical). For best-selling / top-selling products, use a sales metric: 'totalNetSales' (net revenue), 'totalGrossSales' (gross revenue), or 'totalUnitsSold' (units sold), combined with sortDirection=desc. Other metrics: 'totalQuantity' (stock on hand), 'averagePrice', 'monthlySales', 'stockValue', 'totalDiscount', 'totalCogs', 'totalGrossMargin', 'totalTransactions', 'avgGrossMarginPct', 'avgSellingPrice', 'variantCount', 'shopCount', plus the 'brandName' and 'family' dimensions.

Available options:
name,
brandName,
family,
totalQuantity,
averagePrice,
monthlySales,
stockValue,
totalGrossSales,
totalNetSales,
totalUnitsSold,
totalDiscount,
totalCogs,
totalGrossMargin,
totalTransactions,
avgGrossMarginPct,
avgSellingPrice,
variantCount,
shopCount
sortDirection
enum<string>
default:asc

Sort direction: 'asc' or 'desc'. Defaults to 'asc'. Use 'desc' with a sales-metric sortBy (e.g. totalNetSales) to rank best-sellers first.

Available options:
asc,
desc

Response

Successful response

data
object[]
required

Page of items

meta
object
required

Pagination metadata

success
enum<boolean>
required
Available options:
true