GetProducts

Definition

Use this call to get all or a range of products.

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

Parameters

FieldTypeDescription
ActionstringGetProducts
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.
CreatedAfterdatetimeLimits the returned products to those created after or on the specified date, given in ISO 8601 date format. Optional
CreatedBeforedatetimeLimits the returned products to those created before or on the specified date, given in ISO 8601 date format. Optional
UpdatedAfterdatetimeLimits the returned products to those updated after or on the specified date, given in ISO 8601 date format. Optional
UpdatedBeforedatetimeLimits the returned product list to those updated before or on a specified date, given in ISO 8601 date format. Optional
SearchstringReturns the products with the search string contained in the product name and/or Seller SKU.
FilterstringReturns the products with the status matching this parameter. Possible values are all, live, inactive, deleted, image-missing, pending, rejected, sold-out. Mandatory
LimitintegerThe maximum number of products that can be returned. If no value is specified, use 20 as default. The maximum number of products returned by a single call is 500 (this is the default hard limit, which can be changed per instance). If you need to retrieve more products than that, you have to page through the result set using the Offset parameter.
OptionsintegerThis value can be used to get more stock information. e.g., Options=1 means contain ReservedStock, RtsStock, PendingStock, RealTimeStock, FulfillmentBySellable.
OffsetintegerNumber of products 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 products might change during paging).
SkuSellerListarray of stringsOnly products that have the Seller SKU in this list will be returned. Input should be a JSON array. For example, ["Apple 6S Gold", "Apple 6S Black"]. It only matches the whole words.

Code sample

# GetProducts cUrl example
url = "https://api.sg.ali-lazada.com/" 
get 
data-urlencode Action=GetProducts 
data-urlencode Timestamp=2015-07-01T11:11+0000 
data-urlencode [email protected] 
data-urlencode Version=1.0 
data-urlencode Signature=9ade00fb4b9ab9ed1b8a4d189f1a13e1029edc25dd963235480ec69226fd9f39
//init global client with API endpoints, userEmail, apikey
LazadaClient.init("https://api.sellercenter.lazada.com.my/",
                 "[email protected]",             "kGmfpknoWCyVn78k0O2X4L6t01xhrHGwTafLPIMqt8XogwC69au7xLbZ");

//construct request
//query without filter condition
GetProducts request = new GetProducts();
/*
query with one or more filter conditon(s)
ProductsFilter filter = new ProductsFilter();
filter.createdBefore(new Date(117, 0, 26, 0, 0));
filter.search("ASC Test");
GetProducts request = new GetProducts(filter);
*/
try {
  GetProductsResponse response = request.execute();
  List<Product> products = response.getBody();
} catch (LazadaException e) {
  e.printStackTrace();
}

Response

The returned results and their type and description are as follows.

NameTypeDescription
ProductssubsectionAn array contains at least one Product. Mandatory
PrimaryCategoryintegerThe ID of the primary category for his product. To
get the ID for all categories, call GetCategoryTree. Optional
SPUIdintegerThe ID of SPU. Optional
AttributessubsectionContains several product attributes. Mandatory
SkussubsectionAn array contains at least one SKU. Mandatory
TotalProductsintegerThe number of total products, it's product level.

The following table lists some example fields in 'Attributes'.

NameTypeDescription
namestringThe name of the product as shown to the customers. Mandatory. Must be between 2 to 255 characters.
short_descriptionstringThe description of the product, as shown to the customers (6 to 25000 characters). Embedding certain HTML tags is allowed, but must be escaped as character data (see below). Optional
brandstringThe brand name of the product. Optional
modelstringThe model name of the product. Optional
warrantystringThe warranty time for the product. Optional
warranty_typestringThe warranty type of the product. Optional
color_familystringColor family. Optional
...Other attributes defined in the PrimaryCategory.

The following table lists some example fields in 'Sku'. You can also get all the attributes by call GetCategoryAttributes.

NameTypeDescription
SellerSkustringA unique identifier for the product within the Seller Center instance that is to be added to the system. This identifier is usually freely assigned. Harmonized identifiers, such as UPC or EAN can be set via ProductId. Mandatory
ShopSkustringThe ID of SKU in Shop when product is synchronized to shop. Optional
StatusstringOne of the following values: 'active', 'inactive' or 'deleted'. Optional. The default value is 'active'.
UrlstringThe product URL on the web site. Optional
AvailableintegerAvailable stock. Mandatory
pricedecimalThe product price. Not really a Double, but a Decimal. Optional
quantityintegerThe current level of inventory for this product. Optional
ReservedStockintegerThe stock reserved for pending orders in Seller Center. Optional
RealTimeStockintegerThe stock reserved for pending orders in the Shop not imported in Seller Center yet. Optional
FulfillmentBySellableintegerThe sellable stock in the Venture warehouse. Optional
RtsStockintegerThe stock number of order products in Ready-To-Ship. Optional
PendingStockintegerThe stock number of order products in Pending. Optional
special_pricedecimalThe (hopefully reduced) price for the product while it is on sale. If SalePrice is specified, either SaleStartDate or SaleEndDate must be given; Vice versa, if at least one of SaleStartDate or SaleEndDate is specified, SalePrice is mandatory. Not really a Double, but a Decimal.
special_from_datedateDate when special price will become applicable
Note: To be used only if date is available.
special_from_timedatetimeDate and time when special price will become applicable. The date given under this tag should be the same as that in 'special_from_date'
Note: To be used if both date and time are available.
special_to_datedateDate till when special price is applicable.
Note: To be used only if date is available.
special_to_timedatetimeDate and time till when special price is applicable. The date given under this tag should be same as in 'special_to_date'
Note: To be used if both date and time are available.
package_lengthstringPackage length. Optional
package_heightstringPackage height. Optional
package_widthstringPackage width. Optional
package_weightstringPackage weight. Optional
package_contentstringPackage Content. Optional
ImagessubsectionContains at most 8 images URL. Optional
ImagestringThe image URL. Optional

You can set at most 8 images for one SKU. The first image will be used as MainImage.

Result sample

A success example is as follows.

<?xml version="1.0" encoding="UTF-8"?>
<SuccessResponse>
  <Head>
    <RequestId>
    </RequestId>
    <RequestAction>GetProducts</RequestAction>
    <ResponseType>Product</ResponseType>
    <Timestamp>2016-08-25T10:07:00+0000</Timestamp>
  </Head>
  <Body>
    <Products>
      <Product>
        <PrimaryCategory>3</PrimaryCategory>
        <SPUId/>
        <Attributes>
          <name>(Telco Set) Apple iPhone 6s Plus 16GB (Space Gray)</name>
          <description/>
          <short_description>&lt;div class="prod_content"&gt; &lt;div class="prod_details"&gt; &lt;ul class="prd-attributesList ui-listBulleted"&gt;&lt;li class=""&gt;&lt;b&gt;&lt;span&gt;5.5" Retina HD Display with 3D Touch&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;b&gt;&lt;span&gt;Fingerprint-resistant oleophobic coating&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;b&gt;&lt;span&gt;A9 chip with 64-bit architecture&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;b&gt;&lt;span&gt;Ultrafast 4G LTE Advanced wireless&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;b&gt;&lt;span&gt;New 12-megapixel iSight camera&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;b&gt;&lt;span&gt;4k video recording&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;b&gt;&lt;span&gt;iOS 9 with Touch ID and Apple Pay&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/div&gt; &lt;/div&gt;</short_description>
          <video/>
          <brand>Bean Rester</brand>
          <model>iPhone 6s Plus 16GB (Space Gray)</model>
          <phone_features/>
          <pixel_ppi/>
          <processor_type/>
          <display_size_mobile/>
          <screen_type/>
          <video_resolution/>
          <color_family/>
          <type_of_battery/>
          <operating_system_version/>
          <network_connections/>
          <ram_memory/>
          <camera_back/>
          <camera_front/>
          <condition>New</condition>
          <sim_slots/>
          <attribute test 4/>
          <ceshi/>
          <delivery_option_economy/>
          <warranty_type>Local (Singapore) manufacturer warranty</warranty_type>
          <warranty>11 Months</warranty>
          <delivery_option_standard/>
          <delivery_option_express/>
        </Attributes>
        <Skus>
          <Sku>
            <SellerSku>(Telco Set) Apple iPhone 6s Plus 16GB Space Gray</SellerSku>
            <ShopSku>BE494ELAA4WUACANID-9625124</ShopSku>
            <Url>http://alice.sg.alibaba.lzd.co/(Telco-Set)-Apple-iPhone-6s-Plus-16GB-(Space-Gray)-8250708.html</Url>
            <Status>inactive</Status>
            <Available>5</Available>
            <special_to_date>2018-05-01</special_to_date>
            <price>1288.0</price>
            <special_from_date>2016-05-13</special_from_date>
            <quantity>5</quantity>
            <special_price>1173.85</special_price>
            <operating_system>iOS</operating_system>
            <Images>
              <Image/>
              <Image>http://sg-live-01.slatic.net//p/telco-set-apple-iphone-6s-plus-16gb-space-gray-3191-1425247-d10a8dd02929aacc84b03be2317a7175-catalog.jpg</Image>
              <Image/>
              <Image/>
              <Image/>
              <Image/>
              <Image/>
              <Image/>
            </Images>
          </Sku>
        </Skus>
      </Product>
    </Products>
  </Body>
</SuccessResponse>
{
    "SuccessResponse": {
        "Head": {
            "RequestId": "",
            "RequestAction": "GetProducts",
            "ResponseType": "Product",
            "Timestamp": "2016-08-25T11:30:27+0000"
        },
        "Body": {
            "Products": [
                {
                    "PrimaryCategory": 3,
                    "Attributes": {
                        "name": "(Telco Set) Apple iPhone 6s Plus 16GB (Space Gray)",
                        "short_description": "<div class=\"prod_content\">\n            <div class=\"prod_details\">\n                <ul class=\"prd-attributesList ui-listBulleted\"><li class=\"\"><b><span>5.5\" Retina HD Display with 3D Touch&nbsp;</span></b></li><li class=\"\"><b><span>Fingerprint-resistant oleophobic coating&nbsp;</span></b></li><li class=\"\"><b><span>A9 chip with 64-bit architecture&nbsp;</span></b></li><li class=\"\"><b><span>Ultrafast 4G LTE Advanced wireless&nbsp;</span></b></li><li class=\"\"><b><span>New 12-megapixel iSight camera&nbsp;</span></b></li><li class=\"\"><b><span>4k video recording&nbsp;</span></b></li><li class=\"\"><b><span>iOS 9 with Touch ID and Apple Pay</span></b></li></ul>            </div>\n        </div>",
                        "brand": "Bean Rester",
                        "model": "iPhone 6s Plus 16GB (Space Gray)",
                        "condition": "New",
                        "warranty_type": "Local (Singapore) manufacturer warranty",
                        "warranty": "11 Months"
                    },
                    "Skus": [
                        {
                            "ShopSku": "BE494ELAA4WUACANID-9625124",
                            "Status": "inactive",
                            "Url": "http://alice.sg.alibaba.lzd.co/(Telco-Set)-Apple-iPhone-6s-Plus-16GB-(Space-Gray)-8250708.html",
                            "Available": 5,
                            "special_to_date": "2018-05-01",
                            "price": "1288.0",
                            "special_from_date": "2016-05-13",
                            "quantity": "5",
                            "SellerSku": "(Telco Set) Apple iPhone 6s Plus 16GB Space Gray",
                            "special_price": "1173.85",
                            "operating_system": "iOS",
                            "Images": [
                                "",
                                "http://sg-live-01.slatic.net//p/telco-set-apple-iphone-6s-plus-16gb-space-gray-3191-1425247-d10a8dd02929aacc84b03be2317a7175-catalog.jpg",
                                "",
                                "",
                                "",
                                "",
                                "",
                                ""
                            ]
                        }
                    ]
                },
                {
                    "PrimaryCategory": 3,
                    "ShopSku": "BE494ELAA4WUA2ANID-9625114",
                    "Status": "inactive",
                    "Url": "http://alice.sg.alibaba.lzd.co/(Telco-Set)-Apple-iPhone-6s-Plus-64GB-(Gold)---8250698.html",
                    "Available": 5,
                    "Attributes": {
                        "name": "(Telco Set) Apple iPhone 6s Plus 64GB (Gold)  ",
                        "short_description": "<div class=\"prod_content\">\n            <div class=\"prod_details\">\n                <ul class=\"prd-attributesList ui-listBulleted\"><li class=\"\"><b><span>5.5\" Retina HD Display with 3D Touch&nbsp;</span></b></li><li class=\"\"><b><span>Fingerprint-resistant oleophobic coating&nbsp;</span></b></li><li class=\"\"><b><span>A9 chip with 64-bit architecture&nbsp;</span></b></li><li class=\"\"><b><span>Ultrafast 4G LTE Advanced wireless&nbsp;</span></b></li><li class=\"\"><b><span>New 12-megapixel iSight camera&nbsp;</span></b></li><li class=\"\"><b><span>4k video recording&nbsp;</span></b></li><li class=\"\"><b><span>iOS 9 with Touch ID and Apple Pay</span></b></li></ul>            </div>\n        </div>",
                        "brand": "Bean Rester",
                        "model": "iPhone 6s Plus 64GB (Gold)  ",
                        "condition": "New",
                        "warranty_type": "Local (Singapore) manufacturer warranty",
                        "warranty": "11 Months"
                    },
                    "Skus": [
                        {
                            "special_to_date": "2018-05-01",
                            "price": "1558.0",
                            "special_from_date": "2016-05-13",
                            "quantity": "5",
                            "SellerSku": "(Telco Set) Apple iPhone 6s Plus 64GB Gold",
                            "special_price": "1287.95",
                            "operating_system": "iOS",
                            "Images": [
                                "",
                                "http://sg-live-01.slatic.net//p/telco-set-apple-iphone-6s-plus-64gb-gold-3654-5425247-cc1f1de5663d894bf8e19b95666f832d-catalog.jpg",
                                "",
                                "",
                                "",
                                "",
                                "",
                                ""
                            ]
                        }
                    ]
                }
            ]
        }
    }
}

Error messages

Error codeMessage
5E005: Invalid Request Format
6E006: Unexpected internal error
14E014: "%s" Invalid Offset
17E017: "%s" Invalid Date Format
19E019: "%s" Invalid Limit
36E036: Invalid status filter
70E070: You have corrupt data in your sku seller list.
506E506: Get product failed
901E901: The request is too frequent, or the requested functionality is temporarily disabled.

🚧

Note

The list of products may change while paging through it using multiple calls with a changing Offset parameter.