iRetail PRO hub 1.0.0-m5: analytics

8 operations

← All documentation · Source: contracts openapi/hub-v1.yaml at 8000474.

The chain's sales and stock (spec/ANALYTICS.md).

← iRetail PRO hub 1.0.0-m5

Operations

GET /v1/analytics/metrics The metrics the analytics query offers (metrics/catalog.json).

operationId listAnalyticsMetrics · Permission report.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Responses

POST /v1/analytics/query The chain's sales and stock by the metrics and dimensions asked (spec/ANALYTICS.md).

Reads only. 400 bad_request for an unknown metric or dimension, a dimension a metric does not allow, a period over 366 days or a malformed currency; 403 forbidden for a store outside the caller's scope; 422 mixed_currencies for money over stores of more than one currency without the store dimension or a currency to convert into.

operationId queryAnalytics · Permission report.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Request body required

Responses

GET /v1/exchange-rates The organization's exchange rates by day, newest first (spec/ANALYTICS.md, Currencies).

operationId listExchangeRates · Permission report.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).
from query string (date) The first date, included.
to query string (date) The date after the last, excluded.
currency query string Only pairs with this currency on either side.

Responses

PUT /v1/exchange-rates/{date}/{from}/{to} Set the rate of a day for a pair.

operationId putExchangeRate · Permission rate.manage

Parameters

Name In Type Description
date required path string (date) The day the rate is for.
from required path string The currency converted from.
to required path string The currency converted into.
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Request body required

Responses

DELETE /v1/exchange-rates/{date}/{from}/{to} Remove the rate of a day for a pair.

operationId deleteExchangeRate · Permission rate.manage

Parameters

Name In Type Description
date required path string (date) The day the rate is for.
from required path string The currency converted from.
to required path string The currency converted into.
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Responses

  • 204 Done
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 404 Error (spec/API.md). Error
POST /v1/exchange-rates/import Import rates from CSV: a header date,from,to,rate, then one rate per line.

operationId importExchangeRates · Permission rate.manage

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Request body required

  • text/csv string

Responses

GET /v1/reports/bonuses Employee bonuses over the chain's stores, by store and employee.

operationId hubBonusReport · Permission bonus.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).
from required query string (date-time) Inclusive.
to required query string (date-time) Exclusive.
store_id query string (uuid) One store's.

Responses

GET /v1/reports/partners Partners over the chain's stores, by store and partner.

operationId hubPartnerReport · Permission report.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).
from required query string (date-time) Inclusive.
to required query string (date-time) Exclusive.
store_id query string (uuid) One store's.

Responses

Schemas

MetricCatalog object

metrics required array of Metric

Metric object

id required string
name required LocalizedText
description required LocalizedText
unit required MetricUnit
dimensions required array of AnalyticsDimension

MetricUnit "money" | "quantity_milli" | "count" | "ppm" | "minutes"

money · quantity_milli · count · ppm · minutes

AnalyticsDimension "store" | "day" | "week" | "month" | "hour" | "employee" | "item" | "group"

store · day · week · month · hour · employee · item · group

AnalyticsQuery object

metrics required array of string Metric ids from the catalog.
dimensions array of AnalyticsDimension
from required string (date) The first local date, included.
to required string (date) The local date after the last, excluded; at most 366 days after from.
stores array of string (uuid) By default every store the caller may read.
items array of string (uuid)
groups array of string (uuid) Items now in these groups.
currency string Convert money into this currency at the rate of each day (spec/ANALYTICS.md, Currencies).
roll_up_variants boolean Count a variant under its parent in the item dimension (spec/VARIANTS.md).
order_by string A requested metric or dimension; by default the dimensions in order.
descending boolean
limit integer

AnalyticsColumn object

id required string
kind required "dimension" | "metric"
unit required MetricUnit | null A metric's unit; null for a dimension.

AnalyticsResult object

columns required array of AnalyticsColumn
rows required array of array of string | integer | null
currency required string | null The asked currency, or the rows' one currency, null when they differ or carry no money.
missing_rates required array of object The store currencies and days left out of the sums for want of a rate, sorted.
truncated required boolean More rows matched than limit.

ExchangeRate object

date required string (date)
from required string
to required string
rate required string Units of to one unit of from buys, as decimal text (never a float).

ExchangeRatePut object

rate required string Units of to one unit of from buys, as decimal text (never a float).

ExchangeRateImport object

imported required integer Rows written (a rate for an existing day and pair replaces it).
refused required array of object Rows not written, with the line number and why.

HubBonusReport object

spec/REPORTS.md, Employee bonuses and At the hub. Rows by store id, then employee id; totals per currency, never added across currencies.

from required string (date-time)
to required string (date-time)
rows required array of object
totals required array of object One entry per currency the rows are in, ordered by currency code; empty with no rows.

HubPartnerReport object

spec/REPORTS.md, Partners and At the hub. Rows by store id, then partner id; totals per currency, never added across currencies.

from required string (date-time)
to required string (date-time)
rows required array of object
totals required array of object One entry per currency the rows are in, ordered by currency code; empty with no rows.