REST API - Recommendation basket request


Note

Starting with 7.10 our REST API is documented using Redoc accessible at docs.intershop.com.

URI

/recommendationcontexts/<context-id>/basketrecommendations?basketID=<basket-id>

Http Method

GET

Short Description

Get recommended products for the basket with the given basket ID

Query Parameters

Mandatory: basketID

Example Requests

/recommendationcontexts/13157ff6-e645-49a6-ba46-7787563d7214/basketrecommendations?basketID=PRoKDgAbk0QAAAFH8i1b1P29

HTTP Status Codes

200 OK
400 Bad Request (when missing query parameter basketID)
404 Not found (if basket with given ID not found)

Description

If a recommendation service is configured, this call returns a list of recommended products for the given basket. The resulting list strongly depends on the configuration of the recommendation engine and on the back office preferences in "Channel preferences / Recommendation Engines". If the request type BasketRecommendationRequest is not activated then an empty list is returned.

The used <contextid> can be any alpha-numeric string. It will be used to distinguish between different users/customers.

Cartridge

app_sf_rest_recomm
Application

B2C Web Shop, SMB Web Shop

Product Version

 7.5

Product To Version

 

Status

final

JSON

Request data format

application/json

Request related java object

com.intershop.component.recommendation.capi.rest.resource.BasketRequestRecommendationsListResource

Request data example

no request data

Response data format

application/json

Response related java object

com.intershop.component.recommendation.capi.rest.resource.BasketRequestRecommendationsListResource
com.intershop.component.rest.capi.resourceobject.LinkRO

Response data example

{
    "total": 7,
    "elements": [
        {
            "type": "Link",
            "title": "3957286",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/3957286"
        },
        {
            "type": "Link",
            "title": "3957288",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/3957288"
        },
        {
            "type": "Link",
            "title": "M7972533",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/M7972533"
        },
        {
            "type": "Link",
            "title": "4555724",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/4555724"
        },
        {
            "type": "Link",
            "title": "3852840",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/3852840"
        },
        {
            "type": "Link",
            "title": "6830681",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/6830681"
        },
        {
            "type": "Link",
            "title": "5079807",
            "uri": "PrimeTech-PrimeTechSpecials-Site/-/products/5079807"
        }
    ],
    "type": "ResourceCollection",
    "name": "recommendedProducts"
}

XML

Request data format

text/xml

Request related java object

com.intershop.component.recommendation.capi.rest.resource.BasketRequestRecommendationsListResource

Request data example

no request data

Response data format

text/xml

Response related java object

com.intershop.component.recommendation.capi.rest.resource.BasketRequestRecommendationsListResource
com.intershop.component.rest.capi.resourceobject.LinkRO

Response data example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResourceCollection name="recommendedProducts" type="ResourceCollection">
    <elements>
        <Link type="Link">
            <title>3957286</title>
            <uri>PrimeTech-PrimeTechSpecials-Site/-/products/3957286</uri>
        </Link>
        <Link type="Link">
            <title>3957288</title>
            <uri>PrimeTech-PrimeTechSpecials-Site/-/products/3957288</uri>
        </Link>
        <Link type="Link">
            <title>M7972533</title>
            <uri>PrimeTech-PrimeTechSpecials-Site/-/products/M7972533</uri>
        </Link>
        <Link type="Link">
            <title>4555724</title>
            <uri>PrimeTech-PrimeTechSpecials-Site/-/products/4555724</uri>
        </Link>
        <Link type="Link">
            <title>3852840</title>
            <uri>PrimeTech-PrimeTechSpecials-Site/-/products/3852840</uri>
        </Link>
        <Link type="Link">
            <title>6830681</title>
            <uri>PrimeTech-PrimeTechSpecials-Site/-/products/6830681</uri>
        </Link>
        <Link type="Link">
            <title>5079807</title>
            <uri>PrimeTech-PrimeTechSpecials-Site/-/products/5079807</uri>
        </Link>
    </elements>
    <total>7</total>
</ResourceCollection>

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