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)
| Name | Description | Type | Length | |
|---|---|---|---|---|
| id Required | Sokochan order code or External ID (Please prefix External ID with the @ symbol). | string | 50 | |
Request body
| Name | Description | Type | Length | |
|---|---|---|---|---|
| order_number | Your order number on your system. | string | 20 | |
| comment | Order comment. | string | 50 | |
| special_order | Special requirement to this order. | string | 50 | |
| representative | Your representative | string | 50 | |
| cod_amount | COD amount | decimal | 7,2 | |
| wrap | If you need wrap the package, set it to 1. Default is 0 (no wrap) | number | 1 | |
| shipping Required |
The shipping method code.
|
string | 3 | |
| customer Required | Customer detail | |||
| name Required | Customer full name | string | 200 | |
| address Required | Customer address | string | 255 | |
| district | District name | string | 50 | |
| province Required | Province name | string | 50 | |
| postal_code Required | Postal Code | string | 20 | |
| mobile_no | Mobile number | string | 50 | |
| phone_no | Phone number | string | 20 | |
| email | string | 180 | ||
| 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 SKU | string | 60 | |
| item_code | Item code | string | 60 | |
| item_qty | Item quantity | number | 11 | |
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"
}