WC_REST_Report_Sales_V1_Controller::get_item_schema
Get the Report's schema, conforming to JSON Schema.
Method of the class: WC_REST_Report_Sales_V1_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_Report_Sales_V1_Controller = new WC_REST_Report_Sales_V1_Controller(); $WC_REST_Report_Sales_V1_Controller->get_item_schema();
WC_REST_Report_Sales_V1_Controller::get_item_schema() WC REST Report Sales V1 Controller::get item schema code WC 10.3.6
public function get_item_schema() {
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'sales_report',
'type' => 'object',
'properties' => array(
'total_sales' => array(
'description' => __( 'Gross sales in the period.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'net_sales' => array(
'description' => __( 'Net sales in the period.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'average_sales' => array(
'description' => __( 'Average net daily sales.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'total_orders' => array(
'description' => __( 'Total of orders placed.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'total_items' => array(
'description' => __( 'Total of items purchased.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'total_tax' => array(
'description' => __( 'Total charged for taxes.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'total_shipping' => array(
'description' => __( 'Total charged for shipping.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'total_refunds' => array(
'description' => __( 'Total of refunded orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'total_discount' => array(
'description' => __( 'Total of coupons used.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'totals_grouped_by' => array(
'description' => __( 'Group type.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'totals' => array(
'description' => __( 'Totals.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',
),
'context' => array( 'view' ),
'readonly' => true,
),
),
);
return $this->add_additional_fields_schema( $schema );
}