Automattic\WooCommerce\Internal\RestApi\Routes\V4\Orders\Schema

OrderTaxSchema::get_item_schema_propertiespublicWC 1.0

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: OrderTaxSchema{}

No Hooks.

Returns

Array.

Usage

$OrderTaxSchema = new OrderTaxSchema();
$OrderTaxSchema->get_item_schema_properties(): array;

OrderTaxSchema::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,
		),
		'rate_code'          => array(
			'description' => __( 'Tax rate code.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
			'readonly'    => true,
		),
		'rate_id'            => array(
			'description' => __( 'Tax rate ID.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
			'readonly'    => true,
		),
		'label'              => array(
			'description' => __( 'Tax rate label.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
			'readonly'    => true,
		),
		'compound'           => array(
			'description' => __( 'Show if is a compound tax rate.', 'woocommerce' ),
			'type'        => 'boolean',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
			'readonly'    => true,
		),
		'tax_total'          => array(
			'description' => __( 'Tax total (not including shipping taxes).', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
			'readonly'    => true,
		),
		'shipping_tax_total' => array(
			'description' => __( 'Shipping tax total.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
			'readonly'    => true,
		),
		'meta_data'          => $this->get_meta_data_schema(),
	);

	return $schema;
}