Location insights
Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.
| Method | Path | Operation |
|---|---|---|
| GET | /api/v1/insights/locations | Get location insights |
| GET | /api/v1/insights/locations/{locationId} | Get location insight |
| GET | /api/v1/insights/locations/{locationId}/top-products | Get top products |
| GET | /api/v1/insights/locations/{locationId}/turnover-history | Get turnover history |
Get location insights
GET/api/v1/insights/locations
Returns aggregated insight metrics for every location in the business over the period. Defaults to the current calendar month when from/to are not supplied.
Access. Send a bearer token or an API key. The caller needs the Insights view permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
from | query | string (date-time) | No | |
to | query | string (date-time) | No |
Response
200. Returns a PagedResult envelope. Each item in data is LocationInsightResponse.
curl -X GET "https://api.miridia.io/api/v1/insights/locations" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"{
"count": 0,
"totalCount": 0,
"page": 0,
"finalPage": 0,
"pageSize": 0,
"hasMore": true,
"statusCode": "OK",
"data": [
{
"locationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"locationType": "Office",
"currency": "string",
"totalRevenue": 0,
"totalCost": 0,
"profit": 0,
"orders": 0,
"averageOrderValue": 0,
"previousOrders": 0,
"previousRevenue": 0,
"inboundPurchaseOrders": 0,
"inboundPurchaseValue": 0,
"inboundTransfers": 0,
"outboundTransfers": 0,
"inventoryValue": 0,
"activeProducts": 0,
"channels": [
{}
],
"periodFrom": "2026-09-29T08:00:00Z",
"periodTo": "2026-09-29T08:00:00Z"
}
],
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
]
}Get location insight
GET/api/v1/insights/locations/{locationId}
Returns aggregated insight metrics for one location over the period. Defaults to the current calendar month when from/to are not supplied.
Access. Send a bearer token or an API key. The caller needs the Insights view permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
locationId | path | string (uuid) | Yes | |
from | query | string (date-time) | No | |
to | query | string (date-time) | No |
Response
200. Returns a SingleResult envelope. The data field is LocationInsightResponse.
curl -X GET "https://api.miridia.io/api/v1/insights/locations/{locationId}" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"{
"message": "string",
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
],
"data": {
"locationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"locationType": "Office",
"currency": "string",
"totalRevenue": 0,
"totalCost": 0,
"profit": 0,
"orders": 0,
"averageOrderValue": 0,
"previousOrders": 0,
"previousRevenue": 0,
"inboundPurchaseOrders": 0,
"inboundPurchaseValue": 0,
"inboundTransfers": 0,
"outboundTransfers": 0,
"inventoryValue": 0,
"activeProducts": 0,
"channels": [
{}
],
"periodFrom": "2026-09-29T08:00:00Z",
"periodTo": "2026-09-29T08:00:00Z"
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Get top products
GET/api/v1/insights/locations/{locationId}/top-products
Returns the top-selling products at one location over the period, ordered by revenue.
Access. Send a bearer token or an API key. The caller needs the Insights view permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
locationId | path | string (uuid) | Yes | |
from | query | string (date-time) | No | |
to | query | string (date-time) | No | |
take | query | integer (int32) | No | Default: 10. |
Response
200. Returns a JSON array. Each item is LocationTopProductResponse.
curl -X GET "https://api.miridia.io/api/v1/insights/locations/{locationId}/top-products" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"[
{
"productId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"sku": "string",
"totalSold": 0,
"totalRevenue": 0
}
]Get turnover history
GET/api/v1/insights/locations/{locationId}/turnover-history
Returns the monthly inventory turnover history for one location over the period.
Access. Send a bearer token or an API key. The caller needs the Insights view permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
locationId | path | string (uuid) | Yes | |
from | query | string (date-time) | No | |
to | query | string (date-time) | No |
Response
200. Returns a JSON array. Each item is LocationTurnoverRowResponse.
curl -X GET "https://api.miridia.io/api/v1/insights/locations/{locationId}/turnover-history" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"[
{
"period": "string",
"totalIn": 0,
"totalOut": 0,
"netChange": 0
}
]Models
The operations on this page use these object types. Select a type to see its fields.
LocationChannelSalesResponse
Sales for one sales channel at one location over a period.
| Field | Type | Description |
|---|---|---|
salesChannelId | string (uuid) | |
title | string | |
orders | integer (int32) | |
revenue | number (double) |
LocationInsightResponse
Aggregated sales, inbound, outbound and inventory metrics for one business location over a period.
| Field | Type | Description |
|---|---|---|
locationId | string (uuid) | |
title | string | |
locationType | enum BusinessLocationType | One of: Office, Warehouse, Storefront, Remote, Other, Headquarters, Factory. |
currency | string | The most common sale currency in the period. Null with no sales. |
totalRevenue | number (double) | |
totalCost | number (double) | |
profit | number (double) | Total revenue minus total cost. |
orders | integer (int32) | |
averageOrderValue | number (double) | Total revenue divided by the order count. Null when the order count is zero. |
previousOrders | integer (int32) | |
previousRevenue | number (double) | |
inboundPurchaseOrders | integer (int32) | |
inboundPurchaseValue | number (double) | |
inboundTransfers | integer (int32) | |
outboundTransfers | integer (int32) | |
inventoryValue | number (double) | Current inventory value at the location. This value is not scoped to the period. |
activeProducts | integer (int32) | Count of products with quantity on hand above zero. This value is not scoped to the period. |
channels | LocationChannelSalesResponse[] | |
periodFrom | string (date-time) | |
periodTo | string (date-time) |
LocationTopProductResponse
A top-selling product at one location over a period.
| Field | Type | Description |
|---|---|---|
productId | string (uuid) | |
title | string | |
sku | string | |
totalSold | number (double) | |
totalRevenue | number (double) |
LocationTurnoverRowResponse
One month of inventory turnover at one location. period has the form "2026-08".
| Field | Type | Description |
|---|---|---|
period | string | |
totalIn | number (double) | |
totalOut | number (double) | |
netChange | number (double) |