Skip to main content
GET
/
api
/
sales
/
summary
Sales summary aggregated by dimension
curl --request GET \
  --url https://app.solya.app/api/sales/summary \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "brandId": "brand-nike-001",
      "brandName": "Nike",
      "currencyId": null,
      "grossSales": 117000,
      "margin": 35100,
      "productId": null,
      "productName": null,
      "shopId": null,
      "shopName": null,
      "units": 585
    },
    {
      "brandId": "brand-adidas-002",
      "brandName": "Adidas",
      "currencyId": "currency-eur",
      "grossSales": 79500,
      "margin": 23850,
      "productId": null,
      "productName": null,
      "shopId": null,
      "shopName": null,
      "units": 530
    }
  ],
  "page": 1,
  "pageSize": 20,
  "total": 4
}

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
groupBy
enum<string>
default:brand

Aggregation dimension: shop, brand (default), or product

Available options:
shop,
brand,
product
from
string
required

Start of date range, inclusive (YYYY-MM-DD)

Pattern: ^\d{4}-\d{2}-\d{2}$
to
string
required

End of date range, inclusive (YYYY-MM-DD)

Pattern: ^\d{4}-\d{2}-\d{2}$
shopIds
string

Comma-separated shop IDs to filter by

brandIds
string

Comma-separated brand IDs to filter by

sortBy
enum<string>
default:grossSales

Metric to sort by: grossSales (default), units, or margin

Available options:
grossSales,
units,
margin
sortDir
enum<string>
default:desc

Sort direction: desc (default) or asc

Available options:
asc,
desc

Response

Successful response

data
object
required
success
enum<boolean>
required
Available options:
true