UpdatePriceQuantity

Definition

Use this call to update the price and quantity of one or more existing products. The maximum number of products that can be updated is 50, but 20 is recommended.

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

📘

Note:

A price update of greater than 80% or more of the previous price will result in the product going back to QC.

Parameters

FieldTypeDescription
ActionstringUpdatePriceQuantity
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.

Code sample

# UpdatePriceQuantity cURL example
# to run, update Timestamp and recompute Signature
#
url = "https://api.sg.ali-lazada.com/"
post
data-urlencode Action=UpdatePriceQuantity
data-urlencode Timestamp=2016-07-18T11:11+0000
data-urlencode [email protected]
data-urlencode Version=1.0
data-urlencode Signature=9ade00fb4b9ab9ed1b8a4d189f1a13e1029edc25dd963235480ec69226fd9f39

Request body

<?xml version="1.0" encoding="UTF-8"?>
<Request>
  <Product>
    <Skus>
      <Sku>
        <SellerSku>Apple-SG-Glod-64G</SellerSku>
        <Quantity>10</Quantity>
        <Price/>
        <SalePrice/>
        <SaleStartDate/>
        <SaleEndDate/>
      </Sku>
      <Sku>
        <SellerSku>Apple-SG-Black-64G</SellerSku>
        <Quantity/>
        <Price>1299.00</Price>
        <SalePrice>1100.00</SalePrice>
        <SaleStartDate/>
        <SaleEndDate/>
      </Sku>
      <Sku>
        <SellerSku>Apple-SG-RoseGold-128G</SellerSku>
        <Quantity>10</Quantity>
        <Price>1888.00</Price>
        <SalePrice>1600.00</SalePrice>
        <SaleStartDate>2016-08-08</SaleStartDate>
        <SaleEndDate>2016-08-31</SaleEndDate>
      </Sku>
    </Skus>
  </Product>
</Request>
//not released yet
//This api is used for update price and/or quantity for one or more sku(s)
SkuPriceQuantityInfo updateInfo = new SkuPriceQuantityInfo();
//update price and quantity at one shot
updateInfo.add(new SkuPriceQuantity("yucheng-test-sku-2017020301", new BigDecimal("11.3"), 10));
//update quantity only
updateInfo.add(new SkuPriceQuantity("yucheng-test-sku-2017020302", 20));
//update price only
updateInfo.add(new SkuPriceQuantity("yucheng-test-sku-2017020303", new BigDecimal("22.11")));

UpdatePriceQuantity updatePriceQuantity = new UpdatePriceQuantity(updateInfo);
try {
  ModifyProductResponse response = updatePriceQuantity.execute();
  System.out.println(String.format("update request succeeded?%b",response.getBody()));
} catch (LazadaException e) {
  System.out.println(e.getResponseStr());
}

Business parameters

The request data is composed of the Skus collection, recursively containing Sku resources, each of them contain the following fields.

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
QuantityintegerThe current level of inventory for this product. Optional
PricedecimalThe product price. Not really a Double, but a Decimal. Optional
SalePricedecimalThe (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. Optional
SaleStartDatedatetimeTime and date when the product goes on sale. If passed in, SalePrice becomes mandatory. The value of 'Time' is accepted in intervals of 15 mins. (For ex: 2017-07-15 18:23 will be converted to 2017-07-15 18:15)
SaleEndDatedatetimeTime and date when the product sale ends. If passed in, SalePrice becomes mandatory. The value of 'Time' is accepted in intervals of 15 mins. (For ex: 2017-07-15 18:23 will be converted to 2017-07-15 18:15)

Result sample

A success response is as follows.

<?xml version="1.0" encoding="UTF-8"?>
<SuccessResponse>
  <Head>
    <RequestId/>
    <RequestAction>UpdatePriceQuantity</RequestAction>
    <ResponseType>Product</ResponseType>
    <Timestamp>2016-07-07T20:12:14+0700</Timestamp>
  </Head>
  <Body/>
</SuccessResponse>
{
    "SuccessResponse": {
        "Head": {
            "RequestId": "",
            "RequestAction": "UpdatePriceQuantity",
            "ResponseType": "Product",
            "Timestamp": "2016-07-07T20:12:14+0700"
        },
        "Body": {
            "Warnings": []
        }
    }
}

Error messages

If you receive internal errors while trying to update the price and quantity, it may be because your product data has not been updated properly and it has some mandatory fields not updated. Try the UpdateProduct call and then the UpdatePriceQuantity call.

Error codeMessage
1000Could not save product: %s
5E005: Invalid Request Format
6E006: Unexpected internal error
30E030: Empty Request
204E204: Too many SKU in one request
501E501: Update product failed
901E901: The request is too frequent, or the requested functionality is temporarily disabled.
1000Internal Application Error