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 | 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 | |
| tracking_no | Tracking Number | string | 60 | |
| 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 | 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 | |
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":"ALP", "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} ] }' "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"
}