GetProducts
Definition
Use this call to get all or a range of products.
Request URI: https://api.sellercenter.lazada.sg?Action=GetProducts
Parameters
Field | Type | Description |
---|---|---|
Action | string | GetProducts Name of the API that is to be called. Mandatory. |
Format | string | The response format, with XML as the default. Can be XML or JSON. Optional. |
Timestamp | datetime | The current time in ISO8601 format (e.g., Timestamp=2016-04-01T10:00:00+02:00 for Berlin). Mandatory. |
UserID | string | The ID of the user making the call. Mandatory. |
Version | string | The API version against which this call is to be executed. The current version is "1.0". Mandatory. |
Signature | string | The 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. |
CreatedAfter | datetime | Limits the returned products to those created after or on the specified date, given in ISO 8601 date format. Optional |
CreatedBefore | datetime | Limits the returned products to those created before or on the specified date, given in ISO 8601 date format. Optional |
UpdatedAfter | datetime | Limits the returned products to those updated after or on the specified date, given in ISO 8601 date format. Optional |
UpdatedBefore | datetime | Limits the returned product list to those updated before or on a specified date, given in ISO 8601 date format. Optional |
Search | string | Returns the products with the search string contained in the product name and/or Seller SKU. |
Filter | string | Returns the products with the status matching this parameter. Possible values are all, live, inactive, deleted, image-missing, pending, rejected, sold-out. Mandatory |
Limit | integer | The 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. |
Options | integer | This value can be used to get more stock information. e.g., Options=1 means contain ReservedStock, RtsStock, PendingStock, RealTimeStock, FulfillmentBySellable. |
Offset | integer | Number 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). |
SkuSellerList | array of strings | Only 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.
Name | Type | Description |
---|---|---|
Products | subsection | An array contains at least one Product. Mandatory |
PrimaryCategory | integer | The ID of the primary category for his product. To get the ID for all categories, call GetCategoryTree. Optional |
SPUId | integer | The ID of SPU. Optional |
Attributes | subsection | Contains several product attributes. Mandatory |
Skus | subsection | An array contains at least one SKU. Mandatory |
TotalProducts | integer | The number of total products, it's product level. |
The following table lists some example fields in 'Attributes'.
Name | Type | Description |
---|---|---|
name | string | The name of the product as shown to the customers. Mandatory. Must be between 2 to 255 characters. |
short_description | string | The 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 |
brand | string | The brand name of the product. Optional |
model | string | The model name of the product. Optional |
warranty | string | The warranty time for the product. Optional |
warranty_type | string | The warranty type of the product. Optional |
color_family | string | Color 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.
Name | Type | Description |
---|---|---|
SellerSku | string | A 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 |
ShopSku | string | The ID of SKU in Shop when product is synchronized to shop. Optional |
Status | string | One of the following values: 'active', 'inactive' or 'deleted'. Optional. The default value is 'active'. |
Url | string | The product URL on the web site. Optional |
Available | integer | Available stock. Mandatory |
price | decimal | The product price. Not really a Double, but a Decimal. Optional |
quantity | integer | The current level of inventory for this product. Optional |
ReservedStock | integer | The stock reserved for pending orders in Seller Center. Optional |
RealTimeStock | integer | The stock reserved for pending orders in the Shop not imported in Seller Center yet. Optional |
FulfillmentBySellable | integer | The sellable stock in the Venture warehouse. Optional |
RtsStock | integer | The stock number of order products in Ready-To-Ship. Optional |
PendingStock | integer | The stock number of order products in Pending. Optional |
special_price | decimal | The (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_date | date | Date when special price will become applicable Note: To be used only if date is available. |
special_from_time | datetime | Date 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_date | date | Date till when special price is applicable. Note: To be used only if date is available. |
special_to_time | datetime | Date 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_length | string | Package length. Optional |
package_height | string | Package height. Optional |
package_width | string | Package width. Optional |
package_weight | string | Package weight. Optional |
package_content | string | Package Content. Optional |
Images | subsection | Contains at most 8 images URL. Optional |
Image | string | The 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><div class="prod_content"> <div class="prod_details"> <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> </div></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 </span></b></li><li class=\"\"><b><span>Fingerprint-resistant oleophobic coating </span></b></li><li class=\"\"><b><span>A9 chip with 64-bit architecture </span></b></li><li class=\"\"><b><span>Ultrafast 4G LTE Advanced wireless </span></b></li><li class=\"\"><b><span>New 12-megapixel iSight camera </span></b></li><li class=\"\"><b><span>4k video recording </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 </span></b></li><li class=\"\"><b><span>Fingerprint-resistant oleophobic coating </span></b></li><li class=\"\"><b><span>A9 chip with 64-bit architecture </span></b></li><li class=\"\"><b><span>Ultrafast 4G LTE Advanced wireless </span></b></li><li class=\"\"><b><span>New 12-megapixel iSight camera </span></b></li><li class=\"\"><b><span>4k video recording </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 code | Message |
---|---|
5 | E005: Invalid Request Format |
6 | E006: Unexpected internal error |
14 | E014: "%s" Invalid Offset |
17 | E017: "%s" Invalid Date Format |
19 | E019: "%s" Invalid Limit |
36 | E036: Invalid status filter |
70 | E070: You have corrupt data in your sku seller list. |
506 | E506: Get product failed |
901 | E901: 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.
Updated almost 7 years ago