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

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

No Hooks.

Returns

Array.

Usage

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

OrderShippingSchema::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,
		),
		'method_title' => array(
			'description' => __( 'Shipping method name.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
		),
		'method_id'    => array(
			'description' => __( 'Shipping method ID.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
		),
		'instance_id'  => array(
			'description' => __( 'Shipping instance ID.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
		),
		'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;
}