Miridia
Portal
Insights

Sales insights

Sales history metrics for the business.

Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.

MethodPathOperation
GET/api/v1/insights/sales/historyGet sales history
GET/api/v1/insights/sales/by-channelGet sales by channel
GET/api/v1/insights/sales/by-locationGet 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

NameInTypeRequiredDescription
fromquerystring (date-time)No
toquerystring (date-time)No

Response

200. Returns a SingleResult envelope. The data field is OrderSalesVolumeHistoryWrapperResponse.

Request
curl -X GET "https://api.miridia.io/api/v1/insights/sales/history" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
{
  "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

NameInTypeRequiredDescription
fromquerystring (date-time)No
toquerystring (date-time)No

Response

200. Returns a PagedResult envelope. Each item in data is ChannelSalesInsightResponse.

Request
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"
Response
{
  "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

NameInTypeRequiredDescription
fromquerystring (date-time)No
toquerystring (date-time)No

Response

200. Returns a SingleResult envelope. The data field is LocationSalesInsightResponse.

Request
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"
Response
{
  "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.

FieldTypeDescription
locationIdstring (uuid)
titlestring
ordersinteger (int32)
revenuenumber (double)
ChannelSalesInsightResponse

Aggregated sales metrics for one sales channel over a period.

FieldTypeDescription
salesChannelIdstring (uuid)
titlestring
kindenum SalesChannelKindOne of: Direct, PointOfSale, Online, Marketplace.
connectionStatusenum ConnectionStatusOne of: Connected, Disconnected, Error.
providerTitlestringThe title of the configured provider. Null with no configured provider.
providerDateModifiedstring (date-time)The last-modified date of the configured provider. Null with no configured provider.
periodFromstring (date-time)
periodTostring (date-time)
currencystringThe most common sale currency in the period. Null with no sales.
ordersinteger (int32)
revenuenumber (double)
averageOrderValuenumber (double)Revenue divided by orders, rounded to two decimals. Zero when orders is zero.
previousOrdersinteger (int32)
previousRevenuenumber (double)
statusBreakdownChannelStatusBreakdownResponse[]
topProductsChannelTopProductResponse[]
locationsChannelLocationSalesResponse[]
ChannelStatusBreakdownResponse

The order count for one order status, for one sales channel over a period.

FieldTypeDescription
statusenum OrderStatusOne of: Unknown, New, PendingCollection, PendingDelivery, Complete, Cancelled, PendingReturn, Returned.
countinteger (int32)
ChannelTopProductResponse

A top-selling product for one sales channel over a period.

FieldTypeDescription
productIdstring (uuid)
titlestring
skustring
unitsnumber (double)
revenuenumber (double)
CurrencyResponse
FieldTypeDescription
iso4217string
utf8Symbolstring
currencyCodeenum CurrencyCodeOne of: Invalid, Eur, Usd, Gbp, Zar, Zmw.
LocationSalesBucketChannelResponse

Sales for one sales channel over one calendar month.

FieldTypeDescription
salesChannelIdstring (uuid)
titlestring
kindenum SalesChannelKindOne of: Direct, PointOfSale, Online, Marketplace.
ordersinteger (int32)
revenuenumber (double)
LocationSalesBucketLocationResponse

Sales for one business location over one calendar month.

FieldTypeDescription
locationIdstring (uuid)
titlestring
latitudenumber (double)The coordinate of the location's address. Null when the location has no address.
longitudenumber (double)The coordinate of the location's address. Null when the location has no address.
ordersinteger (int32)
revenuenumber (double)
averageOrderValuenumber (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.

FieldTypeDescription
monthstringThe calendar month, in the form "2026-08".
locationsLocationSalesBucketLocationResponse[]
channelsLocationSalesBucketChannelResponse[]
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.

FieldTypeDescription
periodFromstring (date-time)
periodTostring (date-time)
currencystringThe most common sale currency in the period. Null with no sales.
bucketsLocationSalesBucketResponse[]
pointsLocationSalesPointResponse[]
LocationSalesPointResponse

One heatmap point for online and marketplace orders over one calendar month, grouped by the destination address rounded to two decimal places.

FieldTypeDescription
monthstringThe calendar month, in the form "2026-08".
latitudenumber (double)
longitudenumber (double)
ordersinteger (int32)
revenuenumber (double)
OrderSalesVolumeHistoryResponse
FieldTypeDescription
salesinteger (int32)
valueOfSalesnumber (double)
datestring (date-time)
OrderSalesVolumeHistoryWrapperResponse
FieldTypeDescription
currencyCurrencyResponse
salesThisMonthinteger (int32)
salesSinceLastWeeknumber (double)
salesSinceLastMonthnumber (double)
itemsOrderSalesVolumeHistoryResponse[]