Create Order

Create a new order.


Resource URL

https://oms.sokochan.com/api/1.0/orders


Request body

Name Description Type Length
external_id
Required
External ID is a unique key that allows you to link Sokochan order with the Order ID from your system without the need to store additional data on your side. string 50
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 (allowed on KND, K2D, KSD shipping) 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.
  • EMS is ไปรษณีย์ไทย Express / ThaiPost EMS
  • REG is ไปรษณีย์ไทย ลงทะเบียน / ThaiPost Registered
  • KND is Kerry Express (วันรุ่งขึ้น/Next Day)
  • K2D is Kerry Express (2 วัน/2 Day)
  • KSD is Kerry Express (ส่งภายในวันเดียว)
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
Postcal Code string 20
mobile_no
Mobile number string 50
phone_no
Phone number string 20
email
Email string 180
order_items[]
Required
Array of item(s) in order
You can use [item_code, item_sku, lazada_sku, shopee_sku] in the array but all cannot be blank
item_sku Item SKU string 60
item_code
Item code string 60
lazada_sku
Lazada SKU string 60
shopee_sku
Shopee SKU string 60
item_qty
Item quantity number 11
attributes[]
Optional
Array of order attributes
You can use [attribute_code, attribute_value] in the array
attribute_code
Attribute code Varchar(255) cod_wallet_id
attribute_value
Attribute value Varchar(255) or Integer 0860000000
curl -X POST -H "Authorization: Basic ZnJlZDpmcmVk="\
-H "Content-Type: application/json"\ -d '{ "external_id":"111016-00004", "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":"", "lazada_sku":"", "shopee_sku":"", "item_qty":1} ], "attributes": [ { "attribute_code": "cod_wallet_id", "attribute_value": "0860000000" } ] }' "https://oms.sokochan.com/api/1.0/order"
{
  "code": 200,
  "external_id": "111016-00004",
  "order_code": "1610-006-00004",
  "created": "2016-10-18 15:02:51"
}