Analytics & Reports
Analytics
StoreFront

Public Retrieval APIs

Retrieval Body

The security section describes how to generate a securedPayload that needs to be passed in with each request.

Popular SKUs Endpoint – Without Passing in SKUs

The popular SKUs endpoint returns the top 1000 SKUs a user has purchased. It also returns the last purchased timestamp (newest createdOn timestamp from the user’s orders) and total number of SKUs purchased.

Sample Request
curl -X POST \
        --H 'Content-Type: application/json' \
        --data '{securedPayload:{}}'
        "https://--customerId--.groupbycloud.com/orders/v1/public/skus/popular"
Sample Response
{
  "result": [
    {
      "sku": "1958205",
      "quantity": 3,
      "lastPurchased": 148322880000
    }
  ],
  "status": {
    "code": 200,
    "internalCode": 0,
    "message": "OK",
    "additionalInfo": null,
    "serverTimestamp": 1519150893000
  }
}

Popular SKUs Endpoint – With SKUs

You can also call the popular SKUs endpoint with an array of SKUs. This will filter the result set by the list of SKUs you returned. This can be used anywhere you want to check whether a user has purchased products in a small subset. For example:

  • Display the # of times/last purchase date on a Product Detail Page (pass in 1 SKU, display the results)
  • Highlight products in a carousel that were previously purchased by a user (pass in all IDs from the carousel, add a badge on the products that have been previously purchased)
  • Show users a carousel of products previously purchased that are on clearance (pass in all IDs for products on clearance, and then show a carousel of only the results)
Sample Request
curl -X POST \
        --H 'Content-Type: application/json' \
        --data '{"securedPayload":{}, "skus":["1958205"]}'
        "https://--customerId--.groupbycloud.com/orders/v1/public/skus/popular"
Sample Response
{
  "result": [
    {
      "sku": "1958205",
      "quantity": 3,
      "lastPurchased": 148322880000
    }
  ],
  "status": {
    "code": 200,
    "internalCode": 0,
    "message": "OK",
    "additionalInfo": null,
    "serverTimestamp": 1519150893000
  }
}

Title Search Endpoint

The title search endpoint returns all products in past purchase that contain the search term within the title (if one is sent during upload, it is not mandatory). This is a simplified search which includes stemming but does not apply the rules set up for search in Command Center.

Since this does not apply search rules, if you are performing a normal search and want to modify the results based on past purchase data, it is recommended that you filter the past purchase data by the search or SAYT results that return using the popular SKUs API. Title search should only be used in an isolated context, such as when there is a search bar in the user’s order history page.

Sample Request
curl -X POST \
        --H 'Content-Type: application/json' \
        --data '{"securedPayload":{}, "query":"nail polish"}'
        "https://--customerId--.groupbycloud.com/orders/v1/public/skus/_search"
Sample Response
{
  "result": [
    {
      "sku": "1958205",
      "quantity": 3,
      "lastPurchased": 148322880000
    }
  ],
  "status": {
    "code": 200,
    "internalCode": 0,
    "message": "OK",
    "additionalInfo": null,
    "serverTimestamp": 1519150893000
  }
}