SetStatusToCanceled

Definition

Use this call to cancel a single item.

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

Parameters

FieldTypeDescription
ActionstringSetStatusToCanceled
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.
OrderItemIdlongOrder item ID. Mandatory.
ReasonIdlongID of the cancel reason, which is returned by the GetFailureReasons API. Mandatory.
ReasonDetailstringReason detail. Optional.

Code sample

# SetStatusToCanceled cURL example
# to run, update Timestamp and recompute Signature
#
url = "https://api.sg.ali-lazada.com/"
get
data-urlencode Action=SetStatusToCanceled
data-urlencode OrderItemId=1
data-urlencode ReasonID=15
data-urlencode ReasonDetail=My hobbies are ordering and returning.
data-urlencode Timestamp=2015-07-01T11:11+0000
data-urlencode [email protected]
data-urlencode Version=1.0
data-urlencode Signature=d4ff93cccb165295ed8357fe42082208b781a3b576bbb7d3fe7a624270b047b9
//init request with OrderItemId, reason, detailed reason
SetStatusToCanceled request = new SetStatusToCanceled(10937342L, "Invalid - Customer unreachable", "detailreason");
//fire request and check result
try {
  UpdateResponse response = request.execute();
  System.out.println("Set status succeed?" + response.getBody());
} catch (LazadaException e) {
  System.out.println(e.getResponseStr());
}

Result sample

Success and failure result samples are as follows.

<?xml version="1.0" encoding="UTF-8"?>
<SuccessResponse>
  <Head>
    <RequestId></RequestId>
    <RequestAction>SetStatusToCanceled</RequestAction>
    <ResponseType></ResponseType>
    <Timestamp>2013-08-27T14:44:13+0000</Timestamp>
  </Head>
  <Body />
</SuccessResponse>
<?xml version="1.0" encoding="UTF-8"?>
<ErrorResponse>
  <Head>
    <RequestAction>SetStatusToCanceled</RequestAction>
    <ErrorType>Sender</ErrorType>
    <ErrorCode>1000</ErrorCode>
    <ErrorMessage>Invalid cancelation reason</ErrorMessage>
  </Head>
  <Body/>
</ErrorResponse>

Error messages

Error codeMessage
20E020: "%s" Invalid Order Item ID
21E021: OMS Api Error Occurred
22E022: "%s" Invalid Reason
28E028: It is not possible to set the order to the status "%s"