List Brands

Retrieve the list of advertiser's brands

📘

POST /api/v1/brands/list

Request Parameters

ParametersNotesTypeRequiredPossible Values
advertiserIdID of advertiserintegerYUnique numeric identifier
isRestricted

specifies whether to retrieve from list of advertiser's brands or all brands

Note:

  • Default value of isRestricted is true
  • filter[brandName] is mandatory if isRestricted = false

BooleanNValues:
  • true
  • false
filter[brandName]

Specify the name of the brand to search for

Note:

  • Required if isRestricted = false
  • Supports 'exact' match

stringNValid brand name for items to be retrieved
startIndex

Use this parameter to fetch specific number of brands from a list, in combination with count.

This indicates the starting position of the list

Note: Value of startIndex must be greater than and equal to 0. The default value is 0

integerN

Integer value

Example: To return the first ten catalog item brands, set startIndex=0 and count=10

count

Defines the total number of items to be returned.
You can use this parameter in combination with startIndex, to fetch specific number of item brands from a list.

Note: Value of count must be greater than 0. The default value is 100

integerN

Integer value

Example: To return the first ten catalog item brands, set startIndex=0 and count=1

Note: The error message TOO_MANY_FILTERS_PROVIDED_IN_REQUEST is returned when too many filters are used and the request is not processed.

Sample Request

curl --request POST 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/brands/list' \
--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: ************' \
--header 'WM_CONSUMER.intimestamp: 1565309779' \
--data '{ "advertiserId": 1, "isRestricted": true, "filter[brandName]": ["Brand Name"], "startIndex": 0, "count": 5 }'

Sample Request - When isRestricted is false but filter[brandName] is omitted from Request

curl --request POST 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/brands/list' \
--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: ************' \
--header 'WM_CONSUMER.intimestamp: 1565309779' \
--data '{ "advertiserId": 16274575, "startIndex": 0, "count": 100, "isRestricted": false }'

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
totalResultsTotal number of rows returned in the response
Only returned when code=success
integer
datadata will populate details of brands retrieved through request, if code is success
  • brandName: Brand name
  • itemCount: Count of items in the brand


Only returned when code=success
array
detailsList of error codes associated with the request. Use these codes for programmatic error handling.Narray<string>Refer to this link for detailed error messages
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 Success

{ "code": "success", "totalResults": 1, "data": [ { "brandName": " Brand Name", "itemCount": 891 } ]
}

Sample Response Failure - When isRestricted is false but filter[brandName] is omitted from Request

{ "code": "failure", "message": "Invalid brand list request. One or more fields are invalid.", "errors": [ { "field": "filter[brandName]", "errorType": "FILTER_NAME_IS_REQUIRED_WHEN_IS_RESTRICTED_IS_FALSE", "description": "filter[brandName] field is required when isRestricted field is false. Provide filter[brandName] when isRestricted is false." } ], "details": [ "FILTER_NAME_IS_REQUIRED_WHEN_IS_RESTRICTED_IS_FALSE" ]
}

Did this page help you?