Itemset Expression

Use this API to retrieve itemset metadata in expression format

📘

POST/api/v1/itemset/expression

Note: This API allows you to retrieve details only for successfully built item sets. Also, be aware that metadata may take 3-5 minutes (or longer for larger item sets) to become available.


Request Parameters

ParameterNotesTypeRequiredPossible Values
advertiserId ID of the advertiserintegerYUnique numeric identifier
Filter[itemsetId]ID of the itemset for which details are to be retrieved. It accepts only single value for IDintegerYUnique itemset

Sample Request

curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/itemsets/expression' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************' \ --header 'WM_SEC.KEY_VERSION: 1' \  --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff' \ --header 'WM_CONSUMER.intimestamp: 1565309779' --data '{ "advertiserId": 1, "Filter[itemsetId]": 13240239
}' 

Response

ElementDescriptionType
codePossible values of response code:
  • success
  • failure
string
itemsetIdID of the item setinteger
expressionThis is a JSON object with following parameters:
  • type
    Values: ITEMSET, BRAND, CATEGORY
    • ITEMSET: Child itemset that was created using the list of items provided to create the itemset
    • BRAND: Brands provided to create the itemset
    • CATEGORY: Categories/Taxonomies provided to create the itemset
  • value : the value can contain different elements depending on the value of "type”
    • If type = ITEMSET, the relevant element is "id," which serves as the identifier for the child itemset. Use POST /api/v1/itemset/info to fetch the list of items within this child itemset
    • if type = BRAND, the relevant element in value is "name," that refers to the brand’s name to be included in the itemset
    • if type = category, the relevant element in value are: "name", "level" and "attribute”

    • value has following elements:
      • name: taxonomy name
      • level: level of the taxonomy in its hierarchy. Values: 1 to 3
      • id: ID to the expression
      • attributes: items of selected attributes are included in the itemsets. It has following elements:
        • type
        • values

Sample Response 1: (Only Brands)

{ "code": "success", "itemsetId": 13240239, "expression": { "or": [ { "type": "BRAND", "value": { "name": "pepsi" } }, { "type": "BRAND", "value": { "name": "red bull" } } ] }
} 

Sample Response 2: (Only Categories)

{ "code": "success", "itemsetId": 13240239, "expression": { "or": [ { "type": "CATEGORY", "value": { "name": "baby food", "level": 1 } }, { "type": "CATEGORY", "value": { "name": "Quilting Basting Guns", "level": 1 } } ] }
} 

Sample Response 3: (Hybrid)

For type = ITEMSET, use the POST /api/v1/itemset/info endpoint to retrieve the list of items in the child itemset

{ "code": "success", "itemsetId": 13240239, "expression": { "or": [ { "type": "ITEMSET", "value": { "id": 12345679 } }, { "type": "BRAND", "value": { "name": "pepsi" } }, { "type": "CATEGORY", "value": { "name": "baby food", "level": 1, "attributes": [ { "type": "age-group", "values": [ "Infant", "toddler" ] }, { "type": "skin_type", "values": [ "all", "sensitive" ] } ] } } ] } }