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/itemset/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

ElementDescriptionOptional field/Nullable?TypePossible Values
codeThe response code can have following values:
  • success
  • failure

Click here for more information about Status Codes and Errors
Ystringsuccess, failure
detailsDetails will populate success or error message depending upon value of code.Narray of strings
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
messageHigh-level summary of the error, when available. Ystring 
errorsDetailed information about one or more errors, including the affected field (when applicable), error code, and a human-readable description.Yarray<object> 

errors array object details

FieldDescriptionOptional field/Nullable?TypePossible values
fieldJSON field associated with the error. Omitted if the error applies to the request as a whole.Ystring 
errorTypeMachine-readable error code that uniquely identifies the error condition. Applications should use this value for error handling logic.Nstring 
descriptionHuman-readable explanation of the error, including why the request failed and, when possible, how to resolve itNstring 

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" ] } ] } } ] } }

Sample Response Failure

{
    "code": "failure",
    "details": [
        "string"
    ], "message": "string",
  "errors": [ { "field": "string", "errorType": "string", "description": "string" } ]
}

Did this page help you?