-2

I am new to the eBay API. I am struck for getting the same level categories. I am using getCategoriesInfo (Shopping) API for getting categories but not found any way to get the same level categories.

public function getCategories(int $categoryId = -1): Shopping\Types\GetCategoryInfoResponseType
{
    $service_params = $this->getServiceParams();

    $service_params[ 'siteId' ] = self::SITEIDS[ Cookie::get('GLOBAL-ID') ];
    $service                    = new Shopping\Services\ShoppingService($service_params);
    /**
     * Create the request object.
     */
    $request = new Shopping\Types\GetCategoryInfoRequestType();

    $request->CategoryID      = (string)$categoryId;
    $request->IncludeSelector = 'ChildCategories';

    /**
     * Send the request.
     */
    return $response = $service->getCategoryInfo($request);
}

1 Answers1

0

To get the same-level categories, you need to specify the parent category and request the children cats.

helios825
  • 682
  • 5
  • 6