public function get_categories( $id = null, $args = array() ) {

		$this->set_request_args( array(
			'method' => 'GET',
			'path'   => array( 'categories', $id ),
			'params' => $args,
		) );

		return $this->do_request();
	}
public function get_categories( $id = null, $args = array() ) {

		$this->set_request_args( array(
			'method' => 'GET',
			'path'   => array( 'categories', $id ),
			'params' => $args,
		) );

		return $this->do_request();
	}
public function get_categories ( $ id = null , $ args = array ( ) ) { $ this -> set_request_args ( array ( 'method' => 'GET' , 'path' => array ( 'categories' , $ id ) , 'params' => $ args , ) ) ; return $ this -> do_request ( ) ; }
Get a list of product categories or a single product category

GET /products/categories
GET /products/categories/{#id}

@since 2.0
@param int $id category ID or null to get all product categories
@param array $args acceptable product categories endpoint args, currently only `fields`
@return array|object product categories!
Get a list of product categories or a single product category