Categories

The Categories API provides access to categories that are available to a shopper. Use categories to get a specific category by ID, get all categories, or retrieve all products from a category. A category is a class of products in a store. A catalog is a collection of products that are organized into categories for a store. Catalogs are created at the site-level and categories are created within a catalog. 

When you get a category, the API returns links to the products within the category. To get all products for a category, you can either use the expand=product query parameter or you can make follow-up calls. Categories can be nested; that is, contain subcategories. Getting products for a category returns products for that level of category and subcategories one level deep.

For more information on the hierarchical relationship between site, catalogs, categories, and products, see Company Hierarchy Overview.

Methods


					Host: api.digitalriver.com
Accept: application/json
Authorization: bearer your_access_token
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_102)
			
					The request body should be empty.
			
					HTTP/1.1 200 OK
			
					{"categories": {
   "uri": "https://api.digitalriver.com/v1/shoppers/me/categories",
   "category":    [
            {
         "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/9999999997",
         "displayName": "Shop by Category",
         "products":          {
            "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/9999999997/products",
         }
      },
            {
         "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/9999999998",
         "displayName": "Shop by Solution",
         "products":          {
            "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/9999999998/products",
         }
      },
            {
         "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/9999999999",
         "displayName": "Subscriptions",
         "products":          {
            "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/9999999999/products",
         }
      }
   ]
}}
			
					Host: api.digitalriver.com
User-Agent: API Client/1.0
Accept: */*
Authorization: bearer your_access_token
			
					The request body should be empty.
			
					HTTP/1.1 200 OK
			
					<category uri="https://api.digitalriver.com/v1/shoppers/me/categories/9999999999">
   <id>category_ID</id>
   <locale>en_US</locale>
   <name>Consumer_Office</name>
   <displayName>Games</displayName>
   <shortDescription>A brief description of Games</shortDescription>
   <longDescription>A detailed description of Games</longDescription>
 <thumbnailImage>http://drh1.img.digitalriver.com/DRHM/Storefront/images/product/thumbnail/music80x80.jpg</thumbnailImage>
   <products uri="https://api.digitalriver.com/v1/shoppers/me/categories/9999999999/products"/>
   <categories>
      <category uri="https://api.digitalriver.com/v1/shoppers/me/categories/9999999999">
         <displayName>Game Suites</displayName>
         <products uri="https://api.digitalriver.com/v1/shoppers/me/categories/9999999999/products"/>
      </category>
      <category uri="https://api.digitalriver.com/v1/shoppers/me/categories/9999999999">
         <displayName>Game Stand-alone Programs</displayName>
         <products uri="https://api.digitalriver.com/v1/shoppers/me/categories/9999999999/products"/>
      </category>
      <category uri="https://api.digitalriver.com/v1/shoppers/me/categories/9999999999">
         <displayName>Game for Mac</displayName>
         <products uri="https://api.digitalriver.com/v1/shoppers/me/categories/9999999999/products"/>
      </category>
   </categories>
</category>
			
					Host: api.digitalriver.com
Accept: application/json
Authorization: bearer your_access_token
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
			
					The request body should be empty.
			
					HTTP/1.1 200 OK
			
					{"categories": {
   "uri": "https://dispatch.digitalriver.com/v1/shoppers/me/products/product_ID/categories",
   "category":    [
            {
         "uri": "https://dispatch.digitalriver.com/v1/shoppers/me/categories/999999999",
         "id": 999999999,
         "locale": "en_US",
         "name": "Fitness",
         "displayName": "Fitness",
         "shortDescription": null,
         "longDescription": null,
         "thumbnailImage": null,
         "customAttributes": {"attribute":          [
                        {
               "name": "Meta Description",
               "type": "string",
               "value": null
            },
                        {
               "name": "testCustomAttribute1",
               "type": "string",
               "value": "testCustomAttribute1Description"
            },
                        {
               "name": "Custom Title",
               "type": "string",
               "value": null
            },
                        {
               "name": "testCustomAttribute2",
               "type": "string",
               "value": "testCustomAttribute2Description"
            },
                        {
               "name": "Meta Keywords",
               "type": "string",
               "value": null
            }
         ]},
         "products":          {
            "uri": "https://dispatch.digitalriver.com/v1/shoppers/me/categories/999999999/products",
         }
      },
            {
         "uri": "https://dispatch.digitalriver.com/v1/shoppers/me/categories/999999999",
         "id": category_ID,
         "locale": "en_US",
         "name": "Home and Home Office",
         "displayName": "Home and Home Office",
         "shortDescription": null,
         "longDescription": null,
         "thumbnailImage": null,
         "products":          {
            "uri": "https://dispatch.digitalriver.com/v1/shoppers/me/categories/999999999/products",
         }
      }
   ]
}}
			

Response Body Parameters

Field
Data Type
Visibility
Description
categories
link
default
A link to the Categories API. A collection of categories also called subcategories.
category
string
default
A class of products. A catalog typically has multiple categories. See Categories API for more information.
displayName
string
default
The name of the category to display to the shopper.
id
string
default
The category ID. The ID is assigned automatically when the category is created.
locale
string
default
The locale defined for the category.
longDescription
string
default
A detailed description of the category.
name
string
default
The name of the category.
products
link
default
The products in the category. See the Products API for more information.
shortDescription
string
default
A brief description of the category.
thumbnailImage
uri
default
A URI to the thumbnail image of the category.

Related APIs

The following table lists methods for related APIs that provide category information.

Related APIs Methods
Products GET /shoppers/me/categories/{id}/products