WC_REST_Order_Refunds_Controller::get_item_schema
Get the refund schema, conforming to JSON Schema.
Method of the class: WC_REST_Order_Refunds_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_Order_Refunds_Controller = new WC_REST_Order_Refunds_Controller(); $WC_REST_Order_Refunds_Controller->get_item_schema();
WC_REST_Order_Refunds_Controller::get_item_schema() WC REST Order Refunds Controller::get item schema code WC 10.5.0
public function get_item_schema() {
$schema = parent::get_item_schema();
$schema['properties']['line_items']['items']['properties']['refund_total'] = array(
'description' => __( 'Amount that will be refunded for this line item (excluding taxes).', 'woocommerce' ),
'type' => 'number',
'context' => array( 'edit' ),
'readonly' => true,
);
$schema['properties']['line_items']['items']['properties']['taxes']['items']['properties']['refund_total'] = array(
'description' => __( 'Amount that will be refunded for this tax.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'edit' ),
'readonly' => true,
);
$schema['properties']['api_restock'] = array(
'description' => __( 'When true, refunded items are restocked.', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'edit' ),
'default' => true,
);
if ( $this->cogs_is_enabled() ) {
$schema = $this->add_cogs_related_schema( $schema );
}
return $schema;
}