Skip to Content
Sales

Get sales grouped by one dimension

GET
/sales/breakdown

One endpoint for every dashboard chart and report table. groupBy picks the dimension. Rows are sorted by turnover, highest first. Time groupings (hour, weekday, day, month) are sorted by time instead. hour only returns the company's work hours, like the dashboard. The period can be at most 366 days. Requires scope sales:read.

Authorization

apiKey
headerAuthorizationBearer <ajr_live_<keyId>_<secret>>

An Ajour API key, sent as Authorization: Bearer <key>. Create keys in the Ajour back office under Settings → API keys. Each key has scopes: catalog:read, sales:read, reports:read and customers:read.

Query Parameters

groupBy*string

The dimension to group by.

Value in"productGroup""product""location""salesperson""hour""weekday""day""month"
from*string

First day of the period, as a local date in Europe/Copenhagen.

Formatdate
to*string

Last day of the period, included. Local date in Europe/Copenhagen.

Formatdate
locationId?array<integer>

Only these locations. Repeat the parameter for more than one. Must be locations the key can see. Leave out for all of them.

productGroupId?string

Only this product group (POS number).

productId?array<string>

Only these products (POS numbers). Repeat the parameter for more than one.

orderType?array<>

Only these order types. Repeat the parameter for more than one.

salesperson?string

Only this salesperson, by name as on the register.

vat?string

Show money amounts including or excluding VAT.

Default"include"
Value in"include""exclude"
limit?integer

Return only the top N rows, for example the 10 most popular products.

Range1 <= value <= 1000
compare?"previousYear"

Add last year's figures for the same weekdays.

Value in"previousYear"

Response Body

OK

application/json
  1. response
groupBy*GroupBy
Value in"productGroup""product""location""salesperson""hour""weekday""day""month"
period*
currency*string
vat*string
Value in"include""exclude"
rows*array<>
total*
Example Request
curl -X GET 'https://api.ajour.dk/v1/sales/breakdown?groupBy=productGroup&from=2026-11-01&to=2026-11-21&locationId=1031'
Example Response
{
  "groupBy": "productGroup",
  "period": {
    "from": "2026-11-01",
    "to": "2026-11-21"
  },
  "currency": "DKK",
  "vat": "include",
  "rows": [
    {
      "key": "10",
      "label": "Kaffe",
      "quantity": 7410,
      "turnover": 288340,
      "share": 59.3
    },
    {
      "key": "20",
      "label": "Kage",
      "quantity": 3122,
      "turnover": 121050,
      "share": 24.9
    }
  ],
  "total": {
    "quantity": 12880,
    "turnover": 486210.5
  }
}