Sales insights
Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.
| Method | Path | Operation |
|---|---|---|
| GET | /api/v1/insights/sales/history | Get sales history |
| GET | /api/v1/insights/sales/by-channel | Get sales by channel |
| GET | /api/v1/insights/sales/by-location | Get sales by location |
Get sales history
GET/api/v1/insights/sales/history
Returns the daily order sales history for the business. With no from and no to, this keeps the trailing six-month default of GetOrderSalesHistoryQuery. With at least one bound, this resolves the period with resolve.
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 SingleResult envelope. The data field is OrderSalesVolumeHistoryWrapperResponse.
curl -X GET "https://api.miridia.io/api/v1/insights/sales/history" \
-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": {
"currency": {
"iso4217": "string",
"utf8Symbol": "string",
"currencyCode": "Eur"
},
"salesThisMonth": 0,
"salesSinceLastWeek": 0,
"salesSinceLastMonth": 0,
"items": [
{}
]
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Get sales by channel
GET/api/v1/insights/sales/by-channel
Returns aggregated sales insight metrics for every sales channel 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 ChannelSalesInsightResponse.
curl -X GET "https://api.miridia.io/api/v1/insights/sales/by-channel" \
-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": [
{
"salesChannelId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"kind": "Direct",
"connectionStatus": "Connected",
"providerTitle": "string",
"providerDateModified": "2026-09-29T08:00:00Z",
"periodFrom": "2026-09-29T08:00:00Z",
"periodTo": "2026-09-29T08:00:00Z",
"currency": "string",
"orders": 0,
"revenue": 0,
"averageOrderValue": 0,
"previousOrders": 0,
"previousRevenue": 0,
"statusBreakdown": [
{}
],
"topProducts": [
{}
],
"locations": [
{}
]
}
],
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
]
}Get sales by location
GET/api/v1/insights/sales/by-location
Returns sales metrics for every location and every sales channel in the business, one bucket for each calendar month that the period touches, plus a set of heatmap points for online and marketplace orders. 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 SingleResult envelope. The data field is LocationSalesInsightResponse.
curl -X GET "https://api.miridia.io/api/v1/insights/sales/by-location" \
-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": {
"periodFrom": "2026-09-29T08:00:00Z",
"periodTo": "2026-09-29T08:00:00Z",
"currency": "string",
"buckets": [
{}
],
"points": [
{}
]
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Models
The operations on this page use these object types. Select a type to see its fields.
ChannelLocationSalesResponse
Sales for one origin location, for one sales channel over a period.
| Field | Type | Description |
|---|---|---|
locationId | string (uuid) | |
title | string | |
orders | integer (int32) | |
revenue | number (double) |
ChannelSalesInsightResponse
Aggregated sales metrics for one sales channel over a period.
| Field | Type | Description |
|---|---|---|
salesChannelId | string (uuid) | |
title | string | |
kind | enum SalesChannelKind | One of: Direct, PointOfSale, Online, Marketplace. |
connectionStatus | enum ConnectionStatus | One of: Connected, Disconnected, Error. |
providerTitle | string | The title of the configured provider. Null with no configured provider. |
providerDateModified | string (date-time) | The last-modified date of the configured provider. Null with no configured provider. |
periodFrom | string (date-time) | |
periodTo | string (date-time) | |
currency | string | The most common sale currency in the period. Null with no sales. |
orders | integer (int32) | |
revenue | number (double) | |
averageOrderValue | number (double) | Revenue divided by orders, rounded to two decimals. Zero when orders is zero. |
previousOrders | integer (int32) | |
previousRevenue | number (double) | |
statusBreakdown | ChannelStatusBreakdownResponse[] | |
topProducts | ChannelTopProductResponse[] | |
locations | ChannelLocationSalesResponse[] |
ChannelStatusBreakdownResponse
The order count for one order status, for one sales channel over a period.
| Field | Type | Description |
|---|---|---|
status | enum OrderStatus | One of: Unknown, New, PendingCollection, PendingDelivery, Complete, Cancelled, PendingReturn, Returned. |
count | integer (int32) |
ChannelTopProductResponse
A top-selling product for one sales channel over a period.
| Field | Type | Description |
|---|---|---|
productId | string (uuid) | |
title | string | |
sku | string | |
units | number (double) | |
revenue | number (double) |
CurrencyResponse
| Field | Type | Description |
|---|---|---|
iso4217 | string | |
utf8Symbol | string | |
currencyCode | enum CurrencyCode | One of: Invalid, Eur, Usd, Gbp, Zar, Zmw. |
LocationSalesBucketChannelResponse
Sales for one sales channel over one calendar month.
| Field | Type | Description |
|---|---|---|
salesChannelId | string (uuid) | |
title | string | |
kind | enum SalesChannelKind | One of: Direct, PointOfSale, Online, Marketplace. |
orders | integer (int32) | |
revenue | number (double) |
LocationSalesBucketLocationResponse
Sales for one business location over one calendar month.
| Field | Type | Description |
|---|---|---|
locationId | string (uuid) | |
title | string | |
latitude | number (double) | The coordinate of the location's address. Null when the location has no address. |
longitude | number (double) | The coordinate of the location's address. Null when the location has no address. |
orders | integer (int32) | |
revenue | number (double) | |
averageOrderValue | number (double) | Revenue divided by orders, rounded to two decimals. Zero when orders is zero. |
LocationSalesBucketResponse
Sales metrics for every business location and every sales channel over one calendar month.
| Field | Type | Description |
|---|---|---|
month | string | The calendar month, in the form "2026-08". |
locations | LocationSalesBucketLocationResponse[] | |
channels | LocationSalesBucketChannelResponse[] |
LocationSalesInsightResponse
Sales metrics for every business location and every sales channel, one bucket for each calendar month that a period touches, plus a set of points for a heatmap of online and marketplace orders.
| Field | Type | Description |
|---|---|---|
periodFrom | string (date-time) | |
periodTo | string (date-time) | |
currency | string | The most common sale currency in the period. Null with no sales. |
buckets | LocationSalesBucketResponse[] | |
points | LocationSalesPointResponse[] |
LocationSalesPointResponse
One heatmap point for online and marketplace orders over one calendar month, grouped by the destination address rounded to two decimal places.
| Field | Type | Description |
|---|---|---|
month | string | The calendar month, in the form "2026-08". |
latitude | number (double) | |
longitude | number (double) | |
orders | integer (int32) | |
revenue | number (double) |
OrderSalesVolumeHistoryResponse
| Field | Type | Description |
|---|---|---|
sales | integer (int32) | |
valueOfSales | number (double) | |
date | string (date-time) |
OrderSalesVolumeHistoryWrapperResponse
| Field | Type | Description |
|---|---|---|
currency | CurrencyResponse | |
salesThisMonth | integer (int32) | |
salesSinceLastWeek | number (double) | |
salesSinceLastMonth | number (double) | |
items | OrderSalesVolumeHistoryResponse[] |