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

FieldTypeDescription
ActionstringGetOrders
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 orders to those created after or on the specified date, given in ISO 8601 date format. Either CreatedAfter or UpdatedAfter is mandatory.
CreatedBeforedatetimeLimits the returned orders to those created before or on the specified date, given in ISO 8601 date format. Optional
UpdatedAfterdatetimeLimits the returned orders to those updated after or on the specified date, given in ISO 8601 date format. Either UpdatedAfter or CreatedAfter is mandatory.
UpdatedBeforedatetimeLimits the returned orders to those updated before or on the specified date, given in ISO 8601 date format. Optional.
LimitintegerThe maximum number of orders that can be returned. The supported maximum number is 100.
OffsetintegerNumber 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).
StatusstringWhen 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.
SortBystringAllows to choose the sorting column. Possible values are created_at and updated_at.
SortDirectionstringSpecify 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

NameTypeDescription
TotalCountunsignedDisplayed in the Head section, this number tells the complete number of all orders for the current filter set in the database.
OrderIdlongIdentifier of this order as assigned by the Seller Center.
CustomerFirstNamestringThe customer's first name.
CustomerLastNamestringThe customer's last name.
OrderNumberlongThe human-readable order number.
PaymentMethodstringThe 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
RemarksstringA human-readable remark.
DeliveryInfostringDelivery information for the order.
PricefloatTotal amount for this order.
GiftOptionboolean1 if item is a gift, and 0 if it is not.
GiftMessagestringGift message as specified by the customer.
CreatedAtdatetimeDate and time when the order was placed.
UpdatedAtdatetimeDate and time of the last change to the order.
AddressBillingsubsectionNode that contains additional nodes, which makes up the billing address: FirstName, LastName, Phone, Phone2, Address1, Address2, City, PostCode, and Country.
AddressShippingsubsectionNode that contains additional nodes, which makes up the shipping address: FirstName, LastName, Phone, Phone2, Address1, Address2, City, PostCode, and Country.
NationalRegistrationNumberstringRequired in some countries.
ItemsCountintegerNumber of items in order.
StatusesarrayUnique status of the items in the order. (hint: you can find all of the different status codes in the response example)
PromisedShippingTimesdatetimeTarget shipping time for the soonest order item if they are available.
ExtraAttributesstringExtra attributes which were passed to the Seller Center on getMarketPlaceOrders call.

It is JSON string which client should parse it.
VoucherfloatTotal voucher for this order.
ShippingFeefloatTotal shipping fee for this order.
TaxCodestring(For Thailand and Vietnam only) The customer's VAT tax code, provided by the customer when placing the order.
BranchNumberstring(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 codeMessage
14E014: "%s" Invalid Offset
17E017: "%s" Invalid Date Format
19E019: "%s" Invalid Limit
36E036: Invalid status filter
74E074: Invalid sort direction.
75E075: Invalid sort filter.