Order.UpdateItemStatus
Deprecation warning
This method is deprecated in favor of UpdateItemStatus.
Note on implementation
This method implements a different authentication mechanism and also returns different data structure than the previous methods for the OMS API.
Authentication for this method is based on username and password. Also the endpoint is different: "oms".
Endpoint
URL request example eg:
https://SELLERCENTER-API/oms
Description
Update new order item status based on event. New order status data will be passed via [params]
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
api |
Decimal |
Yes |
The version of the API being called. Initially it is 1 |
method |
String |
Yes |
The Action to perform |
username |
String |
Yes |
Configured username that's used for authentication |
password |
Variable |
Yes |
Configured password that's used for authentication - should be a hash string |
[params] |
undefined | undefined | Extra optional parameters for some Actions, passed as ParameterName=ParameterValue |
OrderItem Data Structure
Name |
Type |
Mandatory |
Description |
Example |
---|---|---|---|---|
tracking_code |
string |
Used for "SHIPPED" status |
389292777 |
|
statuseventtime |
string |
Yes |
The timestamp at order item status changed |
2015-07-30 18:07:36 |
shipping_carrier |
string |
undefined | Used for "SHIPPED" status |
GDEX |
reason |
string |
Mandatory for events: cancel, fail_deliver, return |
The reason belongs to the new status |
Can not deliver |
package_id |
string |
undefined | Used for "SHIPPED" status |
MPDS-300739975-3582 |
idsalesorder_item |
int |
Yes |
Sales Order Item ID |
73955 |
event |
string |
Yes |
Event based on status change |
fail_deliver |
HTTP Returned Codes
SC will return HTTP code for almost cases following table below. For some exceptional cases, the code will follow by default (https://en.wikipedia.org/wiki/ListofHTTPstatuscodes)
Code |
Value |
Description |
---|---|---|
200 |
OK |
Message is processed successfully. |
400 |
Client error |
Bad request - Error from broker's message. This code can be returned for some of the following reasons:
|
401 |
Client error |
Forbidden - Error from authentication when either:
|
405 |
Client error |
Method Not Allowed - For some reasons, the method in message can not bind to the system. |
530 |
Server Error |
The event is not supposed to happen at this stage. Broker should re-queue this message. For example current status in SC is "PENDING" and Broker sends event "transittoship". |
531 |
Server Error |
The event has already happened. Broker should not re-queue this message. For example current status in SC is "SHIPPED" and Broker sends event "readytoship" |
532 |
Server Error |
Internal errors from server (E.g resource connection, catchable exception). Error message should be logged in SC, and Broker should re-send that event. |
533 |
Server Error |
This endpoint is not active in SC side. Broker should stop sending message. Potentially a misconfiguration on some side. |
500 |
Server Error |
500 Server error |
Events table
SC |
Action |
OMS |
Final events |
Next status in SC |
---|---|---|---|---|
PENDING |
cancelreadytoship |
HBMP PBMP PBMP |
cancelledreadytoship |
cancelledreadytoship |
RTS |
cancel transittoship ship |
RTS |
cancelled transittoship shipped |
cancelled shipped (in_transit) shipped |
TTS |
ship |
TTS |
shipped |
shipped |
SHIPPED |
deliver fail_deliver |
SHIPPED SHIPPED |
delivered not_delivered |
delivered not_delivered |
DELIVERED |
return |
DELIVERED |
pickupreturnpending being_returned |
returned returned |
RTS: Ready To Ship TTS: Transit To Shihp HBMP: Handled By Marketplace PBMP: Packed By Marketplace
Parameters
Name |
Type |
Mandatory |
Description |
---|---|---|---|
OrderItemData |
array |
Yes |
an array contains order item data |
Return Data Structure
Name |
Type |
Mandatory |
Description |
---|---|---|---|
result |
int |
Yes |
0: Success 1: Failure |
message |
string |
Additional message, to easily debug/trace error. |
Examples
Order Item Status API request For Ship Action
{
"api":1,
"username":"oms.api",
"password":"***",
"method":"Order.UpdateItemStatus",
"params":{
"OrderItemData":{
"id_sales_order_item":"73957",
"event":"ship",
"status_event_time": "TIMESTAMP",
"shipping_carrier":"GDEX",
"tracking_code":"292778932",
"package_id": "MPDS-300739975-3582"
}
}
}
Response For Ship Action
{
"result":0
"message":"Additional information"
}
Order Item Status API request For Cancel Action
{
"api":1,
"username":"oms.api",
"password":"***",
"method":"Order.UpdateItemStatus",
"params":{
"OrderItemData":{
"id_sales_order_item":"9283",
"event":"cancel",
"reason":"Out of stock",
"status_event_time": "TIMESTAMP",
}
}
}
Response For Cancel Action
{
"result":0
"message":""
}