curl --request GET \
--url https://omnicommerce.sg/api/v1/analytics/sales \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://omnicommerce.sg/api/v1/analytics/sales', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/analytics/sales"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"ok": true,
"apiVersion": "developer_v1",
"operationId": "<string>",
"status": "accepted",
"warnings": [
"<string>"
],
"recommendations": [
"<string>"
],
"links": {},
"data": {
"filters": {
"from": "<string>",
"to": "<string>",
"marketplace": "<string>",
"country": "<string>",
"store": "<string>",
"currency": "<string>",
"timeZone": "<string>"
},
"previousFrom": "<string>",
"previousTo": "<string>",
"kpis": {
"orders": 0,
"netSales": 123,
"aov": 123,
"unitsSold": 123,
"unitsPerOrder": 123,
"returnedOrders": 0,
"returnRate": 123,
"ordersChangePercent": 123,
"netSalesChangePercent": 123,
"aovChangePercent": 123,
"unitsChangePercent": 123,
"returnRateChangePercent": 123,
"identifiedBuyers": 0,
"repeatBuyers": 0,
"repeatRate": 123,
"cancelledOrders": 0,
"cancelRate": 123
},
"statusMix": [
{
"status": "<string>",
"orders": 0,
"netSales": 123
}
],
"platformMix": [
{
"platform": "<string>",
"orders": 0,
"netSales": 123
}
],
"dailyTrend": [
{
"date": "<string>",
"previousDate": "<string>",
"orders": 0,
"netSales": 123,
"previousOrders": 0,
"previousNetSales": 123
}
],
"topProducts": [
{
"productId": "<string>",
"productName": "<string>",
"platform": "<string>",
"accountId": "<string>",
"externalProductId": "<string>",
"sku": "<string>",
"thumbnailUrl": "<string>",
"orders": 0,
"unitsSold": 123,
"netSales": 123
}
]
},
"jobId": "<string>",
"productId": "<string>"
}Get Sales Analytics
Sales KPIs for a date range with the change against the previous period of equal length, a daily trend, sales by order status and by marketplace, and the top products by net sales. Matches the Orders analysis page. Requires analytics:read.
Amounts are in data.filters.currency. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
curl --request GET \
--url https://omnicommerce.sg/api/v1/analytics/sales \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://omnicommerce.sg/api/v1/analytics/sales', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/analytics/sales"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"ok": true,
"apiVersion": "developer_v1",
"operationId": "<string>",
"status": "accepted",
"warnings": [
"<string>"
],
"recommendations": [
"<string>"
],
"links": {},
"data": {
"filters": {
"from": "<string>",
"to": "<string>",
"marketplace": "<string>",
"country": "<string>",
"store": "<string>",
"currency": "<string>",
"timeZone": "<string>"
},
"previousFrom": "<string>",
"previousTo": "<string>",
"kpis": {
"orders": 0,
"netSales": 123,
"aov": 123,
"unitsSold": 123,
"unitsPerOrder": 123,
"returnedOrders": 0,
"returnRate": 123,
"ordersChangePercent": 123,
"netSalesChangePercent": 123,
"aovChangePercent": 123,
"unitsChangePercent": 123,
"returnRateChangePercent": 123,
"identifiedBuyers": 0,
"repeatBuyers": 0,
"repeatRate": 123,
"cancelledOrders": 0,
"cancelRate": 123
},
"statusMix": [
{
"status": "<string>",
"orders": 0,
"netSales": 123
}
],
"platformMix": [
{
"platform": "<string>",
"orders": 0,
"netSales": 123
}
],
"dailyTrend": [
{
"date": "<string>",
"previousDate": "<string>",
"orders": 0,
"netSales": 123,
"previousOrders": 0,
"previousNetSales": 123
}
],
"topProducts": [
{
"productId": "<string>",
"productName": "<string>",
"platform": "<string>",
"accountId": "<string>",
"externalProductId": "<string>",
"sku": "<string>",
"thumbnailUrl": "<string>",
"orders": 0,
"unitsSold": 123,
"netSales": 123
}
]
},
"jobId": "<string>",
"productId": "<string>"
}Authorizations
Bearer API key for server-to-server access. Session auth is also supported in first-party UI flows.
Query Parameters
Required for session auth. API keys already belong to one organization.
160First day of the range (YYYY-MM-DD). Defaults to 29 days before to.
^\d{4}-\d{2}-\d{2}$Last day of the range, inclusive (YYYY-MM-DD). Defaults to today.
^\d{4}-\d{2}-\d{2}$Comma-separated marketplaces, for example shopee,lazada.
200Comma-separated countries. One country selects its currency.
200Comma-separated store (account) ids from GET /api/v1/marketplaces/connected.
1000ISO currency. Only orders in this currency are counted; amounts are not converted. Defaults to the single country's currency, otherwise SGD.
3IANA time zone that defines each day, for example Asia/Kuala_Lumpur. Defaults to Asia/Singapore.
80Response
Sales analytics.
"developer_v1"accepted, completed, failed Show child attributes
Show child attributes
Show child attributes
Show child attributes