GetBrands

Definition

Use this call to retrieve all product brands in the system.

Request URI: https://api.sellercenter.lazada.sg?Action=GetBrands

Parameters

FieldTypeDescription
ActionstringGetBrands
Name of the API that is to be called. Mandatory.
FormatstringThe response format, with XML as the default. Can be XML or JSON. Optional.
TimestampdatetimeThe current time in ISO8601 format (e.g., Timestamp=2016-04-01T10:00:00+02:00 for Berlin). Mandatory.
UserIDstringThe ID of the user making the call. Mandatory.
VersionstringThe API version against which this call is to be executed. The current version is "1.0". Mandatory.
SignaturestringThe cryptographic signature, authenticating the request. You must create this value by computing the SHA256 hash of the request, using the API key of the user specified in the UserID parameter. Mandatory.
LimitintegerThe maximum number of brands that can be returned. If you omit this parameter, the default of 100 is used. The Maximum is 1,000.
OffsetintegerNumber of brands to skip (i.e., an offset into the result set; together with the Limit parameter, simple result set paging is possible; if you do page through results, note that the list of brands might change during paging).

Code sample

# GetBrands cURL example
# to run, update Timestamp and recompute Signature
#
url = "https://api.sg.ali-lazada.com/"
get
data-urlencode Action=GetBrands
data-urlencode Timestamp=2015-07-01T11:11+0000
data-urlencode [email protected]
data-urlencode Version=1.0
data-urlencode Limit=100
data-urlencode Offset=0
data-urlencode Signature=01286525c2fdba58296a61ed1f5e559d0e25972c288d2464b6c25fccc6be729a
//init request with offset(0) and limit(1000)
GetBrands getBrands = new GetBrands(0, 1000);
try {
  GetBrandsResponse response = getBrands.execute();
  for(Brand brand: response.getBody()) {
    System.out.println(brand);
  }
} catch (LazadaException e) {
  System.out.println(e.getResponseStr());
}

Response

NameTypeDescription
BrandIdintegerIdentifier of this brand as assigned by the Seller Center.
NamestringThe actual name of the brand.
GlobalIdentifierstringA unique string identifier for the brand across different systems. For example: ADIDAS, NIKE, APPLE.

Result sample

A success result sample is as follows.

<?xml version="1.0" encoding="UTF-8"?>
<SuccessResponse>
  <Head>
    <RequestId/>
    <RequestAction>GetBrands</RequestAction>
    <ResponseType>Brands</ResponseType>
    <Timestamp>2015-07-01T11:11:11+0000</Timestamp>
  </Head>
  <Body>
    <Brands>
      <Brand>
        <BrandId>1</BrandId>
        <Name>Commodore</Name>
        <GlobalIdentifier>commodore</GlobalIdentifier>
      </Brand>
      <Brand>
        <BrandId>2</BrandId>
        <Name>Atari</Name>
        <GlobalIdentifier/>
      </Brand>
    </Brands>
  </Body>
</SuccessResponse>
{
  "SuccessResponse": {
    "Head": {
      "RequestAction": "GetBrands",
      "ResponseType": "Brands",
      "Timestamp": "2015-07-01T11:11:11+0000"
    },
    "Body": {
      "Brands": [
          {
            "BrandId": "1",
            "Name": "Commodore",
            "GlobalIdentifier": "commodore"
          },
          {
            "BrandId": "2",
            "Name": "Atari"
          }
        ]
      }
    }
  }

Error messages

No specific errors.