Skip to main content
RichRelevance

Purchase Page

POST /runtime/v1/recommend/purchasePage/

Get recommendations for the purchase page.

Request:

Body

Media type: application/json
Type: object

Properties
Property Required (type) Description

rrContext
 

  • apiClientKey
  • apiKey
  • sessionId
  • user
    • userid
    • userAttributes 
      Items:
      UserAttribute
      • attributeName
      • attributeValue
    • segments
  • userAgent

required (object)
 

  • required (string)
  • required (string)
  • (string)
  • (object)
    • (string)
    • (array of UserAttributes)
       
      • required (string)
      • (array of )
    • (array of string)   
  • required (string)

The context that can be provided to Rich Relevance to best serve a request.

  • The api client assigned for the client specific application.
  • The api key of the merchant
  • The session id assigned to the request by the merchant.
  • All the user specific information that can be provided for the request

    • The merchant defined identifier for the user

    • The attributes of the user that merchant can provide

      • The name of the user attribute
      • The value of the user attribute
    • All the segments a user might belong to
  • The user agent string making the request
ipAddress (string) The public ip address of the originating request.

localizationContext

  • region
     
  • language
     
  • currency

(object)

  • (string)
     
  • (string)
     
  • (string)

The localization context of the request.

  • The merchant defined region from which the request originated. It must match the regions provided in the feed by the merchant.
  • The merchant defined language code of the request. It must match the language codes in the feed provided by the merchant.
  • The currency code for the request. It mush match the currency codes in the feed provided by the merchant.
placements (array of string) The list of the all the placements for which the recommendations were requested.
channelId (string) The channel of the request.
rrUserGuid (string) The user id assigned to the request by Rich Relevance.
mvtId (number) Id to recognize the MVT split. Required to run MVT tests.
treatmentId (number) The id to force an MVT treatment.

purchaseOrders
Items: PurchaseOrder

  • orderId
  • productLineItems
    Items: ProductLineItem
    • productId
    • quantity
    • priceCents
    • sku
  • orderChannel
  • emailHash
  • cardHash
  • storeId

required (array of PurchaseOrder)

  • (string)
  • required (array of ProductLineItem)
     
    • required (string)
    • required (integer)
    • required (integer)
    • (string)
  • (string)
  • (string)
  • (string)
  • (string)

The information about the products purchased.
 

  • The purchase order number
  • The product(s) purchased in the order.

     
    • The product that was purchased.
    • The number of units that were purchased.
    • The price of the product that was purchased.
    • The identifier of the SKU that was purchased if any
  • The retail channel through which the product was purchased
  • The hash of the email address of the user
  • The hash of the credit card used for purchase.
  • The store in which the purchase was made.
Example:
{
  "rrContext": {
    "apiKey": "649d16cbc8097816",
    "apiClientKey": "026658c7e431cdb5",
    "sessionId": "session1",
    "user": {
      "userId": "user123",
      "userAttributes": [
        {
          "attributeName": "hairColor"
        },
        {
          "attributeName": "age",
          "attributeValue": [
            "30"
          ]
        }
      ],
      "segments": [
        "under 30",
        "books"
      ]
    },
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1944.0 Safari/537.36",
    "ipAddress": "64.125.118.246",
    "localizationContext": {
      "region": "r1",
      "language": "en-US",
      "currency": "$"
    },
    "placements": [
      "purchase_page.rr1",
      "purchase_page.horizontal"
    ],
    "channelId": "online",
    "rrUserGuid": "2694fbdf-c756-4a79-b7bf-a6560ac2ebd5",
    "mvtId": 123,
    "treatmentId": 125
  },
  "purchaseOrders": [
    {
      "orderId": "order123",
      "productLineItems": [
        {
          "productId": "product345",
          "quantity": 2,
          "priceCents": 200,
          "sku": "sku3451"
        }
      ],
      "orderChannel": "store",
      "storeId": "sf94107",
      "emailHash": "d927ad81199aa7dcadfdb4e47b6dc694",
      "cardHash": "d927ad81199aa7dcadfdb4e47b6dc694"
    }
  ]
}

Response:

HTTP status code 200

Body

Media type: application/json
Type: object

Properties
Properties Required (type) Description
requestId required (string) A unique request id assgined for each request by Rich Relevance.
viewGuid required (string) The view context id assigned by Rich Relevance.

mvt
Items: MVTTreatment

  • testId
  • treatmentId: 
  • treatmentName
  • control

(array of MVTTreatment)
 

  •  required (number)
  • required (string)
  • required (string)
  • required (boolean)

The MVT specific information for the request.
 

  • The test identifier for MVT.
  • The treatment identifier for MVT.
  • The name of the treatment.
  • Was the MVT part of the control.
rrUserGuid required (string) The user id assigned to the request by Rich Relevance

responsePlacements
Items: ResponsePlacement

  • placementName
  • strategyMessage
     
  • strategyName
     
  • recommendedProducts
    Items: RecommendedProduct
    • productId
    • productName
    • productURL
    • imageURL
    • price
    • priceRange
      • minSalesPrice
      • maxSalesPrice
  • brand
  • categories

    Items: ProductCategories

    • categoryId
    • categoryName
  • productAttributes: ProductAttributes
    • attributeName
    • attributeValue
  • ratings
  • reviews
  • clickTrackingURL


unFulfilledPlacements
Items: UnFulfilledPlacement

  • placementName
     
  • reason

 

required (array of ResponsePlacement)

  • required (string)
  • required (string)
     
  • required (string)
     
  • required (array of RecommendedProduct)
    • required (string)
    • required (string)
    • required (string)
    • required (string)
    • required (integer)
    • required (object)
      • required (integer)
      • required (integer)
  • required (string)
  • required (string)

     
    • required (string)
    • required (string)
  • ​​​​​​required (array of ProductAttributes)
    • ​​​​​​​required (string)
    • required (array of )
  •  required (number)
  • required (integer)
  • required (string)


​​​​​​​required (array of UnFulfilledPlacement)

  • required (string)
     
  • required (string)

The recommendations for each placement fulfilled by the service for the request.

  • The placement name for which the recommendation are returned.
  • The message attached to the strategy whose recommendations are being returned.
  • The name of the strategy whose recommendations are being returned.
  • The most relevant information of the products that are being recommended for the placement.
    • The unique identifier of the product being recommended.
    • The name of the product being recommended.
    • The link on the merchant's website for the product.
    • The location to the image of the product.
    • The price of the product in cents.
       
      • The minimum sales price of the product in cents.
      • The maximum sales price of the product in cents.
    • The brand of the product.
    • The categories to which a product belongs.

      ​​​​​​​
    • The identifier for a merchant's category.
    • The name of the category.
  • All the product attributes.
    ​​​​​​​
    • The name of the product attribute.
    • The value associated with the attribute name.
  • The ratings that the product has received.
  • The number of reviews that the product has received.
  • The URL to track a click on the product by a Rich Relevance service.

The placements for which the recommendations are not being generated.

  • The name of the placement for which the recommendations are not returned
  • The reason why the recommendations were not returned for the placement.
Example:
{
  "requestId": "request123",
  "rrUserGuid": "2694fbdf-c756-4a79-b7bf-a6560ac2ebd5",
  "viewGuid": "792b640b-8b56-4e8b-5249-0856340e99ce",
  "mvt": [
    {
      "testId": 12343545,
      "treatmentId": 123435454,
      "treatmentName": "TestTreatment",
      "control": true
    }
  ],
  "responsePlacements": [
    {
      "placementName": "purchase_page.rr1",
      "strategyMessage": "People who viewed this also bought.",
      "strategyName": "PurchaseCP",
      "recommendedProducts": [
        {
          "productId": "product123",
          "productName": "Product Name",
          "productURL": "http://www.merchant.com/en/ip/productName/6000138847418",
          "imageURL": "images/Thumbnails/806/396/806396.jpg",
          "price": 798,
          "priceRange": {
            "minSalesPrice": 798,
            "maxSalesPrice": 798
          },
          "brand": "brandName",
          "categories": [
            {
              "categoryId": "cat1",
              "categoryName": "category1"
            },
            {
              "categoryId": "cat2",
              "categoryName": "category2"
            }
          ],
          "productAttributes": [
            {
              "attributeName": "attribute1",
              "attributeValues": [
                "attrValue1, attrValue2"
              ]
            },
            {
              "attributeName": "attribute2",
              "attributeValues": [
                "attrValue3",
                "attrValue4"
              ]
            }
          ],
          "ratings": 3.5,
          "reviews": 100,
          "clickTrackingURL": "http://api.richrelevance.com/rrserver/apiclick?apiKey=649d16cbc8097816apiClientKey=026658c7e431cdb5&viewGuid=80014ed0-8f22-4f5b-8455-7f550aeba753&strategyId=8&placement=item_page.rr1&position=1&productId=product123&channelId=channel1&sessionId=session1&userId=user123"
        }
      ]
    }
  ],
  "unFulfilledPlacements": [
    {
      "placementName": "purchase_page.horizontal",
      "reason": "The requested placement does not exists."
    }
  ]
}

HTTP status code 400

Body

Media type: application/json
Type: object

Properties

  • code: required (integer)
  • details: required (string)
  • message: required (string)
  • status: required (string)

HTTP status code 500

Body

Media type: application/json
Type: object

Properties

  • code: required (integer)
  • details: required (string)
  • message: required (string)
  • status: required (string)
  • Was this article helpful?