GetDocument
Definition
Use this call to retrieve order-related documents, including invoices, shipping labels, and shipping parcels.
Request URI: https://api.sellercenter.lazada.sg?Action=GetDocument
Parameters
Field | Type | Description |
---|---|---|
Action | string | GetDocument 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. |
DocumentType | string | Document types, including 'invoice', 'shippingLabel', or 'carrierManifest'. Mandatory. |
OrderItemIds | array of long | Identifier of the order item for which the caller wants to get a document. Mandatory. |
Code sample
# GetDocument cURL example
# to run, update Timestamp and recompute Signature
#
url = "https://api.sg.ali-lazada.com/"
get
data-urlencode Action=GetDocument
data-urlencode DocumentType=shippingLabel
data-urlencode OrderItemIds=[1,2]
data Timestamp=2015-07-14T04%3A27%2B0000
data-urlencode [email protected]
data-urlencode Version=1.0
data-urlencode Signature=4bef3fda564dd24173260066b97c4e4af08dc9984a0ce147de2f476c167e6475
List<Long> ids = Arrays.asList(102612420L,102612419L);
GetDocument GetDocument = new GetDocument(DocumentType.ShippingLabel, ids);
try {
GetDocumentResponse response = GetDocument.execute();
Document document = response.getBody();
System.out.println(document);
} catch (LazadaException e) {
System.out.println(e.getResponseStr());
}
Result sample
<?xml version="1.0" encoding="UTF-8"?>
<SuccessResponse>
<Head>
<RequestId></RequestId>
<RequestAction>GetDocument</RequestAction>
<ResponseType></ResponseType>
<Timestamp>2013-08-27T14:44:13+0000</Timestamp>
</Head>
<Body>
<Document>
<DocumentType>shippingLabel</DocumentType>
<MimeType>text/html</MimeType>
<File>YTM0NZomIzI2OTsmIzM0NTueYQ==</File>
</Document>
</Body>
</SuccessResponse>
Documentation
To reconstruct the file, the data from the node needs to be base64 decoded, and
interpreted according to the .
Error messages
Error code | Message |
---|---|
20 | E020: "%s" Invalid Order Item IDs |
21 | E021: OMS Api Error Occurred |
32 | E032: Document type "%s" is not valid |
34 | E034: Order Item must be packed. Please call setStatusToReadyToShip before |
35 | E035: "%s" was not found |
Updated almost 7 years ago