For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get service order statistics

Get the numbers behind the service manager dashboard: how the open service orders are spread across the states, how much open work each user is carrying, how long service orders take to get through and where the time goes, how often the promised date is missed, which weekdays the work comes in on, how the job types compare, and which open service orders have been waiting longest. Every figure is computed from the service orders' event history, so the numbers say the same thing the timelines do. avgWorkOpenDays also reads the stores' openDays and serviceCountWeekendsAsWorkingDays and the holiday calendar as they stand at the request. The period given by fromDate and toDate applies to the period figures: completedCount, avgTurnaroundDays, avgActiveTurnaroundDays, avgQueueDays, avgWorkDays, avgWorkOpenDays, avgPickupDays, overdueRate and serviceJobTypes all read the service orders completed within the period, and registeredCount and registrationsByWeekday read the ones registered within it. Completed means reached COMPLETE — a cancelled service order takes no part in the period figures, and a reopened one counts in the period of its latest completion. openByState, workload and oldestOpen are not scoped by it: they always describe the service orders that are open right now. Asking without a period still returns those three in full. The period is not capped. Every figure is computed live from the event history on each request, over whatever period is asked for, so a year is asked for exactly the way a week is. storeUids narrows everything, the open figures as well as the period figures, to the stores that own the service orders — the stores the work sits with and where the customers collect. That is the owning store, not the store a service order was taken in at; the two differ whenever a service order has been moved between stores. Left out, every store the caller holds SERVICE_ORDER or REPORTING at is counted. This endpoint answers for the caller's stores as a whole, or for the stores named in storeUids taken together. Compare the stores against each other, for a store comparison or a top or bottom list, through the per-store service order statistics endpoint. The dashboard's tiles and saved-list cards are not read from here. Those come from the service order counts endpoint, which counts whatever filters each of them stands for. The figures key on the store that owns a service order, never on the store it was taken in at: a case that has moved counts for the store it moved to, and for no other. Being able to read a case from another store, the store it was taken in at included, does not make it that store's work here. The figures count only the service orders owned by the stores the caller holds SERVICE_ORDER or REPORTING at — every store of the tenant for a tenant-wide holder, the organization's stores for an organization holder, the assigned stores for a store-level holder, the two permissions adding up — because a figure is a store's work, not a case to find; the tenant-level service order search reaches further, to every service order of the tenant, for a caller holding SERVICE_ORDER. A caller holding REPORTING and not SERVICE_ORDER is answered every figure, workload and oldestOpen included, exactly as a caller holding SERVICE_ORDER at the same stores is. A caller holding neither, a user with no role assignments included, is refused with a 403. Opening a service order oldestOpen names through get-serviceorders-by-id asks for SERVICE_ORDER, so a caller holding REPORTING alone sees the entry and is refused on opening it.

Required permissions: SERVICE_ORDER,REPORTING

get
/tenants/{tenantUid}/serviceorders/stats
Authorizations
AuthorizationstringRequired

Access token recevied after user login with a deviceToken

Path parameters
tenantUidstringRequired

Reference to a tenant.

Pattern: ^[A-Za-z0-9-_]+
Query parameters
fromDatestring · dateOptional

The start of the period the figures are measured over (inclusive). The date names a day in the tenant's timezone. It applies to the period figures, and each endpoint states which of its figures those are. The figures that count open service orders always describe how things stand right now, whatever period was asked for. The period is not capped. Every figure is computed live from the event history on each request, over whatever period is asked for, so a full year is asked for exactly the way a single week is. ISO 8601 date format: YYYY-MM-DD, e.g. 2026-01-01.

toDatestring · dateOptional

The end of the period the figures are measured over (inclusive). The date names a day in the tenant's timezone. It applies to the period figures, and each endpoint states which of its figures those are. The figures that count open service orders always describe how things stand right now, whatever period was asked for. The period is not capped. Every figure is computed live from the event history on each request, over whatever period is asked for, so a full year is asked for exactly the way a single week is. ISO 8601 date format: YYYY-MM-DD, e.g. 2026-01-31.

storeUidsstring[]Optional

Narrow every figure to the stores that own the service orders — the stores the work sits with and where the customers collect. This is the owning store, not the store a service order was taken in at, and the two differ whenever a service order has been moved between stores. Leave it out to get every store the caller holds SERVICE_ORDER or REPORTING at — every store of the tenant for a tenant-wide holder, the organization's stores for an organization holder, the assigned stores for a store-level holder, the two permissions adding up. Naming a store the caller holds neither SERVICE_ORDER nor REPORTING at is not refused and adds nothing: storeUids narrows within the caller's stores and never widens them. A storeUid naming no store of the tenant answers 400.

Responses
200

Example response

application/json

The numbers behind the service manager dashboard. Every figure is computed from the service orders' event history, so what is returned is the same record the timeline shows rather than a separate tally that can drift away from it. Time on a status is classified by the state that status maps to now: remapping a status to another state reclassifies the time spent on it, past and future alike, so the figures follow the tenant's current reading of its workflow. avgWorkOpenDays likewise reads the stores' openDays and serviceCountWeekendsAsWorkingDays and the holiday calendar as they stand at the request, so changing them recomputes past periods too. Two different questions are answered in one response, and they are not scoped the same way. openByState, workload and oldestOpen describe how things stand right now — they always reflect the service orders that are open at the moment of the call, whatever period was asked for. A service order is open here in the same sense the service order search's open filter means it. Everything else is a period figure. completedCount, avgTurnaroundDays, avgActiveTurnaroundDays, avgQueueDays, avgWorkDays, avgWorkOpenDays, avgPickupDays, overdueRate and serviceJobTypes are all computed over the service orders that were completed within the period; registeredCount and registrationsByWeekday read the ones registered within it instead. A call with no period therefore still returns the three open figures in full. Completed means reached COMPLETE: a cancelled service order is finished, never completed, and takes no part in the period figures. A service order that was reopened counts in the period of its latest transition into COMPLETE, and not at all while it is open again. Each average and overdueRate is taken over its own service orders — avgQueueDays over the ones that entered IN_PROGRESS, avgPickupDays over the ones that entered READY_FOR_PICKUP — and is null when there are none of them, never 0. 0 is a real figure: work started the moment the case was registered, or no case was late. null says no service order went through what the figure measures, so there is nothing to show and nothing to rank. The period is not capped. Every figure is computed live from the event history on each request, over whatever period is asked for. storeUids narrows everything, both the open figures and the period figures, to the stores that own the service orders. The tiles and the saved-list cards on the dashboard are not read from here — those come from the service order counts endpoint, which answers whatever filters they stand for. This endpoint is the rest of the dashboard.

registeredCountintegerRequired

The number of service orders registered within the period, whatever has become of them since. This is the population registrationsByWeekday spreads across the week.

completedCountintegerRequired

The number of service orders completed within the period. avgTurnaroundDays and avgActiveTurnaroundDays are computed over all of them, avgQueueDays and avgWorkDays over the ones among them that entered IN_PROGRESS, avgWorkOpenDays over the ones among them that entered IN_PROGRESS and whose store has openDays, avgPickupDays over the ones that entered READY_FOR_PICKUP and overdueRate over the ones carrying a readyAtEstimate.

avgTurnaroundDaysnumber · nullableRequired

The average number of days from registration to completion, over the service orders that were completed within the period. A service order that is still open is never part of it, however long it has been waiting. null when no service order was completed in the period.

avgActiveTurnaroundDaysnumber · nullableRequired

The same average, counting only the time the service orders spent in the states where the store or workshop holds the responsibility: NOT_STARTED, IN_TRANSIT and IN_PROGRESS. Time spent in AWAITING_PRODUCT, WAITING_CUSTOMER, WAITING_SUPPLIER or READY_FOR_PICKUP does not count: a customer who takes a week to answer does not make the workshop look slow. Which states count is owned by the platform and follows the state, never the status name. Computed over the same service orders as avgTurnaroundDays, from the timestamps in the event history. null when no service order was completed in the period.

avgQueueDaysnumber · nullableRequired

The average number of days from registration to the first time work started — the first transition into the state IN_PROGRESS — over the service orders that were completed within the period. It is how long a service order lies untouched before anyone picks it up, told apart from how long the work itself takes. Service orders that never entered IN_PROGRESS take no part in this average: a case completed without work ever starting has no queue to measure. null when none of the completed service orders entered the state.

avgWorkDaysnumber · nullableRequired

The average number of days from the first time work started — the first transition into the state IN_PROGRESS — to completion, over the service orders that were completed within the period. Together with avgQueueDays it splits the turnaround into the waiting and the working. Service orders that never entered IN_PROGRESS take no part in this average, exactly as for avgQueueDays. null when none of the completed service orders entered the state.

avgWorkOpenDaysnumber · nullableRequired

avgWorkDays counted only inside the opening hours of the store that owns the service order, on the store's working days (serviceCountWeekendsAsWorkingDays), in the tenant's timezone: a full working day counts 1, and part of one its share of that day's open hours. Like avgWorkDays, it is taken over the service orders that were completed within the period and entered IN_PROGRESS. Service orders whose store has no openDays are left out; null when none is left.

avgPickupDaysnumber · nullableRequired

The average number of days from the first transition into the state READY_FOR_PICKUP to completion, over the service orders that were completed within the period — how long finished work waits on the shelf to be collected. It is the queue at the counter rather than the queue at the bench. Service orders that never entered READY_FOR_PICKUP take no part in this average: a case handed straight back over the counter says nothing about how long a shelf is waited on. null when none of the completed service orders entered the state.

overdueRatenumber · nullableRequired

The share of the service orders completed within the period whose work was ready after their readyAtEstimate, from 0 to 1. 0.25 means a quarter of them were late. The work is ready from the start of the unbroken stretch on statuses of the states READY_FOR_PICKUP, COMPLETE and CANCELLED that runs up to the service order's latest completion — the latest moment it came off a status of any other state, not the first entry into READY_FOR_PICKUP that avgPickupDays measures from — or at that completion when no such stretch precedes it. It is the overdue search filter's reading of lateness applied to the service order's history, with the readyAtEstimate as it stands and the statuses' states as they map now: one ready by its readyAtEstimate is on time however late the customer collects it, also when a hand-over is reopened onto READY_FOR_PICKUP, and one taken back to work after its readyAtEstimate is late. A service order carrying no readyAtEstimate takes no part in the share, on either side of it. null when none of the completed service orders carried one.

get/tenants/{tenantUid}/serviceorders/stats
GET /v2/tenants/{tenantUid}/serviceorders/stats HTTP/1.1
Host: api.flowretail.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Example response

{
  "openByState": [
    {
      "state": "AWAITING_PRODUCT",
      "count": 1
    }
  ],
  "workload": [
    {
      "tenantUserUid": "text",
      "tenantUserDisplayName": "text",
      "openCount": 1
    }
  ],
  "registeredCount": 1,
  "completedCount": 1,
  "avgTurnaroundDays": 1,
  "avgActiveTurnaroundDays": 1,
  "avgQueueDays": 1,
  "avgWorkDays": 1,
  "avgWorkOpenDays": 1,
  "avgPickupDays": 1,
  "overdueRate": 1,
  "registrationsByWeekday": [
    {
      "weekday": "MONDAY",
      "count": 1
    }
  ],
  "serviceJobTypes": [
    {
      "serviceJobTypeUid": "text",
      "serviceJobTypeName": "text",
      "completedCount": 1,
      "avgQueueDays": 1,
      "avgWorkDays": 1,
      "avgWorkOpenDays": 1,
      "avgPickupDays": 1
    }
  ],
  "oldestOpen": [
    {
      "serviceOrderUid": "text",
      "storeUid": "text",
      "serviceNumber": "text",
      "title": "text",
      "createdAt": "2026-01-01T00:00:00.000Z"
    }
  ]
}

Last updated

Was this helpful?