Categories

Learn how to retrieve categories.

Categories are an essential organizational tool in eCommerce platforms, allowing merchants and shoppers to navigate and manage an extensive array of products easily. By categorizing items, an online store can offer a more efficient and user-friendly shopping experience, guiding customers through a logical structure to find exactly what they're looking for. This section outlines methods for retrieving category information programmatically, ensuring that developers can smoothly integrate category data into applications and enhancing the eCommerce experience with well-structured product navigation.

A category is a collection of grouped products within a catalog. They organize products in your catalog to help shoppers navigate your store or site and locate products. This topic explains how to retrieve a category programmatically. You can also manage categories from the Global Commerce user interface.

Getting all categories and subcategories

Retrieving all categories and subcategories of products is a crucial step in managing and navigating an eCommerce platform. This operation allows developers to access a comprehensive list of the categories and subcategories available in the catalog, which they can use to enhance users' browsing experience. This guide covers how to fetch this information using a simple API request programmatically. You can efficiently integrate category data into your applications by leveraging the provided endpoints, ensuring a well-organized and user-friendly product navigation system. Read on to learn how to make these API calls and interpret the results.

To retrieve all categories and subcategories, use the GET /v1/shoppers/me/categories request. Replace {Your_Access_Token} with your access token in the following example. The query parameters are described in the query parameters. The 200 OK response will include various categories, each with its own URI, displayName, and a link to its products.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/categories' \
--header 'authorization: bearer {Your_Access_token}\
...

Getting a category by identifier

Retrieving a category by its unique identifier is essential for developers working with eCommerce platforms. It offers a precise way to access the details of a specific category within the catalog. This section guides you through using an API request to obtain detailed information about a category, including its name, descriptions, and associated products and subcategories. Follow the steps below to learn how to make this API call effectively, enabling targeted navigation and management within your application.

To get a category by its identifier, use the GET /v1/shoppers/me/categories/{categoryId} request. Replace {categoryId} with the specific category ID you want to retrieve and {Your_Access_Token} with your access token in the following example.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/categories/{categoryId}' \
--header 'authorization: bearer {Your_Access_token}\
...

Upon a successful request, you will receive a 200 OK response containing the details of the requested category, such as its id, name, displayNameand links to its products and subcategories. The query parameters are described in the query parameters.

Getting all categories for a specific product

Understanding how to categorize products on many eCommerce platforms can significantly improve management and user navigation. This guide uses an API request to retrieve all categories and subcategories associated with a specific product. This information is crucial for dynamically generating product details pages or organizing inventory based on category data. Following the instructions outlined below, you will learn how to make this API call effectively, enhancing your application's functionality and user experience.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/products/{productId}/categories' \
--header 'authorization: bearer {Your_Access_Token}' \
...

Upon a successful request, you will receive a 200 OK response containing the details of the requested category, such as its displayName, productsand links to its products and subcategories.

Last updated