Automattic\WooCommerce\Internal\RestApi\Routes\V4\ShippingZoneMethod

ShippingMethodSchema::get_item_schema_propertiespublicWC 1.0

Return all properties for the item schema

Method of the class: ShippingMethodSchema{}

No Hooks.

Returns

Array.

Usage

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

ShippingMethodSchema::get_item_schema_properties() code WC 10.4.3

public function get_item_schema_properties(): array {
	return array(
		'instance_id' => array(
			'description' => __( 'Shipping method instance ID.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'zone_id'     => array(
			'description' => __( 'Shipping zone ID.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit' ),
			'required'    => true,
		),
		'enabled'     => array(
			'description' => __( 'Whether the shipping method is enabled.', 'woocommerce' ),
			'type'        => 'boolean',
			'context'     => array( 'view', 'edit' ),
			'required'    => true,
		),
		'order'       => array(
			'description'       => __( 'Shipping method sort order.', 'woocommerce' ),
			'type'              => 'integer',
			'context'           => array( 'view', 'edit' ),
			'sanitize_callback' => 'absint',
		),
		'method_id'   => array(
			'description' => __( 'Shipping method ID.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
			'required'    => true,
		),
		'settings'    => array(
			'description'          => __( 'Shipping method settings including title and configuration.', 'woocommerce' ),
			'type'                 => 'object',
			'context'              => array( 'view', 'edit' ),
			'required'             => true,
			'properties'           => array(
				'title' => array(
					'description' => __( 'Shipping method title.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'required'    => true,
				),
			),
			'additionalProperties' => true,
		),
	);
}