บริการ

Introduction Trustbox open API

The Trustbox Open API provides connection between Trustbox warehouse and your system. You can access product, order and advice information.

Request And Response

Generally speaking, all requests originate with you; in other words, you contact the API. The API does not contact you.
The API design incorporates REST principles. More specifically, each request is an HTTP request directed to an endpoint and each endpoint corresponds to a resource. All of the needed parameters are included in the URL as parameters and the API then returns the information you seek.

Some methods require data for input; others have no output.

Request

As we have seen, all methods are called via HTTP. Some via GET and some via POST.
curl -X [GET|POST] -H "Authorization: Basic {Token}" "https://oms.trustboxfulfillment.com/api/1.0/products"

Request

The response format for all requests is a JSON object.
Whether a request succeeded is indicated by the HTTP status code. A 2xx status code indicates success, whereas a 4xx status code indicates failure. When a request fails, the response body is still JSON, but always contains the fields code and error which you can inspect to use for debugging.
HTTP 200
curl -X [GET|POST] -H "Authorization: Basic {Token}" "https://oms.trustboxfulfillment.com/api/1.0/products"
HTTP 400
{
    "code": 404,
    "error": "Product not found"
}

Standard response

The Order API uses standard HTTP response codes to indicate success or error.
Code Description
200 OK Success.
404 Not Found Order not found.
400 Bad RequestWrong URL parameters.
405 Method Not Allowed Incorrect HTTP method (GET instead of POST, for example)
500 Internal Server Error Something is wrong on our server.
403 Forbidden API account does not allow this kind of requests.

Introduction Trustbox open API

The API use HTTP Basic Auth.

HTTP Basic Auth

HTTP Basic access authentication is one of the easiest authentication methods and it's only safe with a secure SSL/HTTPS connection. The header generated is:
Basic {TOKEN}
where the {TOKEN} is the base 64 of the account_loing and api_key separated by a colon. In pseudo-code, it would be:
base64(account_login + ':' + api_key)
GET /inventory/product HTTP/1.1

Host: oms.trustboxfulfillment.com

Authorization: Basic aHR0cHdhdGNoOmY=

GET Get list of product


Resource URL

https://oms.trustboxfulfillment.com/api/1.0/products

Parameter(s)

Name Description
limit Number of items per page (max 100)
offset Result set offset
Example
curl -X GET -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/products"
Result HTTP 200
{
  "products": [
    {
      "item_code": "04300021",
      "sku": null,
      "ean": null,
      "number": "JPT0301-L",
      "name": "Crush on me - Navy blue/L",
      "width": 0,
      "height": 0,
      "length": 0,
      "weight": 0,
      "cost": 0,
      "selling_price": 0,
      "description": "",
      "enable": 1,
      "inventory": {
        "in_stock": 15,
        "on_order": 0,
        "available": 15
      }
    },
    {
      "item_code": "04300022",
      "sku": null,
      "ean": null,
      "number": "JPT0302-S",
      "name": "Crush on me - Black/S",
      "width": 0,
      "height": 0,
      "length": 0,
      "weight": 0,
      "cost": 0,
      "selling_price": 0,
      "description": "",
      "enable": 1,
      "inventory": {
        "in_stock": 2,
        "on_order": 0,
        "available": 2
      }
    },
    {
    	.............
    },
  "paging": {
    "limit": 20,
    "offset": 20,
    "total": 40
  }
}

Documentation

The fields of the result have the following type and meaning:
NameDescription
products[]Array of product object
pagingPaging object

Paging Object

NameDescription
paging.totalTotal number of items
paging.limitNumber of items per page
paging.offsetResult set offset

Product Object

NameDescriptionTypeLength
item_codeProduct code string20
skuProduct SKUstring60
numberProduct numberstring20
nameProduct namestring100
description
Product descriptionstring250
width
Product widthdecimal10,2
height
Product heightdecimal10,2
length
Product lengthdecimal10,2
weight
Product weightdecimal10,2
cost
Cost pricedecimal8,2
selling_price
Selling pricedecimal8,2
ean
EAN numberstring13
enableProduct enable in OMS
  • 1 = enable
  • 0 = disable
number1
inventory.in_stockQuantity of item in stocknumber11
inventory.on_orderQuantity of ordered itemnumber11
inventory.availableQuantity of available itemnumber11

GET Get product data

Get a single product data.

Resource URL

https://oms.trustboxfulfillment.com/api/1.0/products/{id}

Parameter(s)

Name Description TypeLength
id
Required
Item Code or SKU
(Please prefix SKU with the @ symbol).
string60
Example, get order by SKU
curl -X GET -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/products/@624295_1467662"
Example, get order by Item Code
curl -X GET -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/products/00600001"
Result HTTP 200 OK
{
  "item_code": "00600001",
  "sku": "624295_1467662",
  "ean": "",
  "number": "TEST001",
  "name": "TSG2721/รองเท้าแตะเปิดหน้ามีโบว์ฟ้าอมเทา/12",
  "width": 10.00,
  "height": 10.00,
  "length": 10.00,
  "weight": 400.00,
  "cost": 6000.00,
  "selling_price": 8900.00,
  "description": "Product 1 Long",
  "enable": "1",
  "inventory": {
    "in_stock": 10,
    "on_order": 10,
    "available": 0
  }
}"

Documentation

The fields of the result have the following type and meaning:
NameDescriptionTypeLength
item_codeProduct codestring20
skuProduct SKUstring60
numberProduct numberstring20
nameProduct namestring100
createdCreated datedate-
description
Product descriptionstring250
width
Product widthdecimal10,2
height
Product heightdecimal10,2
length
Product lengthdecimal10,2
weight
Product weightdecimal10,2
cost
Cost pricedecimal8,2
selling_price
Selling pricedecimal8,2
ean
EAN numberstring13
enableProduct enable in OMS
  • 1 = enable
  • 0 = disable
number1
inventory.in_stockQuantity of item in stocknumber11
inventory.on_orderQuantity of ordered itemnumber11
inventory.availableQuantity of available itemnumber11

POST Create product

Create a new product

Resource URL

https://oms.trustboxfulfillment.com/api/1.0/products

Request body

Name Description TypeLength
sku
Required
Must be a unique valuestring60
number
Required
Product numberstring20
name
Required
Product namestring100
description
Product descriptionstring250
width
Product widthdecimal10,2
height
Product heightdecimal10,2
length
Product lengthdecimal10,2
weight
Product weightdecimal10,2
cost
Cost pricedecimal8,2
selling_price
Selling pricedecimal8,2
ean
EAN numberstring13
Example
curl -X POST -H "Authorization: Basic ZnJlZDpmcmVk="\ -H "Content-Type: application/json"\ -d 
'{
  "sku": "new_sku_0002",
  "number": "new0001",
  "name": "กล้องมือโปร",
  "width": "",
  "height": "",
  "length": "",
  "weight": "",
  "cost": 10030.00,
  "selling_price": 15990.00,
  "description": "",
  "ean":""
}' "https://oms.trustboxfulfillment.com/api/1.0/products"
Result HTTP 200
{
  "item_code": "00600039",
  "sku": "new_sku_0002",
  "created": "2016-11-02 11:31:28"
}

GET Get list of order

Get list of order detail.

Resource URL

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

Parameter(s)

Name Description TypeLength
created Date of creation
format YYYY-mm-dd
example 2016-12-01
date-
status Order status (default is any)
  • any
  • draft
  • pending
  • processed
  • picked
  • packed
  • shipped
  • cancelled
string 30
limit Number of items per page (max 100)
offset Result set offset
Example
curl -X GET -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/orders"
Result HTTP 200
{
    "orders": [
        {
            "external_id": null,
            "order_code": "2203-027-00673",
            "order_number": "JD63640074",
            "comment": null,
            "special_order": null,
            "representative": "Baby Shop",
            "cod_amount": "294.00",
            "insert_qty": 0,
            "wrap": 0,
            "shipping": "JDC",
            "tracking_no": "88884440074",
            "package": "BOX-2A",
            "weight": "    430",
            "status": "shipped",
            "shipping_status": "pending",
            "created": "2022-03-10 03:08:04",
            "updated": "2022-03-10 14:24:52",
            "customer": {
                "name": "คุณแพ็คถูก แพ็คดี",
                "address": "100 ต.มะเขือแจ้ อ.เมือง จ.ลำพูน มะเขือแจ้ เมืองลำพูน ลำพูน",
                "district": "-",
                "province": "ลำพูน",
                "postal_code": "51000",
                "mobile_no": "081998999",
                "phone_no": null,
                "email": null
            },
            "order_items": [
                {
                    "item_number": "WEB-9999",
                    "item_sku": "WEB-9999",
                    "item_code": "02700154",
                    "item_name": "ถ้วยซุปเก็บอุณหภูมิ",
                    "item_qty": 1
                }
            ],
            "order_history": [
                {
                    "date_time": "10/03/2565 03:08",
                    "location": "The Baby",
                    "status": "สร้างออเดอร์ / Order Created",
                    "remark": "2203-027-00673",
                    "timestamp": 1646856485
                },
                {
                    "date_time": "10/03/2565 09:12",
                    "location": "SKC WH1 (Warehouse)",
                    "status": "เข้าสู่กระบวนการ / Order Processed",
                    "remark": "",
                    "timestamp": 1646878377
                },
                {
                    "date_time": "10/03/2565 10:03",
                    "location": "SKC WH1 (Warehouse)",
                    "status": "หยิบออเดอร์ / Order Picked",
                    "remark": "",
                    "timestamp": 1646881412
                },
                {
                    "date_time": "10/03/2565 10:04",
                    "location": "SKC WH1 (Warehouse)",
                    "status": "แพ็คออเดอร์ / Order Packed",
                    "remark": "",
                    "timestamp": 1646881458
                },
                {
                    "date_time": "10/03/2565 14:24",
                    "location": "SKC WH1 (Warehouse)",
                    "status": "จัดส่งโดย / Shipped via JDC",
                    "remark": "888863640074",
                    "timestamp": 1646897092
                }
            ],
            "billing": {
                "no_of_item_1": 1,
                "no_of_item_2": 0,
                "no_of_item_3": 0,
                "picking_fee": 1,
                "packing_fee": 6,
                "charge_bubble_wrap": 0,
                "charge_insert_item": 0,
                "shipping_fee": 0,
                "cod_fee": 0,
                "bulky_fee": 0,
                "fragile_fee": 0,
                "total_fee": 7
            }
        },
        {
            "external_id": null,
            "order_code": "2203-027-00674",
            "order_number": "JD63638893",
            "comment": null,
            "special_order": null,
            "representative": "Baby Shop",
            "cod_amount": "0.00",
            "insert_qty": 0,
            "wrap": 0,
            "shipping": "JDC",
            "tracking_no": "888855538893",
            "package": " BOX-SP01",
            "weight": "  11150",
            "status": "shipped",
            "shipping_status": "pending",
            "created": "2022-03-10 03:08:06",
            "updated": "2022-03-10 14:24:52",
            "customer": {
                "name": "คุณกล่องสวย",
                "address": "112 (หมู่บ้านอิ่มอัมพร2, ซ.15E) ซ.ราชพฤกษ์9, บางเชือกหนัง ตลิ่งชัน กรุงเทพมหานคร",
                "district": "-",
                "province": "กรุงเทพมหานคร",
                "postal_code": "10170",
                "mobile_no": "819229992",
                "phone_no": null,
                "email": null
            },
            "order_items": [
                {
                    "item_number": "WEB-8888",
                    "item_sku": "WEB-8888",
                    "item_code": "02700018",
                    "item_name": "กล่องรองเท้า",
                    "item_qty": 4
                }
            ],
            "order_history": [
                {
                    "date_time": "10/03/2565 03:08",
                    "location": "The Baby",
                    "status": "สร้างออเดอร์ / Order Created",
                    "remark": "2203-027-00674",
                    "timestamp": 1646856487
                },
                {
                    "date_time": "10/03/2565 09:12",
                    "location": "SKC WH1 (Warehouse)",
                    "status": "เข้าสู่กระบวนการ / Order Processed",
                    "remark": "",
                    "timestamp": 1646878377
                },
                {
                    "date_time": "10/03/2565 11:07",
                    "location": "SKC WH1 (Warehouse)",
                    "status": "หยิบออเดอร์ / Order Picked",
                    "remark": "",
                    "timestamp": 1646885227
                },
                {
                    "date_time": "10/03/2565 11:08",
                    "location": "SKC WH1 (Warehouse)",
                    "status": "แพ็คออเดอร์ / Order Packed",
                    "remark": "",
                    "timestamp": 1646885314
                },
                {
                    "date_time": "10/03/2565 14:24",
                    "location": "SKC WH1 (Warehouse)",
                    "status": "จัดส่งโดย / Shipped via JDC",
                    "remark": "8888636344893",
                    "timestamp": 1646897092
                }
            ],
            "billing": {
                "no_of_item_1": 1,
                "no_of_item_2": 3,
                "no_of_item_3": 0,
                "picking_fee": 4,
                "packing_fee": 0,
                "charge_bubble_wrap": 0,
                "charge_insert_item": 0,
                "shipping_fee": 0,
                "cod_fee": 0,
                "bulky_fee": 0,
                "fragile_fee": 0,
                "total_fee": 4
            }
        },
        {
        ...
        }
    ],
    "paging": {
        "limit": 100,
        "offset": 0,
        "total": 44
    }
}

Documentation

The fields of the result have the following type and meaning:
NameDescription
orders[]Array of order object
pagingPaging object

Paging Object

NameDescription
paging.totalTotal number of items
paging.limitNumber of items per page
paging.offsetResult set offset

Order Object

NameDescriptionTypeLength
external_idExternal ID is a unique key that allows you to link Trustbox order with the Order ID from your system.string50
order_number
Order numberstring20
comment
Order comment.string50
special_order
Special requirement to this order.string50
representative
Your representativestring50
cod_amount
COD amountdecimal7,2
insert_qty
Insert-item quantitynumber2
wrap
Wrap is 1. No wrap is 0.number1
shipping 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)
string 3
tracking_no
Tracking No.string20
package
Order packagestring6
created
Created Date/Timedatetime-
updated
Updated Date/Timedatetime-
status
Order Status
  • draft
  • pending
  • processed
  • picked
  • packed
  • shipped
  • cancelled
string 30
shipping_status
Order Status
  • pending
  • shipping
  • delivered
  • delay
string 30
customerCustomer object
order_items[]Array of item(s) in order
order_history[]Array of history item
billingBilling detail

Customer Object

NameDescriptionTypeLength
nameCustomer full namestring200
addressCustomer addressstring255
district
District namestring50
provinceProvince namestring50
postal_codePostal Codestring20
mobile_no
Mobile numberstring50
phone_no
Phone numberstring20
email
Emailstring180

Order Item Object

NameDescriptionTypeLength
item_sku
Item SKUstring60
item_code
Item codestring60
item_name
Item namestring100
item_qty
Item quantitynumber11

History Item Object

NameDescriptionTypeLength
date_time
Display date time (fixed format)number30
location
Locationstring180
remark
Remarkstring180
timestmap
Unix timestamptimestamp-

Billing Object

NameDescriptionTypeLength
no_of_item_1
No. of 1st itemnumber-
no_of_item_2
No. of item 2-10number-
no_of_item_3
No. of item 11+number-
picking_fee
Picking Feedecimal-
packing_fee
Packing Feedecimal-
charge_bubble_wrap
Bubble wrap chargenumber1
charge_insert_time
Insert item chargetimestamp-
shipping_fee
Shipping Feedecimal-
cod_fee
COD Feedecimal-
total_fee
Total Feedecimal-

GET Get order data

Get a single order detail.

Resource URL

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

Parameter(s)

NameDescriptionTypeLength
id
Required
Trustbox order code or External ID
(Please prefix External ID with the @ symbol).
string50
Example, get order by External ID
curl -X GET -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/orders/@00100001"
Example, get order by Trustbox order code
curl -X GET -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/orders/1610-006-00004"
Result HTTP 200
{
  "external_id": "111016-00004",
  "order_code": "1610-006-00004",
  "order_number": "SH000004",
  "comment": "ใส่ถงใสด้วย",
  "special_order" : "คำสั่งพิเศษ",
  "representative":"Agent 01",
  "cod_amount": "258.50",
  "insert_qty": "0",
  "wrap": 1,
  "shipping": "EMS",
  "tracking_no": "ABCD12367890",
  "package": "BOX-C",
  "package_width": 20,
  "package_length": 30,
  "package_height": 11,
  "weight" : 200,
  "status": "pending",
  "shipping_status": "pending",
  "created": "2016-10-18 15:02:51",
  "updated": "2016-10-18 15:02:51",
  "customer": {
    "name": "นายรัก การเรียนรู้",
    "address": "0000/00 เทิคราชัน สีกัน ดอนเมือง",
    "district": "ดอนเมือง",
    "province": "กรุงเทพ",
    "postal_code": "10210",
    "mobile_no": "",
    "phone_no" : "",
    "email": ""
  },
  "order_items": [
    {
      "item_number": "EU004",
      "item_sku": "10755251_3773070",
      "item_code": "00600012",
      "item_name": "EU004",
      "item_qty": "1"
    }
  ],
  "order_history": [
    {
        "date_time": "18/10/2559 15:02",
        "location": "Demo Merchant",
        "status": "สร้างออเดอร์ / Order Created",
        "remark": "1706-044-00010",
        "timestamp": 1497927458
    },
    {
        "date_time": "18/10/2559 15:10",
        "location": "SKC WH1 (Warehouse)",
        "status": "เข้าสู่กระบวนการ / Order Processed",
        "remark": "",
        "timestamp": 1497927610
    },
    {
        "date_time": "18/10/2559 15:11",
        "location": "SKC WH1 (Warehouse)",
        "status": "หยิบออเดอร์ / Order Picked",
        "remark": "",
        "timestamp": 1497927729
    },
    {
        "date_time": "18/10/2559 15:13",
        "location": "SKC WH1 (Warehouse)",
        "status": "แพ็คออเดอร์ / Order Packed",
        "remark": "",
        "timestamp": 1497928015
    },
    {
        "date_time": "18/10/2559 15:30",
        "location": "SKC WH1 (Warehouse)",
        "status": "จัดส่งโดย / Shipped via KND",
        "remark": "CSKC200004986",
        "timestamp": 1497942715
    },
    {
        "datetime": "18/10/2559 16:00",
        "location": "",
        "status_title": "พัสดุถึงศูนย์คัดแยกสินค้า",
        "remark": "",
        "status_code": "102"
    },
    {
        "datetime": "18/10/2559 16:09",
        "location": "Bangkok",
        "status_title": "เคอรี่เข้ารับพัสดุแล้ว",
        "remark": "",
        "status_code": "010"
    },
    {
        "datetime": "19/10/2559 07:27",
        "location": "Bangkok",
        "status_title": "พัสดุถึงสาขาปลายทาง",
        "remark": "",
        "status_code": "103"
    },
    {
        "datetime": "19/10/2559 07:32",
        "location": "Bangkok",
        "status_title": "พัสดุรอนำส่ง",
        "remark": "",
        "status_code": "045"
    },
    {
        "datetime": "19/10/2559 10:19",
        "location": "Bangkok",
        "status_title": "ปลายทางได้รับเรียบร้อยแล้ว",
        "remark": "ชื่อผู้รับ สัณหณัฐ",
        "status_code": "POD"
    }
  ],
  "billing": {
      "no_of_item_1": 1,
      "no_of_item_2": 0,
      "no_of_item_3": 0,
      "picking_fee": 9,
      "packing_fee": 5,
      "charge_bubble_wrap": 0,
      "charge_insert_item": 0,
      "shipping_fee": 42,
      "cod_fee": 0,
      "total_fee": 56
  }
}

Documentation

The fields of the result have the following type and meaning:
NameDescriptionTypeLength
external_idExternal ID is a unique key that allows you to link Trustbox order with the Order ID from your system.string50
order_number
Order numberstring20
comment
Order comment.string50
special_order
Special requirement to this order.string50
representative
Your representativestring50
cod_amount
COD amountdecimal7,2
insert_qty
Insert-item quantitynumber2
wrap
Wrap is 1. No wrap is 0.number1
shipping 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
tracking_no
Tracking No.string20
package
Order packagestring6
package_width
Order package width (cm.)number4
package_length
Order package length (cm.)number4
package_height
Order package height (cm.)number4
weight
Order weight (g.)string20
created
Created Date/Timedatetime-
updated
Updated Date/Timedatetime-
status
Order Status
  • draft
  • pending
  • processed
  • picked
  • packed
  • shipped
  • cancelled
string 30
shipping_status
Order Status
  • pending
  • shipping
  • delivered
  • delay
string 30
customerCustomer object
order_items[]Array of item(s) in order
order_history[]Array of history item
billingBilling object

Customer Object

NameDescriptionTypeLength
nameCustomer full namestring200
addressCustomer addressstring255
district
District namestring50
provinceProvince namestring50
postal_codePostal Codestring20
mobile_no
Mobile numberstring50
phone_no
Phone numberstring20
email
Emailstring180

Order Item Object

NameDescriptionTypeLength
item_sku
Item SKUstring60
item_code
Item codestring60
item_name
Item namestring100
item_qty
Item quantitynumber11

History Item Object

NameDescriptionTypeLength
date_time
Display date time (fixed format)number30
location
Locationstring180
remark
Remarkstring180
timestmap
Unix timestamptimestamp-

Billing Object

NameDescriptionTypeLength
no_of_item_1
No. of 1st itemnumber-
no_of_item_2
No. of item 2-10number-
no_of_item_3
No. of item 11+number-
picking_fee
Picking Feedecimal-
packing_fee
Packing Feedecimal-
charge_bubble_wrap
Bubble wrap chargenumber1
charge_insert_time
Insert item chargetimestamp-
shipping_fee
Shipping Feedecimal-
cod_fee
COD Feedecimal-
total_fee
Total Feedecimal-

PUT 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.trustboxfulfillment.com/api/1.0/orders/{id}

Parameter(s)

NameDescriptionTypeLength
id
Required
Trustbox 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
  • REG is ไปรษณีย์ไทย ลงทะเบียน / ThaiPost Registered
  • 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
Example, update order by External ID
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.trustboxfulfill.com/api/1.0/order/@111016-00004"
Example, update order by Trustbox order code
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.Trustboxfulfillment.com/api/1.0/order/1610-006-00004"
Result HTTP 200
{
  "code": 200,
  "external_id": "111016-00004",
  "order_code": "1610-006-00004",
  "updated": "2016-10-18 15:02:51"
}

PUT Cancel order

Cancel a pending order.

Resource URL

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

Parameter(s)

NameDescriptionTypeLength
id
Required
Trustbox order code or External ID
(Please prefix External ID with the @ symbol).
string50
Example, cancel order by External ID
curl -X PUT -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/order/@00100001/cancel"
Example, cancel order by Trustbox order code
curl -X PUT -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.Trustboxfulfillment.com/api/1.0/order/1610-006-00004/cancel"
Result HTTP 200 OK
{
  "code": "200",
}

POST Create order

Create a new order.

Resource URL

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

Request body

NameDescriptionTypeLength
external_id
Required
External ID is a unique key that allows you to link Trustbox order with the Order ID from your system without the need to store additional data on your side.string50
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 amount (allowed on KND, K2D, KSD shipping)decimal7,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
  • 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 namestring200
address
Required
Customer addressstring255
district
Required
District namestring50
province
Required
Province namestring50
postal_code
Required
Postcal Codestring20
mobile_no
Required
Mobile numberstring50
phone_no
Phone numberstring20
email
Emailstring180
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 string60
item_code
Item codestring60
lazada_sku
Lazada SKUstring60
shopee_sku
Shopee SKUstring60
item_qty
Item quantitynumber11
Example
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}
	]
}' "https://oms.trustboxfulfillment.com/api/1.0/order"
Result HTTP 200
{
  "code": 200,
  "external_id": "111016-00004",
  "order_code": "1610-006-00004",
  "created": "2016-10-18 15:02:51"
}

GET Get advice data

Get a single advice detail.

Resource URL

https://oms.trustboxfulfillment.com/api/1.0/advices/{id}

Parameter(s)

NameDescriptionTypeLength
idTrustboxfulfillment advice IDnumber11
Example, get order by Advice ID
curl -X GET -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/advices/103"
Result HTTP 200
{
  "external_id": "cmz_adv_00001",
  "id": "103",
  "comment": "ของมารอบบ่าย",
  "status": "Pending",
  "created": "2016-10-04 13:11:16",
  "updated": "2016-10-05 13:52:20",
  "expect_transfer_date": "2016-10-10",
  "total_qty": "25",
  "items": [
    {
      "item_code": "00600001",
      "item_number": "TEST001",
      "item_sku": "624295_1467662",
      "item_name": "TSG2721/รองเท้าแตะเปิดหน้ามีโบว์ฟ้าอมเทา/12",
      "item_qty": "25",
      "received_qty": "0",
      "putaway_status": "Pending",
      "comment": ""
    }
  ]
}

Documentation

The fields of the result have the following type and meaning:
NameDescriptionTypeLength
external_idExternal ID is a unique key that allows you to link Trustbox advice with the Advice ID from your system.string60
id
Trustbox advice IDnumber11
comment
Advice commentstring250
created
Created datedatetime-
updated
Updated datedatetime-
expect_transfer_date
Expect transfer datedate-
status Advice status
  • Pending
  • Received
  • Putaway
  • Partial Putaway
  • Completed
string 30
total_qty
Total item quantitynumber11
items[]
Required
Array of item(s) in advice
item_sku
Item SKUstring60
item_code
Item codestring20
item_number
Item numberstring20
item_name
Item namestring20
item_qty
Item quantitynumber11
received_qty
Received quantitynumber11
putaway_status
Putaway statusnumber1
comment
commentstring50

PUT Update advice

Updates a pending advice.

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

Resource URL

https://oms.trustboxfulfillment.com/api/1.0/advices/{id}

Parameter(s)

NameDescriptionTypeLength
id
Required
Advice ID or External ID
(Please prefix External ID with the @ symbol).
string60

Request body

NameDescriptionTypeLength
expect_date
Expect datedate-
comment
Advice comment.string250
items[]
Required
Array of item(s) in advice
You can use item_code or item_sku in the array but cannot both be blank
item_sku
Item SKUstring60
item_code
Item codestring20
item_qty
Item quantitynumber11
comment
Item commentstring50
Example, update order by advice ID
curl -X PUT -H "Authorization: Basic ZnJlZDpmcmVk="\
-H "Content-Type: application/json"\ -d '{
	"expect_date":"2016-11-03",
	"commment" :"",
	"items":[
		{"item_code":"00600001","item_qty":99,"comment":""},
		{"item_sku":"5769089_3852259","item_qty":50,"comment":""}
	]
}' "https://oms.trustboxfulfillment.com/api/1.0/advices/108"
Result HTTP 200
{
  "id": "108",
  "external_id": "av001",
  "updated": "2016-11-01 15:34:03"
}

PUT Cancel advice

Cancel a pending order.

Resource URL

https://oms.trustboxfulfillment.com/api/1.0/advices/{id}/cancel

Parameter(s)

NameDescriptionTypeLength
id
Required
Advice ID or External ID
(Please prefix External ID with the @ symbol).
string60
Example, cancel order by advice ID
curl -X PUT -H "Authorization: Basic ZnJlZDpmcmVk="\
"https://oms.trustboxfulfillment.com/api/1.0/advices/106/cancel"
Result HTTP 200
{
  "code": "200",
}

POST Create advice

Create a new advice.

Resource URL

https://oms.trustboxfulfillment.com/api/1.0/advices

Request body

NameDescriptionTypeLength
external_id
Required
External ID is a unique key that allows you to link Trustbox advice with the advice ID from your system without the need to store additional data on your side.string60
expect_date
Expect datedate-
comment
Advice comment.string250
items[]
Required
Array of item(s) in advice
You can use item_code or item_sku in the array but cannot both be blank
item_sku
Item SKUstring60
item_code
Item codestring20
item_qty
Item quantitynumber11
comment
Item commentstring50
Example
curl -X POST -H "Authorization: Basic ZnJlZDpmcmVk="\
-H "Content-Type: application/json"\ -d '{
	"external_id":"test01",
	"expect_date":"2016-11-02",
	"commment" :"",
	"items":[
		{"item_code":"00600001","item_qty":99,"comment":""},
		{"item_sku":"5769089_3852259","item_qty":50,"comment":""}
	]
}' "https://oms.trustboxfulfillment.com/api/1.0/advice"
Result HTTP 200
{
  "id": 108,
}