Automattic\WooCommerce\Internal\Abilities

AbilitiesRestBridge::get_configurationsprivate staticWC 1.0

Get REST controller configurations with explicit IDs, labels, and descriptions.

Method of the class: AbilitiesRestBridge{}

No Hooks.

Returns

Array. Controller configurations.

Usage

$result = AbilitiesRestBridge::get_configurations(): array;

AbilitiesRestBridge::get_configurations() code WC 10.4.3

private static function get_configurations(): array {
	return array(
		array(
			'controller' => \WC_REST_Products_Controller::class,
			'route'      => '/wc/v3/products',
			'abilities'  => array(
				array(
					'id'          => 'woocommerce/products-list',
					'operation'   => 'list',
					'label'       => __( 'List Products', 'woocommerce' ),
					'description' => __( 'Retrieve a paginated list of products with optional filters for status, category, price range, and other attributes.', 'woocommerce' ),
				),
				array(
					'id'          => 'woocommerce/products-get',
					'operation'   => 'get',
					'label'       => __( 'Get Product', 'woocommerce' ),
					'description' => __( 'Retrieve detailed information about a single product by ID, including price, description, images, and metadata.', 'woocommerce' ),
				),
				array(
					'id'          => 'woocommerce/products-create',
					'operation'   => 'create',
					'label'       => __( 'Create Product', 'woocommerce' ),
					'description' => __( 'Create a new product in WooCommerce with name, price, description, and other product attributes.', 'woocommerce' ),
				),
				array(
					'id'          => 'woocommerce/products-update',
					'operation'   => 'update',
					'label'       => __( 'Update Product', 'woocommerce' ),
					'description' => __( 'Update an existing product by modifying its attributes such as price, stock, description, or metadata.', 'woocommerce' ),
				),
				array(
					'id'          => 'woocommerce/products-delete',
					'operation'   => 'delete',
					'label'       => __( 'Delete Product', 'woocommerce' ),
					'description' => __( 'Permanently delete a product from the store. This action cannot be undone.', 'woocommerce' ),
				),
			),
		),
		array(
			'controller' => \WC_REST_Orders_Controller::class,
			'route'      => '/wc/v3/orders',
			'abilities'  => array(
				array(
					'id'          => 'woocommerce/orders-list',
					'operation'   => 'list',
					'label'       => __( 'List Orders', 'woocommerce' ),
					'description' => __( 'Retrieve a paginated list of orders with optional filters for status, customer, date range, and other criteria.', 'woocommerce' ),
				),
				array(
					'id'          => 'woocommerce/orders-get',
					'operation'   => 'get',
					'label'       => __( 'Get Order', 'woocommerce' ),
					'description' => __( 'Retrieve detailed information about a single order by ID, including line items, customer details, and payment information.', 'woocommerce' ),
				),
				array(
					'id'          => 'woocommerce/orders-create',
					'operation'   => 'create',
					'label'       => __( 'Create Order', 'woocommerce' ),
					'description' => __( 'Create a new order with customer information, line items, shipping details, and payment information.', 'woocommerce' ),
				),
				array(
					'id'          => 'woocommerce/orders-update',
					'operation'   => 'update',
					'label'       => __( 'Update Order', 'woocommerce' ),
					'description' => __( 'Update an existing order by modifying status, customer information, line items, or other order details.', 'woocommerce' ),
				),
			),
		),
	);
}