Related Documents
Document Properties
KbidP25172
Last Modified05-Jul-2019
Added to KB20-Sep-2013
Public AccessEveryone
StatusOnline
Doc TypeReferences
Product
  • ICM 7.6
  • ICM 7.7
  • ICM 7.8
  • ICM 7.9
  • ICM 7.10

REST API - Get productlist by global search



Note

Starting with 7.10 our REST API is documented using Swagger notation accessible at developer.cloud.intershop.com.

URI

/products

Http Method

GET

Short Description

Get list of items by global product search

Query Parameters

Optional parameters:

  • attrs=<comma separated list of parameters>: configure the attributes to be listed. Example: attrs=salePrice,listPrice
  • amount
  • offset
  • sortKey=<{name-asc, name-desc, value-asc, value-desc}>
  • pageable
  • searchTerm=<searchterm with wildcards>
  • returnSortKeys=<{true,false}>
    if [amount] > [number of found items] then following parameters will be returned:
  • total ~ total number of found items
  • amount
  • offset
  • pageable ~ the ID of the respective pageable
  • view

For sortKey=true the possible assignments for sortKey are being returned. When changing the sortKey value a new pageable is required.

The query parameter attrs can contain the following attribute names separated by comma:

  • productName – name of the product
  • listPrice – pricing information
  • salePrice – pricing information
  • image – URL to a product thumbnail image
  • sku – product id
  • averageRating – average user evaluation score
  • roundedAverageRating – rating
  • availability – product status
  • manufacturer
  • shortDescription – a minimal item description

e.g., ?attrs=shortDescription,sku,image

The query parameter 'view' defines the ID of the selected view.
The views are defined in a WebshopREST.properties file. The file should exist on domain level. For the PrimeTechSpecials Webshop:

E.g., we would need it in <IS_HOME>/share/system/config/domains/PrimeTech-PrimeTechSpecials-Site.

Some example entry with the ID myview:

Webshop.REST.productlinks.view.myview=salePrice,Height,longDesc

The default view can be adjusted by using the suffix "default":

Webshop.REST.productlinks.view.default=salePrice,Height,longDesc

The default view is used if there is no query parameter view or if the query parameter view is set to default "?view=default"

The parameter view and the parameter attrs can be combined. 

Example Requests

/products?amount=5&offset=10&attrs=salePrice,sku&sortKey=value-asc&searchTerm=foob*&pageable=4asd42sddgjzrtjgf-56512gb

HTTP Status Codes

200 OK
400 Bad Request

Description

The request retrieves a list of products applicable to the given query parameters.

Cartridge

app_sf_rest

Application

B2C Web Shop, SMB Web Shop

Product Version

7.4

Product To Version


Status

final

JSON

Request Data Format

Request related java object

n/a

Request Example

n/a

Response Data Format

application/json

Response related java object

com.intershop.sellside.rest.common.capi.resource.ProductListResource
com.intershop.component.rest.capi.resourceobject.ResourceCollectionRO
com.intershop.sellside.rest.b2c.capi.resourceobject.ProductLinkRO

Response Example

/products?attrs=salePrice,listPrice,roundedAverageRating,image

{
    "pageable": "0dkKDgBWXBMAAAFCBi8tvLdY",
    "total": 1784,
    "offset": 120,
    "amount": 1,
    "elements":
    [
        {
            "type": "Link",
            "description": "XPG Gaming Series V2.0, DDR3, 2000 MHz, CL9, 6GB (2GB x 3)",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/7415698",
            "title": "A-DATA XPG Gaming Series V2.0, DDR3, 2000 MHz, CL9, 6GB (2GB x 3)",
            "attributes":
            [
                {
                    "name": "roundedAverageRating",
                    "type": "String",
                    "value": "0.0"
                },
                {
                    "name": "listPrice",
                    "type": "ResourceAttribute",
                    "value":
                    {
                        "type": "Money",
                        "value": 150.51,
                        "currencyMnemonic": "USD"
                    }
                },
                {
                    "name": "image",
                    "type": "String",
                    "value": "/INTERSHOP/static/WFS/PrimeTech-PrimeTechSpecials-Site/-/PrimeTech/en_US/M/7415698-3934.jpg"
                },
                {
                    "name": "salePrice",
                    "type": "ResourceAttribute",
                    "value":
                    {
                        "type": "Money",
                        "value": 150.51,
                        "currencyMnemonic": "USD"
                    }
                }
            ]
        }
    ],
    "type": "ResourceCollection",
    "name": "products"
}

/products?amount=2&offset=5

{
    "pageable": "scsKDgBWJjMAAAFCu1UtvLPm",
    "total": 1784,
    "offset": 5,
    "amount": 2,
    "elements":
    [
        {
            "type": "Link",
            "description": "S599 128GB Notebook Package SSD, 6.35 cm (2.5 ") SATA II, 1500G, 68g, Black",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/6830681",
            "title": "A-DATA 128GB S599"
        },
        {
            "type": "Link",
            "description": "16GB C003, USB 2,0, 10g, Red",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/5079721",
            "title": "A-DATA 16GB C003"
        }
    ],
    "type": "ResourceCollection",
    "name": "products"
}

XML

XML Request Data Format

XML Request Java Objects

n/a

XML Request Example

n/a

XML Response Data Format

text/xml

XML Response Java Objects

com.intershop.sellside.rest.common.capi.resource.ProductListResource
com.intershop.component.rest.capi.resourceobject.ResourceCollectionRO
com.intershop.sellside.rest.b2c.capi.resourceobject.ProductLinkRO

XML Response Example

/products?attrs=salePrice,listPrice,roundedAverageRating,image

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResourceCollection name="products" type="ResourceCollection">
  <amount>1</amount>
  <elements>
    <Link type="Link">
      <attributes>
        <ResourceAttribute name="roundedAverageRating" type="String">
          <value>0.0</value>
        </ResourceAttribute>
        <ResourceAttribute name="listPrice" type="ResourceAttribute">
          <value type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>150.51</value>
          </value>
        </ResourceAttribute>
        <ResourceAttribute name="image" type="String">
          <value>/INTERSHOP/static/WFS/PrimeTech-PrimeTechSpecials-Site/-/PrimeTech/en_US/M/7415698-3934.jpg</value>
        </ResourceAttribute>
        <ResourceAttribute name="salePrice" type="ResourceAttribute">
          <value type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>150.51</value>
          </value>
        </ResourceAttribute>
      </attributes>
      <description>XPG Gaming Series V2.0, DDR3, 2000 MHz, CL9, 6GB (2GB x 3)</description>
      <title>A-DATA XPG Gaming Series V2.0, DDR3, 2000 MHz, CL9, 6GB (2GB x 3)</title>
      <uri>PrimeTech-PrimeTechSpecials-Site/-/products/7415698</uri>
    </Link>
  </elements>
  <offset>120</offset>
  <pageable>IpYKDgBWlQYAAAFCVA8tvLdc</pageable>
  <total>1784</total>
</ResourceCollection>

/products?amount=2&offset=5 (show 2 entries beginning from the 6th)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResourceCollection name="products" type="ResourceCollection">
  <amount>2</amount>
  <elements>
    <Link type="Link">
      <description>S599 128GB Notebook Package SSD, 6.35 cm (2.5 &quot;) SATA II, 1500G, 68g, Black</description>
      <title>A-DATA 128GB S599</title>
      <uri>PrimeTech-PrimeTechSpecials-Site/-/products/6830681</uri>
    </Link>
    <Link type="Link">
      <description>16GB C003, USB 2,0, 10g, Red</description>
      <title>A-DATA 16GB C003</title>
      <uri>PrimeTech-PrimeTechSpecials-Site/-/products/5079721</uri>
    </Link>
  </elements>
  <offset>5</offset>
  <pageable>UZMKDgBWm9IAAAFC2HItvLPl</pageable>
  <total>1784</total>
</ResourceCollection>

Reference - WebShop REST APIs

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Tickets