Class WC_API_Reports

WC_API_Resource
Extended by WC_API_Reports
Package: WooCommerce\API
Author: WooThemes
Located at includes/api/class-wc-api-reports.php

Methods summary

public array
# register_routes( array $routes )

Register the routes for this class

Register the routes for this class

GET /reports GET /reports/sales

Parameters

$routes
array
$routes

Returns

array

Since

2.1
public array
# get_reports( )

Get a simple listing of available reports

Get a simple listing of available reports

Returns

array

Since

2.1
public array
# get_sales_report( string $fields = null, array $filter = array() )

Get the sales report

Get the sales report

Parameters

$fields
string
$fields fields to include in response
$filter
array
$filter date filtering

Returns

array

Since

2.1
public array
# get_top_sellers_report( string $fields = null, array $filter = array() )

Get the top sellers report

Get the top sellers report

Parameters

$fields
string
$fields fields to include in response
$filter
array
$filter date filtering

Returns

array

Since

2.1
protected boolean
# validate_request( null $id = null, null $type = null, null $context = null )

Verify that the current user has permission to view reports

Verify that the current user has permission to view reports

Parameters

$id
null
$id unused
$type
null
$type unused
$context
null
$context unused

Returns

boolean
true if the request is valid and should be processed, false otherwise

Since

2.1

See

WC_API_Resource::validate_request()

Overrides

WC_API_Resource::validate_request

Methods inherited from WC_API_Resource

__construct(), delete(), filter_response_fields(), is_deletable(), is_editable(), is_readable(), maybe_add_meta(), merge_query_args()

Magic methods summary

Properties summary

protected string $base
#

$base the route base

$base the route base

Properties inherited from WC_API_Resource

$server

WooCommerce API documentation generated by ApiGen 2.8.0