You can use this API to retrieve the list of product Ids that are parents to the given product.

APISignature
getParentProductswebService static List getParentProducts(String productId)



Request Parameter
NameTypeDescription
productIdStringThe id product for which you want to retrieve the parent product.
Response Parameter
NameTypeDescription
parentProductIDsListThe list of parent products 


Code Sample

The below sample code retrieves the parent products of a given product.


public List<Id> getParentProducts(String productName) {
	// get child and parent products and option group
	Product2 childProduct = [SELECT Id FROM Product2 WHERE Name = :productName LIMIT 1];
	
	// retrieve product IDs
	List<ID> parentProductIds = CPQAdminWebService.getParentProducts(childProduct.Id);
	
	return parentProductIds;
}
CODE