Skip to main content

Reports

The reports API allows you to view all types of reports available.

List all reports

This API lets you retrieve and view a simple list of available reports.

GET /wp-json/wc/v1/reports
curl https://example.com/wp-json/wc/v1/reports \
-u consumer_key:consumer_secret

Retrieve sales report

This API lets you retrieve and view a sales report.

GET /wp-json/wc/v1/reports/sales
curl https://example.com/wp-json/wc/v1/reports/sales?date_min=2016-05-03&date_max=2016-05-04 \
-u consumer_key:consumer_secret

Sales report properties

AttributeTypeDescription
total_salesstringGross sales in the period. READ-ONLY
net_salesstringNet sales in the period. READ-ONLY
average_salesstringAverage net daily sales. READ-ONLY
total_ordersintegerTotal of orders placed. READ-ONLY
total_itemsintegerTotal of items purchased. READ-ONLY
total_taxstringTotal charged for taxes. READ-ONLY
total_shippingstringTotal charged for shipping. READ-ONLY
total_refundsnumberTotal of refunded orders. READ-ONLY
total_discountintegerTotal of coupons used. READ-ONLY
totals_grouped_bystringGroup type. READ-ONLY
totalsarrayTotals. READ-ONLY

Available parameters

ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Default is view. Options: view.
periodstringReport period. Default is today's date. Options: week, month, last_month and year
date_minstringReturn sales for a specific start date, the date need to be in the YYYY-MM-DD format.
date_maxstringReturn sales for a specific end date, the date need to be in the YYYY-MM-DD format.

Retrieve top sellers report

This API lets you retrieve and view a list of top sellers report.

GET /wp-json/wc/v1/reports/top_sellers
curl https://example.com/wp-json/wc/v1/reports/top_sellers?period=last_month \
-u consumer_key:consumer_secret

Top sellers report properties

AttributeTypeDescription
titlestringProduct title. READ-ONLY
product_idintegerProduct ID. READ-ONLY
quantityintegerTotal number of purchases. READ-ONLY

Available parameters

ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Default is view. Options: view.
periodstringReport period. Default is week. Options: week, month, last_month and year
date_minstringReturn sales for a specific start date, the date need to be in the YYYY-MM-DD format.
date_maxstringReturn sales for a specific end date, the date need to be in the YYYY-MM-DD format.