Categories
Learn how to retrieve categories.
A category is a collection of grouped products within a catalog. They are used to organize products in your catalog to help shoppers locate products and navigate your store or site. This topic explains how to retrieve a category programmatically. You can also manage categories using Global Commerce.
Getting all categories and subcategories
The GET /v1/shoppers/me/categories request retrieves all categories and subcategories. See Categories query parameters for a description of the query parameters. 
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/categories' \
--header 'authorization: bearer ***\
...{
  "uri": "https://api.digitalriver.com/v1/shoppers/me/categories",
  "category": [
    {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/6912100",
      "displayName": "Shop by Category",
      "products": {
        "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/6912100/products"
      }
    }
  ]
}Getting a category by identifier
The GET /v1/shoppers/me/categories/{categoryId} request retrieves a specific category and its subcategories by its category identifier (categoryId). See Categories query parameters for a description of the query parameters. 
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/categories/{categoryId}' \
--header 'authorization: bearer ***\
...{
  "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/6912100",
  "id": 6912100,
  "locale": "en_US",
  "name": "Shop by Category",
  "displayName": "Shop by Category",
  "shortDescription": "string",
  "longDescription": "string",
  "thumbnailImage": "https://drh1.img.digitalriver.com/DRHM/Storefront/Company/demosft1/images/category/thumbnail/shop_by_category.gif",
  "products": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/6912100/products"
  },
  "categories": {
    "category": [
      {
        "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/6912300",
        "relation": "https://developers.digitalriver.com/v1/shoppers/CategoriesResource",
        "displayName": "Fitness",
        "products": {
          "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/6912300/products"
        }
      }
    ]
  }
}Getting all categories for a specific product
The GET /v1/shoppers/me/products/{productId}/categories request retrieves all categories and subcategories for a specific product. See Categories query parameters for a description of the query parameters. 
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/products/{productId}/categories' \
--header 'authorization: bearer ***\
...{
  "uri": "https://api.digitalriver.com/v1/shoppers/me/categories",
  "category": [
    {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/6912100",
      "displayName": "Shop by Category",
      "products": {
        "uri": "https://api.digitalriver.com/v1/shoppers/me/categories/6912100/products"
      }
    }
  ]
}Last updated
Was this helpful?