Availability filters

Availability filters enable filtering recommendation by user attributes.

Recommendation request might include additional user attributes such as:

{
  ...
  "location": {
    "country": "CA",
    "state": "QC"
  },
  "traits": {
  	"currency": "CAD",
    "language": "en",
    "license": "CA",
    "ageVerified": false
  },
  "skinId": "98761234",
  ...
}

To filter recommendation response by user attributes it is required to include availability filters in the provided game inventory. Please check gaming inventory schema inventory schema as reference.

Recommendation request user attributes mapping:

User attributePayload field
countrylocation.country
statelocation.state
currencytraits.currency
languagetraits.language
licensetraits.license
age_verifiedtraits.ageVerified
skin_idskinId

Example

Gaming inventory includes two games:

{
 "123456": {
  "game_code": "123456",
  "game_name": "Adventure Quest",
  "skin_id": ["21", "23"],
  "inclusions": {"country": "CA", "state": ["QC", "ON"]},
  "exclusions": {"language": "fr"},
  ...
 },
 "654321": {
  "game_code": "654321",
  "game_name": "King Slots",
  "skin_id": ["21"],
  "inclusions": {"country": ["CA", "US"]},
  "exclusions": {"language": "fr"},
  ...
 }
}

Recommendation request looks as follows:

{
  "userId": "156784322",
  "type": "recommendation",
  "context": {
    "channel": "Desktop",
  },
  "skinId": "21",
  "location": {
    "country": "CA",
    "state": "BC"
  },
  "traits": {
    "language": "en"
  },
  "recommendation": {
    "target": {
      "getDetails": true
    }
  }
}

User attributes attached to the request skinId, country and language match both games but only second game is returned because first game is limited to states "QC" and "ON" while request contain state "BC".

If languagewould be set to "fr" then both games would be excluded from the response.