Dashboard
The dashboard API allows you to get all types of ATUM Dashboard widgets available and the data shown in each of them.
The dashboard endpoints are only available when the ATUM Dashboard module is enabled, and they require the ATUM view_statistics capability.
Widget properties
| Attribute | Type | Description |
|---|---|---|
slug | string | An alphanumeric identifier for the widget. It's also the path of its data endpoint. read-only |
description | string | A human-readable description of the widget. read-only |
List all widgets
This API lets you retrieve and view a simple list of available widgets.
HTTP request
/wp-json/wc/v3/atum/dashboardcurl https://example.com/wp-json/wc/v3/atum/dashboard \
-u consumer_key:consumer_secret[
{
"slug": "statistics",
"description": "Displays both: your earnings and product sales over time.",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard/statistics"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
},
{
"slug": "sales",
"description": "Displays all of your sales and number of products sold by day or month.",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard/sales"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
},
{
"slug": "lost-sales",
"description": "Displays all of your lost revenue and number of products not sold by day or month.",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard/lost-sales"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
},
{
"slug": "orders",
"description": "Displays all of your orders by day, week or month.",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard/orders"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
},
{
"slug": "promo-sales",
"description": "Displays all of your promo sales and number of promo products sold by day, week or month.",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard/promo-sales"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
},
{
"slug": "stock-control",
"description": "Displays the number of your products that are in stock, out of stock, running low and unmanaged.",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard/stock-control"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
},
{
"slug": "current-stock-value",
"description": "Displays the total quantity of items physically in stock (that have known purchase price) and their cumulated purchase value.",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard/current-stock-value"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
}
]Retrieve statistics widget data
This API lets you retrieve and view the Dashboard's statistics widget data.
HTTP request
/wp-json/wc/v3/atum/dashboard/statisticscurl https://example.com/wp-json/wc/v3/atum/dashboard/statistics?data=sales&period=this_year \
-u consumer_key:consumer_secret[
{
"dataset": {
"value": [
75,
838.7,
0,
643.7,
48,
0,
0,
0,
210,
102,
0
],
"products": [
6,
74,
0,
80,
4,
0,
0,
0,
9,
17,
0
]
},
"legends": {
"value": "Sales",
"products": "Products"
},
"period": "month",
"_links": {
"about": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
}
]Statistics widget properties
| Attribute | Type | Description |
|---|---|---|
dataset | object | The collection of data for the statistics. It contains the value array (the money values for each interval of the period) and the products array (the product quantities, or the number of orders when data is orders, for each interval). The intervals in the future are not included. read-only |
period | string | The interval used for each value of the dataset. Options: month (for the yearly periods), monthDay (for the monthly periods) and weekDay (for the weekly periods). read-only |
legends | object | The legends used on the statistics charts. It contains the value and products labels. read-only |
Available parameters
| Parameter | Type | Description |
|---|---|---|
data | string | The type of data to return. Default is sales. Options: sales, lost-sales, promo-sales and orders. |
period | string | The period to get statistics from. Default is this_year. Options: this_year, previous_year, this_month, previous_month, this_week and previous_week. |
Retrieve sales widget data
This API lets you retrieve and view the Dashboard's sales widget data.
HTTP request
/wp-json/wc/v3/atum/dashboard/salescurl https://example.com/wp-json/wc/v3/atum/dashboard/sales?period=month \
-u consumer_key:consumer_secret[
{
"period": "month",
"data": {
"value": "€1590,00",
"products": 12
},
"_links": {
"about": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
}
]Sales widget properties
| Attribute | Type | Description |
|---|---|---|
period | string | The period window used to get the sales data for. read-only |
data | object | The sales data. It contains the value of all the sales in the period (formatted as a price with the store currency) and the amount of products sold. read-only |
Available parameters
| Parameter | Type | Description |
|---|---|---|
period | string | The period to get sales data from. Default is today. Options: today and month |
Retrieve lost sales widget data
This API lets you retrieve and view the Dashboard's lost sales widget data.
HTTP request
/wp-json/wc/v3/atum/dashboard/lost-salescurl https://example.com/wp-json/wc/v3/atum/dashboard/lost-sales?period=month \
-u consumer_key:consumer_secret[
{
"period": "month",
"data": {
"lost_value": "€84,50",
"lost_products": 0
},
"_links": {
"about": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
}
]Lost sales widget properties
| Attribute | Type | Description |
|---|---|---|
period | string | The period window used to get the lost sales data for. read-only |
data | object | The lost sales data. It contains the lost_value (the value of the lost sales in the period, formatted as a price with the store currency) and lost_products. read-only |
Available parameters
| Parameter | Type | Description |
|---|---|---|
period | string | The period to get lost sales data from. Default is today. Options: today and month |
Retrieve orders widget data
This API lets you retrieve and view the Dashboard's orders widget data.
HTTP request
/wp-json/wc/v3/atum/dashboard/orderscurl https://example.com/wp-json/wc/v3/atum/dashboard/orders?period=previous_month \
-u consumer_key:consumer_secret[
{
"period": "previous_month",
"data": {
"value": "€16.121,98",
"orders": 137
},
"_links": {
"about": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
}
]Orders widget properties
| Attribute | Type | Description |
|---|---|---|
period | string | The period window used to get the orders data for. read-only |
data | object | The orders data. It contains the total value of the orders in the period (formatted as a price with the store currency) and the number of orders. Only the orders with the processing and completed statuses are counted. read-only |
Available parameters
| Parameter | Type | Description |
|---|---|---|
period | string | The period to get orders data from. Default is this_month. Options: this_month, previous_month, this_week and today. |
Retrieve promo sales widget data
This API lets you retrieve and view the Dashboard's promo sales widget data.
HTTP request
/wp-json/wc/v3/atum/dashboard/promo-salescurl https://example.com/wp-json/wc/v3/atum/dashboard/promo-sales?period=previous_month \
-u consumer_key:consumer_secret[
{
"period": "previous_month",
"data": {
"value": "€2,00",
"products": 1
},
"_links": {
"about": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
}
]Promo sales widget properties
| Attribute | Type | Description |
|---|---|---|
period | string | The period window used to get the promo sales data for. read-only |
data | object | The promo sales data. It contains the value of the promo sales in the period (formatted as a price with the store currency) and the amount of promo products sold. Only the orders with the processing and completed statuses are counted. read-only |
Available parameters
| Parameter | Type | Description |
|---|---|---|
period | string | The period to get promo sales data from. Default is this_month. Options: this_month, previous_month, this_week and today. |
Retrieve stock control widget data
This API lets you retrieve and view the Dashboard's stock control widget data.
HTTP request
/wp-json/wc/v3/atum/dashboard/stock-controlcurl https://example.com/wp-json/wc/v3/atum/dashboard/stock-control \
-u consumer_key:consumer_secret[
{
"stock_counters": {
"count_in_stock": 34,
"count_out_stock": 15,
"count_restock_status": 3,
"count_all": 68,
"count_unmanaged": 4
},
"_links": {
"about": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
}
]Stock control widget properties
| Attribute | Type | Description |
|---|---|---|
stock_counters | object | The stock control data. See Stock counters properties. read-only |
Stock counters properties
| Attribute | Type | Description |
|---|---|---|
count_in_stock | integer | The total amount of products in stock. read-only |
count_out_stock | integer | The total amount of products out of stock. read-only |
count_restock_status | integer | The total amount of products in restock status. read-only |
count_all | integer | The total amount of products. read-only |
count_unmanaged | integer | The total amount of products that are not being managed by WooCommerce. When the ATUM's "Unmanaged product counters" setting is enabled, the unmanaged products are also included in the in stock and out of stock counters. read-only |
Retrieve current stock value widget data
This API lets you retrieve and view the Dashboard's current stock value widget data.
HTTP request
/wp-json/wc/v3/atum/dashboard/current-stock-valuecurl https://example.com/wp-json/wc/v3/atum/dashboard/current-stock-value \
-u consumer_key:consumer_secret[
{
"current_stock_values": {
"items_stocks_counter": 31867,
"items_purchase_price_total": 59925.53,
"items_without_purchase_price": 7410
},
"_links": {
"about": [
{
"href": "https://example.com/wp-json/wc/v3/atum/dashboard"
}
]
}
}
]Current stock value widget properties
| Attribute | Type | Description |
|---|---|---|
current_stock_values | object | The current stock value data. See Current stock values properties. read-only |
Current stock values properties
| Attribute | Type | Description |
|---|---|---|
items_stocks_counter | number | The total quantity of items physically in stock (that have known purchase price). read-only |
items_purchase_price_total | number | The cumulated purchase price value. read-only |
items_without_purchase_price | number | The total quantity of items in stock that have no purchase price set. read-only |