Automattic\WooCommerce\Internal\RestApi\Routes\V4\Orders\Schema
OrderFeeSchema::get_item_schema_properties
Return all properties for the item schema.
Note that context determines under which context data should be visible. For example, edit would be the context used when getting records with the intent of editing them. embed context allows the data to be visible when the item is being embedded in another response.
Method of the class: OrderFeeSchema{}
No Hooks.
Returns
Array.
Usage
$OrderFeeSchema = new OrderFeeSchema(); $OrderFeeSchema->get_item_schema_properties(): array;
OrderFeeSchema::get_item_schema_properties() OrderFeeSchema::get item schema properties code WC 10.4.3
public function get_item_schema_properties(): array {
$schema = array(
'id' => array(
'description' => __( 'Item ID.', 'woocommerce' ),
'type' => 'integer',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
'name' => array(
'description' => __( 'Fee name.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'tax_class' => array(
'description' => __( 'Tax class of fee.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'tax_status' => array(
'description' => __( 'Tax status of fee.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'enum' => array( 'taxable', 'none' ),
),
'total' => array(
'description' => __( 'Line total (after discounts).', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'total_tax' => array(
'description' => __( 'Line total tax (after discounts).', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
'taxes' => $this->get_taxes_schema(),
'meta_data' => $this->get_meta_data_schema(),
);
return $schema;
}