Update Order

Updates a pending order.

If order_items array is given in the update data, system will be:
- replace the existing items with the new items.


Resource URL

https://oms.sokochan.com/api/1.0/orders/{id}


Parameter(s)

NameDescriptionTypeLength
id
Required
Sokochan order code or External ID
(Please prefix External ID with the @ symbol).
string50

Request body

NameDescriptionTypeLength
order_number
Your order number on your system.string20
comment
Order comment.string50
special_order
Special requirement to this order.string50
representative
Your representativestring50
cod_amount
COD amountdecimal7,2
wrap
If you need wrap the package, set it to 1. Default is 0 (no wrap)number1
shipping
Required
The shipping method code.
  • EMS is ไปรษณีย์ไทย Express / ThaiPost EMS
  • KND is Kerry Express (วันรุ่งขึ้น/Next Day)
  • K2D is Kerry Express (2 วัน/2 Day)
string 3
customer
Required
Customer detail
name
Required
Customer full namestring200
address
Required
Customer addressstring255
district
District namestring50
province
Required
Province namestring50
postal_code
Required
Postal Codestring20
mobile_no
Mobile numberstring50
phone_no
Phone numberstring20
email
Emailstring180
order_items[]
Required
Array of item(s) in order
You can use item_code or item_sku in the array but cannot both be blank
item_sku
Item SKUstring60
item_code
Item codestring60
item_qty
Item quantitynumber11
curl -X PUT -H "Authorization: Basic ZnJlZDpmcmVk="\
-H "Content-Type: application/json"\ -d '{ "order_number":"SH000004", "comment":"ใส่ถงใสด้วย", "special_order" : "คำสั่งพิเศษ", "representative":"Agent 01", "cod_amount":258.50, "wrap":1, "shipping":"EMS", "customer":{ "name": "นายรัก การเรียนรู้", "address": "0000/00 เทิคราชัน สีกัน ดอนเมือง", "district":"ดอนเมือง", "province":"กรุงเทพ", "postal_code":"10210", "mobile_no":"", "phone_no":"", "email":"" }, "order_items":[ {"item_sku":"10755251_3773070","item_code":"","item_qty":1} ] }' "https://oms.sokochan.com/api/1.0/order/@111016-00004"
curl -X PUT -H "Authorization: Basic ZnJlZDpmcmVk="\
-H "Content-Type: application/json"\ -d '{ "order_number":"SH000004", "comment":"ใส่ถงใสด้วย", "special_order" : "คำสั่งพิเศษ", "representative":"Agent 01", "cod_amount":258.50, "wrap":1, "shipping":"EMS", "customer":{ "name": "นายรัก การเรียนรู้", "address": "0000/00 เทิคราชัน สีกัน ดอนเมือง", "district":"ดอนเมือง", "province":"กรุงเทพ", "postal_code":"10210", "mobile_no":"", "phone_no":"", "email":"" }, "order_items":[ {"item_sku":"10755251_3773070","item_code":"","item_qty":1} ] }' "https://oms.sokochan.com/api/1.0/order/1610-006-00004"
{
  "code": 200,
  "external_id": "111016-00004",
  "order_code": "1610-006-00004",
  "updated": "2016-10-18 15:02:51"
}