GetOrders
Definition
Use this call to get the customer details for a range of orders. GetOrders is substantially different from GetOrder, which retrieves the items of an order.
Request URI: https://api.sellercenter.lazada.sg?Action=GetOrders
Parameters
Field | Type | Description |
---|---|---|
Action | string | GetOrders 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 orders to those created after or on the specified date, given in ISO 8601 date format. Either CreatedAfter or UpdatedAfter is mandatory. |
CreatedBefore | datetime | Limits the returned orders to those created before or on the specified date, given in ISO 8601 date format. Optional |
UpdatedAfter | datetime | Limits the returned orders to those updated after or on the specified date, given in ISO 8601 date format. Either UpdatedAfter or CreatedAfter is mandatory. |
UpdatedBefore | datetime | Limits the returned orders to those updated before or on the specified date, given in ISO 8601 date format. Optional. |
Limit | integer | The maximum number of orders that can be returned. The supported maximum number is 100. |
Offset | integer | Number of orders to skip at the beginning of the list (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 orders might change during paging). |
Status | string | When set, limits the returned set of orders to loose orders, which return only entries which fit the status provided. Possible values are pending, canceled, ready_to_ship, delivered, returned, shipped and failed. |
SortBy | string | Allows to choose the sorting column. Possible values are created_at and updated_at. |
SortDirection | string | Specify the sorting type. Possible values are ASC and DESC. |
Code sample
# GetOrders cURL example
# to run, update Timestamp and recompute Signature
#
url = "https://api.sg.ali-lazada.com/"
get
data-urlencode Action=GetOrders
data-urlencode CreatedAfter=2014-01-01T00%3A00%3A00%2B0200
data-urlencode CreatedBefore=2014-12-31T23%3A59%3A59%2B0200
data-urlencode Offset=0
data-urlencode Limit=100
data-urlencode Status=pending
data-urlencode Timestamp=2015-07-01T11:11+0000
data-urlencode [email protected]
data-urlencode Version=1.0
data-urlencode Signature=d4ff93cccb165295ed8357fe42082208b781a3b576bbb7d3fe7a624270b047b9
//construct filter condition
OrdersFilter filter = new OrdersFilter();
filter.setSortBy(OrdersFilter.SortBy.UpdatedAt)
.setStatus(OrdersFilter.Status.Canceled)
.setCreatedAfter(new Date(116,1,1))
.setSortDirection(OrdersFilter.SortDirection.DESC)
.setLimit(100);
//init requect with filter
GetOrders request = new GetOrders(filter);
//fire request and handle orders
GetOrdersResponse response = request.execute();
for (Order order: response.getBody()) {
System.out.println(order);
}
Response
Name | Type | Description |
---|---|---|
TotalCount | unsigned | Displayed in the Head section, this number tells the complete number of all orders for the current filter set in the database. |
OrderId | long | Identifier of this order as assigned by the Seller Center. |
CustomerFirstName | string | The customer's first name. |
CustomerLastName | string | The customer's last name. |
OrderNumber | long | The human-readable order number. |
PaymentMethod | string | The method of payment. Options for ID: 1. CREDIT/DEBIT CARD 2. COD 3. INSTALLMENT 4. BANK TRANSFER (VA) 5. PAY AT STORE 6. KLIKBCA BANK TRANSFER Options for TH: 1. CREDIT/DEBIT CARD 2. LAZADA WALLET 3. PAYPAL 4. COD 5. INSTALLMENT 6. PAY AT ATM 7. PAY AT STORE 8. ONLINE BANKING Options for MY: 1. CREDIT/DEBIT CARD 2. LAZADA WALLET 3. PAYPAL 4. COD 5. INSTALLMENT 6. OTC 711 7. ONLINE BANKING Options for PH: 1. CREDIT/DEBIT CARD 2. COD 3. LAZADA WALLET 4. PAYPAL Options for SG: 1. CREDIT/DEBIT CARD 2. LAZADA WALLET 3. PAYPAL 4. COD 5. OCBC INSTALLMENT Options for VN: 1. CREDIT/DEBIT CARD 2. COD 3. INSTALLMENT 4. ONLINE BANKING |
Remarks | string | A human-readable remark. |
DeliveryInfo | string | Delivery information for the order. |
Price | float | Total amount for this order. |
GiftOption | boolean | 1 if item is a gift, and 0 if it is not. |
GiftMessage | string | Gift message as specified by the customer. |
CreatedAt | datetime | Date and time when the order was placed. |
UpdatedAt | datetime | Date and time of the last change to the order. |
AddressBilling | subsection | Node that contains additional nodes, which makes up the billing address: FirstName, LastName, Phone, Phone2, Address1, Address2, City, PostCode, and Country. |
AddressShipping | subsection | Node that contains additional nodes, which makes up the shipping address: FirstName, LastName, Phone, Phone2, Address1, Address2, City, PostCode, and Country. |
NationalRegistrationNumber | string | Required in some countries. |
ItemsCount | integer | Number of items in order. |
Statuses | array | Unique status of the items in the order. (hint: you can find all of the different status codes in the response example) |
PromisedShippingTimes | datetime | Target shipping time for the soonest order item if they are available. |
ExtraAttributes | string | Extra attributes which were passed to the Seller Center on getMarketPlaceOrders call. It is JSON string which client should parse it. |
Voucher | float | Total voucher for this order. |
ShippingFee | float | Total shipping fee for this order. |
TaxCode | string | (For Thailand and Vietnam only) The customer's VAT tax code, provided by the customer when placing the order. |
BranchNumber | string | (For Thailand only) The tax branch code for corporate customers, provided by the customer when placing the order. |
Result sample
A success result sample is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<SuccessResponse>
<Head>
<RequestId></RequestId>
<RequestAction>GetOrders</RequestAction>
<ResponseType>Orders</ResponseType>
<Timestamp>2013-08-27T14:44:13+0000</Timestamp>
<TotalCount>15</TotalCount>
</Head>
<Body>
<Orders>
<Order>
<OrderId>1</OrderId>
<CustomerFirstName>John</CustomerFirstName>
<CustomerLastName>Doe</CustomerLastName>
<OrderNumber>3000</OrderNumber>
<PaymentMethod>CashOnDelivery</PaymentMethod>
<Remarks></Remarks>
<DeliveryInfo></DeliveryInfo>
<Price>100.00</Price>
<GiftOption>0</GiftOption>
<GiftMessage></GiftMessage>
<CreatedAt>2013-09-02 02:28:17</CreatedAt>
<UpdatedAt>2013-09-02 02:28:17</UpdatedAt>
<AddressBilling>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<Phone>0123456789</Phone>
<Phone2></Phone2>
<Address1>testtestcarmen</Address1>
<Address2>testtestcarmen</Address2>
<CustomerEmail>[email protected]</CustomerEmail>
<City>Kuala Lumpur</City>
<PostCode>12345</PostCode>
<Country>Germany</Country>
</AddressBilling>
<AddressShipping>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<Phone>0123456789</Phone>
<Phone2></Phone2>
<Address1>testtestcarmen</Address1>
<Address2>testtestcarmen</Address2>
<CustomerEmail>[email protected]</CustomerEmail>
<City>Kuala Lumpur</City>
<PostCode>11111</PostCode>
<Country>Malaysia</Country>
</AddressShipping>
<NationalRegistrationNumber/>
<ItemsCount>12</ItemsCount>
<PromisedShippingTime>2015-06-13 17:35:22</PromisedShippingTime>
<ExtraAttributes>{"TaxInvoiceRequested":"true"}</ExtraAttributes>
<Statuses>
<Status>shipped</Status>
<Status>returned</Status>
<Status>return_waiting_for_approval</Status>
<Status>return_shipped_by_customer</Status>
<Status>return_rejected</Status>
<Status>ready_to_ship</Status>
<Status>processing</Status>
<Status>pending</Status>
<Status>failed</Status>
<Status>delivered</Status>
<Status>canceled</Status>
</Statuses>
<Voucher>0</Voucher>
<ShippingFee>0</ShippingFee>
<TaxCode>1234</TaxCode>
<BranchNumber>2222</BranchNumber>
</Order>
</Orders>
</Body>
</SuccessResponse>
Error messages
Error code | Message |
---|---|
14 | E014: "%s" Invalid Offset |
17 | E017: "%s" Invalid Date Format |
19 | E019: "%s" Invalid Limit |
36 | E036: Invalid status filter |
74 | E074: Invalid sort direction. |
75 | E075: Invalid sort filter. |
Updated over 6 years ago