ATUM REST API

Dashboard

ATUM

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

AttributeTypeDescription
slugstringAn alphanumeric identifier for the widget. It's also the path of its data endpoint. read-only
descriptionstringA 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

GET/wp-json/wc/v3/atum/dashboard
curl https://example.com/wp-json/wc/v3/atum/dashboard \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "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

GET/wp-json/wc/v3/atum/dashboard/statistics
curl https://example.com/wp-json/wc/v3/atum/dashboard/statistics?data=sales&period=this_year \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "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

AttributeTypeDescription
datasetobjectThe 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
periodstringThe 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
legendsobjectThe legends used on the statistics charts. It contains the value and products labels. read-only

Available parameters

ParameterTypeDescription
datastringThe type of data to return. Default is sales. Options: sales, lost-sales, promo-sales and orders.
periodstringThe 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

GET/wp-json/wc/v3/atum/dashboard/sales
curl https://example.com/wp-json/wc/v3/atum/dashboard/sales?period=month \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "period": "month",
        "data": {
            "value": "€1590,00",
            "products": 12
        },
        "_links": {
            "about": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/dashboard"
                }
            ]
        }
    }
]

Sales widget properties

AttributeTypeDescription
periodstringThe period window used to get the sales data for. read-only
dataobjectThe 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

ParameterTypeDescription
periodstringThe 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

GET/wp-json/wc/v3/atum/dashboard/lost-sales
curl https://example.com/wp-json/wc/v3/atum/dashboard/lost-sales?period=month \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "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

AttributeTypeDescription
periodstringThe period window used to get the lost sales data for. read-only
dataobjectThe 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

ParameterTypeDescription
periodstringThe 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

GET/wp-json/wc/v3/atum/dashboard/orders
curl https://example.com/wp-json/wc/v3/atum/dashboard/orders?period=previous_month \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "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

AttributeTypeDescription
periodstringThe period window used to get the orders data for. read-only
dataobjectThe 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

ParameterTypeDescription
periodstringThe 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

GET/wp-json/wc/v3/atum/dashboard/promo-sales
curl https://example.com/wp-json/wc/v3/atum/dashboard/promo-sales?period=previous_month \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "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

AttributeTypeDescription
periodstringThe period window used to get the promo sales data for. read-only
dataobjectThe 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

ParameterTypeDescription
periodstringThe 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

GET/wp-json/wc/v3/atum/dashboard/stock-control
curl https://example.com/wp-json/wc/v3/atum/dashboard/stock-control \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "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

AttributeTypeDescription
stock_countersobjectThe stock control data. See Stock counters properties. read-only

Stock counters properties

AttributeTypeDescription
count_in_stockintegerThe total amount of products in stock. read-only
count_out_stockintegerThe total amount of products out of stock. read-only
count_restock_statusintegerThe total amount of products in restock status. read-only
count_allintegerThe total amount of products. read-only
count_unmanagedintegerThe 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

GET/wp-json/wc/v3/atum/dashboard/current-stock-value
curl https://example.com/wp-json/wc/v3/atum/dashboard/current-stock-value \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "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

AttributeTypeDescription
current_stock_valuesobjectThe current stock value data. See Current stock values properties. read-only

Current stock values properties

AttributeTypeDescription
items_stocks_counternumberThe total quantity of items physically in stock (that have known purchase price). read-only
items_purchase_price_totalnumberThe cumulated purchase price value. read-only
items_without_purchase_pricenumberThe total quantity of items in stock that have no purchase price set. read-only

On this page