GetMetrics (to be deprecated)
Definition
Use this call to get sales and order metrics for a specified period.
Request URI: https://api.sellercenter.lazada.sg?Action=GetMetrics
Parameters
Field | Type | Description |
---|---|---|
Action | string | GetMetrics 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. |
Code sample
# GetMetrics cURL example
# to run, update Timestamp and recompute Signature
#
url = "https://api.sg.ali-lazada.com/"
get
data-urlencode Action=GetMetrics
data-urlencode Timestamp=2015-07-01T11:11+0000
data-urlencode [email protected]
data-urlencode Version=1.0
data-urlencode Signature=d4ff93cccb165295ed8357fe42082208b781a3b576bbb7d3fe7a624270b047b9
GetMetrics request = new GetMetrics();
try {
GetMetricsResponse response = request.execute();
for(Metrics metrics: response.getBody()) {
System.out.println(metrics);
}
} catch (LazadaException e) {
System.out.println(e.getResponseStr());
}
Response
Not Realtime
The returned metrics are not computed in real time, but are pre-calculated at regular intervals.
The metrics returned with the response are as follows.
Name | Type | Description |
---|---|---|
StatisticsType | string | Time frame of metrics. Day = Today, Week = This Week, Month = This Month, All Time = Since Account Opened |
SkuNumber | integer | Number of SKUs in the seller's catalog |
SkuActive | integer | Number of SKUs active in the seller's catalog |
SalesTotal | integer | Local currency value of sales for a particular statistic type |
Orders | integer | Total number of orders received for a particular statistic type |
Commission | integer | Total amount of commission paid for a particular statistic type |
ReturnsPercentage | decimal | Percentage of orders returned for particular statistic type |
CancellationPercentage | decimal | Percentage of orders canceled for particular statistic type |
Result sample
<?xml version="1.0" encoding="UTF-8"?>
<SuccessResponse>
<Head>
<RequestId/>
<RequestAction>GetMetrics</RequestAction>
<ResponseType/>
<Timestamp>2015-06-11T07:47:08+0000</Timestamp>
</Head>
<Body>
<Metrics>
<MetricsType>
<StatisticsType>alltime</StatisticsType>
<SkuNumber>237</SkuNumber>
<SkuActive>235</SkuActive>
<SalesTotal>3299.00</SalesTotal>
<Orders>84</Orders>
<Commissions>212.00</Commissions>
<TwoDayShipmentPercentage>0.00</TwoDayShipmentPercentage>
<ReturnsPercentage>5.00</ReturnsPercentage>
<CancellationsPercentage>0.00</CancellationsPercentage>
</MetricsType>
<MetricsType>
<StatisticsType>month</StatisticsType>
<SkuNumber>0</SkuNumber>
<SkuActive>0</SkuActive>
<SalesTotal>0.00</SalesTotal>
<Orders>0</Orders>
<Commissions>0.00</Commissions>
<TwoDayShipmentPercentage>0.00</TwoDayShipmentPercentage>
<ReturnsPercentage>0.00</ReturnsPercentage>
<CancellationsPercentage>0.00</CancellationsPercentage>
</MetricsType>
<MetricsType>
<StatisticsType>week</StatisticsType>
<SkuNumber>0</SkuNumber>
<SkuActive>0</SkuActive>
<SalesTotal>0.00</SalesTotal>
<Orders>0</Orders>
<Commissions>0.00</Commissions>
<TwoDayShipmentPercentage>0.00</TwoDayShipmentPercentage>
<ReturnsPercentage>0.00</ReturnsPercentage>
<CancellationsPercentage>0.00</CancellationsPercentage>
</MetricsType>
<MetricsType>
<StatisticsType>day</StatisticsType>
<SkuNumber>0</SkuNumber>
<SkuActive>0</SkuActive>
<SalesTotal>0.00</SalesTotal>
<Orders>0</Orders>
<Commissions>0.00</Commissions>
<TwoDayShipmentPercentage>0.00</TwoDayShipmentPercentage>
<ReturnsPercentage>0.00</ReturnsPercentage>
<CancellationsPercentage>0.00</CancellationsPercentage>
</MetricsType>
</Metrics>
</Body>
</SuccessResponse>
Error messages
No specific errors.
Updated about 7 years ago