• When you use the URL template, the server returns multiple categories (a result object of category documents). You can use this template as a convenient way of obtaining multiple categories in a single request, instead of issuing separate requests for each category. You can specify up to 50 multiple IDs. You must enclose the list of IDs in parentheses. If a category identifier contains parenthesis or the separator sign, you must URL encode the character. The server only returns online categories.

    Parameter

    apiOptions - Options to pass through to commerce-sdk-isomorphic, with null accepted for unset API parameters.

    Parameter

    queryOptions - TanStack Query query options, with enabled by default set to check that all required API parameters have been set.

    See

    Parameters

    • apiOptions: NullableParameters<{
          headers?: {
              [key: string]: string;
          };
          parameters: { ids: string; levels?: number | undefined; organizationId?: string | undefined; locale?: string | undefined; siteId?: string | undefined; };
      }>
    • queryOptions: ApiQueryOptions<{
          (options?): Promise<CategoryResult>;
          <T>(options?, rawResponse?): Promise<T extends true
              ? Response
              : CategoryResult>;
      }> = {}

    Returns UseQueryResult<CategoryResult, unknown>

    A TanStack Query query hook with data from the Shopper Products getCategories endpoint.