You and your company

GET/v1/home

The Home page: the company's figures, one row per shop, and what is waiting for a person.

What it does

The same reads as the app's Home page, over every shop the key reaches or one shop with shopId. needsAttention is the list of things to do now across the shops: an agent waiting for approval, a connection that could not be read, a shop with no report for a month.

Who may call it

A key whose maker's role holds figures (see the figures), after the fence, for the shop or category it names.

Request

HTTP
GET https://panlytics.net/api/v1/home

Parameters

NameInTypeRequiredWhat it is
shopIdqueryintegerNoOne shop to read. Leave it out for every shop the key reaches, as the Home page's All shops.
AuthorizationheaderstringYesBearer, a space, then the key.

Example request

curl https://panlytics.net/api/v1/home \
  -H "Authorization: Bearer $PANLYTICS_KEY"

Response

200: The answer, as JSON.

FieldTypeAlways thereWhat it is
shopIds[]integer[]YesThe shops these figures cover.
headline[]object[]YesThe figures at the top of the Home page, added up over the shops.
headline[].keystringYesA stable name: sales, recoverable, waste, products, categories or reporting.
headline[].labelstringYesWhat the Home page calls it.
headline[].valuenumberYesThe figure across the newest report of every category.
headline[].beforenumber or nullYesThe same figure over the report before, or null when there was none.
headline[].unitstring: eur, countYesEuros or a count.
headline[].betterstring: up, downYesWhich way is good.
shops[]object[]YesOne row per shop, as the Home page's table shows them.
shops[].shopIdintegerYesThe shop.
shops[].namestringYesWhat it is called.
shops[].citystringYesIts city, or empty.
shops[].kindstring: manual, shopify, netvisorYesWhat feeds it.
shops[].categoriesintegerYesHow many categories it has.
shops[].productsintegerYesHow many products their newest reports hold.
shops[].salesEurnumberYesSales over the newest reports, in whole euros.
shops[].missedSalesEurnumberYesSales missed while shelves were empty, in whole euros.
shops[].wasteEurnumberYesThrown away, in whole euros.
shops[].lastReportstring or nullYesWhen a report was last read, or null.
shops[].agentsOnbooleanYesTrue when the agents may work in this shop.
shops[].statusstring: reading, quiet, emptyYesreading: a report in the last 30 days; quiet: none for longer; empty: none ever.
needsAttention[]object[]YesThe ten newest things waiting for a person, as the Home page lists them.
needsAttention[].kindstring: approval, source, reportYesapproval: an agent waits for a person; source: a connection could not be read; report: no report for over a month.
needsAttention[].shopIdintegerYesThe shop it is about.
needsAttention[].shopNamestringYesIts name.
needsAttention[].whatstringYesWhat happened, in one sentence.
needsAttention[].atstringYesWhen it happened, in UTC.
agentsobjectYesThe agents, in numbers.
agents.runsintegerYesRuns started in the last seven days.
agents.failedintegerYesOf those, how many failed.
agents.costEurnumberYesWhat those runs cost, in euros.
agents.todayEurnumberYesWhat runs cost today, in euros.
agents.budgetEurnumberYesWhat the shops allow in a day, in euros.
agents.approvalsWaitingintegerYesProposals waiting for a person to approve them in the app.
agents.shopsOnintegerYesShops where the agents may work.

Example response

200
{
  "shopIds": [
    12
  ],
  "headline": [
    {
      "key": "sales",
      "label": "Sales",
      "value": 48210,
      "before": 45102,
      "unit": "eur",
      "better": "up"
    }
  ],
  "shops": [
    {
      "shopId": 12,
      "name": "Harbour",
      "city": "Helsinki",
      "kind": "manual",
      "categories": 3,
      "products": 1204,
      "salesEur": 48210,
      "missedSalesEur": 1310,
      "wasteEur": 421,
      "lastReport": "2026-10-20T07:12:00.000Z",
      "agentsOn": true,
      "status": "reading"
    }
  ],
  "needsAttention": [
    {
      "kind": "approval",
      "shopId": 12,
      "shopName": "Harbour",
      "what": "An agent is waiting to change a reorder point",
      "at": "2026-10-25T09:00:00.000Z"
    }
  ],
  "agents": {
    "runs": 12,
    "failed": 0,
    "costEur": 0.42,
    "todayEur": 0.05,
    "budgetEur": 2,
    "approvalsWaiting": 1,
    "shopsOn": 1
  }
}

Errors

A refusal is JSON with a code, a sentence in error, and a requestId when the fault is ours. Read the code, not the sentence. Every code is listed on Errors.

StatusCodeWhenWhat to do
400api.invalidA path id, a query parameter, a header or a body field is missing or not valid. detail names the field.Read that endpoint in the API reference, correct the field and call again.
401api.key_missingThe call had no Authorization header.Send the key in the Authorization header as Bearer, then call again.
401api.key_refusedThe key is wrong, revoked, past its end, or its maker or company no longer allows it (developer mode off, the maker removed or switched off, or the maker's role lost the developer ability).Ask the person who gave you the key to make a new one.
401api.wrong_key_kindThis key does not open these endpoints.Use the key these endpoints were made for, or ask the person who gave you the key.
403refusedThe key's maker may not do this here: their role lacks the ability, or the shop or category is outside their reach.Ask the CEO for a role that allows it, or call it for a shop or category the role reaches.
403auth.not_freshThis step needs you to prove it is you.Confirm your password or passkey, then try again.
404not_found.saidNothing with that id in the key's company. An id of another company answers the same.Check the id. List the shop or category it belongs to and take the id from there.
429api.rate_limitedThe key made more than 120 calls in this minute. Wait the seconds in Retry-After.Wait the seconds in Retry-After, then call again.
500serverSomething failed on our side. The answer carries a requestId to quote.Try again in a minute; if it keeps happening, report it.
503developer.unavailableAPI keys are not set up on this deployment yet.Report it, and we will switch them on.