NAV Navbar
API Version:   V1
Logo
shell ruby python javascript

Introduction

About us

Boxme Global is one-stop solution for Cross-Border E-Commerce seller, who want to become millionaire.

Shipchung is a member of Boxme Global provide shipping gateway for ecommerce.

API Key

How to get your API Key?

Before you started with using our REST API services, you will need to obtain your API key under your own user account.

Login to your Shipchung.vn account (Sign up free) Visit Seller center > Setting > API Key or click this link

Shipchung Vietnam: https://seller.shipchung.vn/#/app/config/key Boxme Vietnam: https://seller.boxme.vn/#/app/config/key Boxme Global: https://seller.boxme.asia/#/app/config/key Click Generate API Key

API end point

Once you’ve registered your API it’s easy to start requesting data from Shipchung.

All endpoints are only accessible via https

Domain sandbox: http://prod.boxme.vn/

User: sandbox@shipchung.vn Pass: 123456

Production API:

Boxme Client: http://services.boxme.vn

Shipchung client: https://services.shipchung.vn

All API call must include this header in order to auth the usage of Shipchung API.

Replace your API_API_KEY with your own key. Shipchung-api-key: YOUR_API_KEY Content-Type: application/json Body

All the request and response are in JSON string. Basic Integration Using the Shipchung API is easy! Follow this step-by-step guide to get shipping rates and create your first shipping labels in minutes.

API Supported

Products

Shipment

Location

Order

Location

Get Province - City List

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/merchant/rest/lading/city")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["headers"] = '{'content-type': 'application/x-www-form-urlencoded'}'
request["content-type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
import requests

url = "http://prod.boxme.vn/api/public/api/merchant/rest/lading/city"

payload = ""
headers = {
    'headers': "{'content-type': 'application/x-www-form-urlencoded'}",
    'content-type': "application/x-www-form-urlencoded"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://prod.boxme.vn/api/public/api/merchant/rest/lading/city \
  --header 'content-type: application/x-www-form-urlencoded' \
  --header 'headers: {'\''content-type'\'': '\''application/x-www-form-urlencoded'\''}'
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://prod.boxme.vn/api/public/api/merchant/rest/lading/city");
xhr.setRequestHeader("headers", "{'content-type': 'application/x-www-form-urlencoded'}");
xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": false,
  "error_message": "success",
  "data": [
    {
      "CityId": 18,
      "CityName": "Hà Nội"
    },
    {
      "CityId": 52,
      "CityName": "TP.Hồ Chí Minh"
    },
    {
      "CityId": 56,
      "CityName": "An Giang"
    },
    {
      "CityId": 54,
      "CityName": "Bà Rịa -  Vũng Tàu"
    },
    {
      "CityId": 19,
      "CityName": "Bắc Giang"
    },
    {
      "CityId": 6,
      "CityName": "Bắc Kạn"
    },
    {
      "CityId": 65,
      "CityName": "Bạc Liêu"
    },
    {
      "CityId": 2,
      "CityName": "Bắc Ninh"
    },
    {
      "CityId": 60,
      "CityName": "Bến Tre"
    },
    {
      "CityId": 49,
      "CityName": "Bình Dương"
    },
    {
      "CityId": 39,
      "CityName": "Bình Định "
    },
    {
      "CityId": 45,
      "CityName": "Bình Phước "
    },
    {
      "CityId": 51,
      "CityName": "Bình Thuận"
    },
    {
      "CityId": 68,
      "CityName": "Cà Mau"
    },
    {
      "CityId": 59,
      "CityName": "Cần Thơ"
    },
    {
      "CityId": 1,
      "CityName": "Cao Bằng"
    },
    {
      "CityId": 35,
      "CityName": "Đà Nẵng"
    },
    {
      "CityId": 42,
      "CityName": "Đăk Lăk "
    },
    {
      "CityId": 44,
      "CityName": "Đăk Nông"
    },
    {
      "CityId": 10,
      "CityName": "Điện Biên"
    },
    {
      "CityId": 50,
      "CityName": "Đồng Nai"
    },
    {
      "CityId": 57,
      "CityName": "Đồng Tháp"
    },
    {
      "CityId": 40,
      "CityName": "Gia Lai"
    },
    {
      "CityId": 3,
      "CityName": "Hà Giang"
    },
    {
      "CityId": 25,
      "CityName": "Hà Nam"
    },
    {
      "CityId": 31,
      "CityName": "Hà Tĩnh"
    },
    {
      "CityId": 22,
      "CityName": "Hải Dương"
    },
    {
      "CityId": 24,
      "CityName": "Hải Phòng"
    },
    {
      "CityId": 63,
      "CityName": "Hậu Giang"
    },
    {
      "CityId": 23,
      "CityName": "Hòa Bình"
    },
    {
      "CityId": 8,
      "CityName": "Hưng Yên"
    },
    {
      "CityId": 43,
      "CityName": "Khánh Hòa"
    },
    {
      "CityId": 62,
      "CityName": "Kiên Giang"
    },
    {
      "CityId": 38,
      "CityName": "Kon Tum"
    },
    {
      "CityId": 4,
      "CityName": "Lai Châu"
    },
    {
      "CityId": 46,
      "CityName": "Lâm Đồng"
    },
    {
      "CityId": 14,
      "CityName": "Lạng Sơn"
    },
    {
      "CityId": 5,
      "CityName": "Lào Cai"
    },
    {
      "CityId": 53,
      "CityName": "Long An "
    },
    {
      "CityId": 28,
      "CityName": "Nam Định"
    },
    {
      "CityId": 30,
      "CityName": "Nghệ An"
    },
    {
      "CityId": 27,
      "CityName": "Ninh Bình"
    },
    {
      "CityId": 47,
      "CityName": "Ninh Thuận"
    },
    {
      "CityId": 17,
      "CityName": "Phú Thọ"
    },
    {
      "CityId": 9,
      "CityName": "Phú Yên"
    },
    {
      "CityId": 32,
      "CityName": "Quảng Bình"
    },
    {
      "CityId": 36,
      "CityName": "Quảng Nam "
    },
    {
      "CityId": 37,
      "CityName": "Quảng Ngãi"
    },
    {
      "CityId": 20,
      "CityName": "Quảng Ninh"
    },
    {
      "CityId": 33,
      "CityName": "Quảng Trị"
    },
    {
      "CityId": 13,
      "CityName": "Sóc Trăng"
    },
    {
      "CityId": 16,
      "CityName": "Sơn La"
    },
    {
      "CityId": 48,
      "CityName": "Tây Ninh"
    },
    {
      "CityId": 26,
      "CityName": "Thái Bình"
    },
    {
      "CityId": 12,
      "CityName": "Thái Nguyên"
    },
    {
      "CityId": 29,
      "CityName": "Thanh Hóa"
    },
    {
      "CityId": 34,
      "CityName": "Thừa Thiên Huế"
    },
    {
      "CityId": 58,
      "CityName": "Tiền Giang"
    },
    {
      "CityId": 64,
      "CityName": "Trà Vinh"
    },
    {
      "CityId": 7,
      "CityName": "Tuyên Quang"
    },
    {
      "CityId": 61,
      "CityName": "Vĩnh Long"
    },
    {
      "CityId": 15,
      "CityName": "Vĩnh Phúc"
    },
    {
      "CityId": 11,
      "CityName": "Yên Bái"
    }
  ]
}

HTTP Request

GET http://prod.boxme.vn/api/public/api/merchant/rest/lading/city

Query Parameters

Parameter Default Description
headers false ‘content-type’: ‘application/x-www-form-urlencoded’.

Get District List by Province - City ID

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/merchant/rest/lading/province/18")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["headers"] = '{'content-type': 'application/x-www-form-urlencoded'}'
request["content-type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
import requests

url = "http://prod.boxme.vn/api/public/api/merchant/rest/lading/province/18"

payload = ""
headers = {
    'headers': "{'content-type': 'application/x-www-form-urlencoded'}",
    'content-type': "application/x-www-form-urlencoded"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://prod.boxme.vn/api/public/api/merchant/rest/lading/province/18 \
  --header 'content-type: application/x-www-form-urlencoded' \
  --header 'headers: {'\''content-type'\'': '\''application/x-www-form-urlencoded'\''}'
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://prod.boxme.vn/api/public/api/merchant/rest/lading/province/18");
xhr.setRequestHeader("headers", "{'content-type': 'application/x-www-form-urlencoded'}");
xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": false,
  "error_message": "success",
  "data": [
    {
      "ProvinceId": 568,
      "ProvinceName": "Quận Thủ Đức",
      "Remote": 1
    },
    {
      "ProvinceId": 552,
      "ProvinceName": "Quận Tân Phú",
      "Remote": 1
    },
    {
      "ProvinceId": 551,
      "ProvinceName": "Quận Tân Bình",
      "Remote": 1
    },
    {
      "ProvinceId": 570,
      "ProvinceName": "Quận Phú Nhuận",
      "Remote": 1
    },
    {
      "ProvinceId": 561,
      "ProvinceName": "Quận Gò Vấp",
      "Remote": 1
    },
    {
      "ProvinceId": 569,
      "ProvinceName": "Quận Bình Thạnh",
      "Remote": 1
    },
    {
      "ProvinceId": 564,
      "ProvinceName": "Quận Bình Tân",
      "Remote": 1
    },
    {
      "ProvinceId": 558,
      "ProvinceName": "Quận 9",
      "Remote": 1
    },
    {
      "ProvinceId": 565,
      "ProvinceName": "Quận 8",
      "Remote": 1
    },
    {
      "ProvinceId": 556,
      "ProvinceName": "Quận 7",
      "Remote": 1
    },
    {
      "ProvinceId": 548,
      "ProvinceName": "Quận 6",
      "Remote": 1
    },
    {
      "ProvinceId": 549,
      "ProvinceName": "Quận 5",
      "Remote": 1
    },
    {
      "ProvinceId": 566,
      "ProvinceName": "Quận 4",
      "Remote": 1
    },
    {
      "ProvinceId": 550,
      "ProvinceName": "Quận 3",
      "Remote": 1
    },
    {
      "ProvinceId": 571,
      "ProvinceName": "Quận 2",
      "Remote": 1
    },
    {
      "ProvinceId": 557,
      "ProvinceName": "Quận 12",
      "Remote": 1
    },
    {
      "ProvinceId": 562,
      "ProvinceName": "Quận 11",
      "Remote": 1
    },
    {
      "ProvinceId": 555,
      "ProvinceName": "Quận 10",
      "Remote": 1
    },
    {
      "ProvinceId": 560,
      "ProvinceName": "Quận 1",
      "Remote": 1
    },
    {
      "ProvinceId": 554,
      "ProvinceName": "Huyện Nhà Bè",
      "Remote": 1
    },
    {
      "ProvinceId": 563,
      "ProvinceName": "Huyện Hóc Môn",
      "Remote": 1
    },
    {
      "ProvinceId": 553,
      "ProvinceName": "Huyện Củ Chi",
      "Remote": 1
    },
    {
      "ProvinceId": 559,
      "ProvinceName": "Huyện Cần Giờ",
      "Remote": 1
    },
    {
      "ProvinceId": 567,
      "ProvinceName": "Huyện Bình Chánh",
      "Remote": 1
    }
  ]
}

HTTP Request

GET http://prod.boxme.vn/api/public/api/merchant/rest/lading/province/18

Query Parameters

Parameter Default Description
headers false ‘content-type’: ‘application/x-www-form-urlencoded’.

Get Ward by District ID

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/merchant/rest/lading/ward/172")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["headers"] = '{'content-type': 'application/x-www-form-urlencoded'}'
request["content-type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
import requests

url = "http://prod.boxme.vn/api/public/api/merchant/rest/lading/ward/172"

payload = ""
headers = {
    'headers': "{'content-type': 'application/x-www-form-urlencoded'}",
    'content-type': "application/x-www-form-urlencoded"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://prod.boxme.vn/api/public/api/merchant/rest/lading/ward/172 \
  --header 'content-type: application/x-www-form-urlencoded' \
  --header 'headers: {'\''content-type'\'': '\''application/x-www-form-urlencoded'\''}'
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://prod.boxme.vn/api/public/api/merchant/rest/lading/ward/172");
xhr.setRequestHeader("headers", "{'content-type': 'application/x-www-form-urlencoded'}");
xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": false,
  "error_message": "success",
  "data": [
    {
      "WardId": 6707,
      "WardName": "Thị Trấn đoan Hùng"
    },
    {
      "WardId": 6726,
      "WardName": "Xã Bằng Doãn"
    },
    {
      "WardId": 6710,
      "WardName": "Xã Bằng Luân"
    },
    {
      "WardId": 6711,
      "WardName": "Xã Ca đình"
    },
    {
      "WardId": 6732,
      "WardName": "Xã Chân Mộng"
    },
    {
      "WardId": 6713,
      "WardName": "Xã Chi đám"
    },
    {
      "WardId": 6720,
      "WardName": "Xã đại Nghĩa"
    },
    {
      "WardId": 6723,
      "WardName": "Xã đông Khê"
    },
    {
      "WardId": 6712,
      "WardName": "Xã Hùng Long"
    },
    {
      "WardId": 6725,
      "WardName": "Xã Hùng Quan"
    },
    {
      "WardId": 6729,
      "WardName": "Xã Hữu đô"
    },
    {
      "WardId": 6731,
      "WardName": "Xã Minh Phú"
    },
    {
      "WardId": 6724,
      "WardName": "Xã Nghinh Xuyên"
    },
    {
      "WardId": 6708,
      "WardName": "Xã Ngọc Quan"
    },
    {
      "WardId": 6727,
      "WardName": "Xã Phong Phú"
    },
    {
      "WardId": 6721,
      "WardName": "Xã Phú Thứ"
    },
    {
      "WardId": 6728,
      "WardName": "Xã Phúc Lai"
    },
    {
      "WardId": 6715,
      "WardName": "Xã Phương Trung"
    },
    {
      "WardId": 6722,
      "WardName": "Xã Quế Lâm"
    },
    {
      "WardId": 6714,
      "WardName": "Xã Sóc đăng"
    },
    {
      "WardId": 6709,
      "WardName": "Xã Tây Cốc"
    },
    {
      "WardId": 6717,
      "WardName": "Xã Tiêu Sơn"
    },
    {
      "WardId": 6719,
      "WardName": "Xã Vân Du"
    },
    {
      "WardId": 6718,
      "WardName": "Xã Vân đồn"
    },
    {
      "WardId": 6730,
      "WardName": "Xã Vụ Quang"
    },
    {
      "WardId": 6716,
      "WardName": "Xã Yên Kiện"
    }
  ]
}

HTTP Request

GET http://prod.boxme.vn/api/public/api/merchant/rest/lading/ward/172

Query Parameters

Parameter Default Description
headers false ‘content-type’: ‘application/x-www-form-urlencoded’.

Product

Get Lists Inventory

To authorize, use this code:

require 'uri'
require 'net/http'
url = URI("http://prod.boxme.vn/api/public/bxapi/list_inventory-sdk")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{}"

headers = { 'content-type': "application/json" }

conn.request("GET", "/api/public/bxapi/list_inventory-sdk", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://prod.boxme.vn/api/public/bxapi/list_inventory-sdk \
  --header 'content-type: application/json' \
  --data '{}'
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "http://prod.boxme.vn/api/public/bxapi/list_inventory-sdk",
  "method": "GET",
  "headers": {
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

The above command returns JSON structured like this:

{
  "inventory": [
    {
      "City": "TP. Hồ Chí Minh",
      "Code": null,
      "Name": "Kho - Huyện Nhà Bè - TP.Hồ Chí Minh",
      "District": "Huyện Nhà Bè",
      "Phone": "0938131593",
      "InventoryId": "92932",
      "Type": 0,
      "AddressLine": "aaa"
    }
  ]
}

HTTP Request

GET http://prod.boxme.vn/api/public/bxapi/list_inventory-sdk

Query Parameters

Parameter Default Description
ApiKey false Your api key of seller.

Edit Product

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/bxapi/edit-product-sdk")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"InventoryId\":\"137123\",\"ApiKey\":\"7e4e80c6bdb03c5a2d639c4828bcf156\",\"SellerSKU\":\"KA-07\",\"Name\":\"iphone 9 \",\"Description\":\"Iphone 7s black new 100%\",\"BasePrice\":10000,\"SalePrice\":20000,\"Weight\":1223,\"Volume\":\"\",\"ProductImages\":\"\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{\"InventoryId\":\"137123\",\"ApiKey\":\"7e4e80c6bdb03c5a2d639c4828bcf156\",\"SellerSKU\":\"KA-07\",\"Name\":\"iphone 9 \",\"Description\":\"Iphone 7s black new 100%\",\"BasePrice\":10000,\"SalePrice\":20000,\"Weight\":1223,\"Volume\":\"\",\"ProductImages\":\"\"}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/public/bxapi/edit-product-sdk", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/bxapi/edit-product-sdk \
  --header 'content-type: application/json' \
  --data '{"InventoryId":"137123","ApiKey":"7e4e80c6bdb03c5a2d639c4828bcf156","SellerSKU":"KA-07","Name":"iphone 9 ","Description":"Iphone 7s black new 100%","BasePrice":10000,"SalePrice":20000,"Weight":1223,"Volume":"","ProductImages":""}'
var data = JSON.stringify({
  "InventoryId": "137123",
  "ApiKey": "7e4e80c6bdb03c5a2d639c4828bcf156",
  "SellerSKU": "KA-07",
  "Name": "iphone 9 ",
  "Description": "Iphone 7s black new 100%",
  "BasePrice": 10000,
  "SalePrice": 20000,
  "Weight": 1223,
  "Volume": "",
  "ProductImages": ""
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/bxapi/edit-product-sdk");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "Name": "iphone 9 ",
  "SalePrice": 20000,
  "BasePrice": 10000,
  "SellerId": "87695",
  "Description": "Iphone 7s black new 100%",
  "QuantityUnit": null,
  "SellerSKU": "KA-07",
  "Weight": 1223,
  "Volume": null,
  "InventoryId": "137123",
  "ProductId": "88999"
}

HTTP Request

POST http://prod.boxme.vn/api/public/bxapi/edit-product-sdk

Query Parameters

Parameter Default Description
ApiKey false You Key API.
SellerSKU false Product code (sku) to edit.
Name false New product name.
InventoryId false New ID warehouse (Pickup address config).
Description false New product description .
BasePrice false New product base price .
SalePrice false New product sale price (Price to create orders) .
Weight false New product weight (weight to create orders) .
Volume false New Volume product .

Add Product

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/bxapi/product-sdk")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"InventoryId\":\"105341\",\"ApiKey\":\"7e4e80c6bdb03c5a2d639c4828bcf156\",\"SellerSKU\":\"Test-Pro-IP7S\",\"Name\":\"IPhone 7s Black\",\"CategoryName\":\"Phone\",\"SupplierName\":\"Apple\",\"BrandName\":\"Apple\",\"Description\":\"Iphone 7s black new 100%\",\"ProductTags\":\"iphone,iphone7s,iphone7\",\"Quantity\":50,\"BasePrice\":16000000,\"SalePrice\":16500000,\"BarcodeManufacturer\":\"IP7SABC\",\"ModelName\":\"IPhone7s\",\"Weight\":200,\"Volume\":\"2x2x2\",\"ProductImages\":\"\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{\"InventoryId\":\"105341\",\"ApiKey\":\"7e4e80c6bdb03c5a2d639c4828bcf156\",\"SellerSKU\":\"Test-Pro-IP7S\",\"Name\":\"IPhone 7s Black\",\"CategoryName\":\"Phone\",\"SupplierName\":\"Apple\",\"BrandName\":\"Apple\",\"Description\":\"Iphone 7s black new 100%\",\"ProductTags\":\"iphone,iphone7s,iphone7\",\"Quantity\":50,\"BasePrice\":16000000,\"SalePrice\":16500000,\"BarcodeManufacturer\":\"IP7SABC\",\"ModelName\":\"IPhone7s\",\"Weight\":200,\"Volume\":\"2x2x2\",\"ProductImages\":\"\"}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/public/bxapi/product-sdk", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/bxapi/product-sdk \
  --header 'content-type: application/json' \
  --data '{"InventoryId":"105341","ApiKey":"7e4e80c6bdb03c5a2d639c4828bcf156","SellerSKU":"Test-Pro-IP7S","Name":"IPhone 7s Black","CategoryName":"Phone","SupplierName":"Apple","BrandName":"Apple","Description":"Iphone 7s black new 100%","ProductTags":"iphone,iphone7s,iphone7","Quantity":50,"BasePrice":16000000,"SalePrice":16500000,"BarcodeManufacturer":"IP7SABC","ModelName":"IPhone7s","Weight":200,"Volume":"2x2x2","ProductImages":""}'
var data = JSON.stringify({
  "InventoryId": "105341",
  "ApiKey": "7e4e80c6bdb03c5a2d639c4828bcf156",
  "SellerSKU": "Test-Pro-IP7S",
  "Name": "IPhone 7s Black",
  "CategoryName": "Phone",
  "SupplierName": "Apple",
  "BrandName": "Apple",
  "Description": "Iphone 7s black new 100%",
  "ProductTags": "iphone,iphone7s,iphone7",
  "Quantity": 50,
  "BasePrice": 16000000,
  "SalePrice": 16500000,
  "BarcodeManufacturer": "IP7SABC",
  "ModelName": "IPhone7s",
  "Weight": 200,
  "Volume": "2x2x2",
  "ProductImages": ""
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/bxapi/product-sdk");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "WeightUnit": 1,
  "BrandName": "brank",
  "SalePrice": 2000,
  "BasePrice": 1000,
  "SupplierName": "soupper",
  "Name": "San pham Test",
  "Description": "Description testt",
  "Volume": "2x2x2",
  "ManufactureBarcode": null,
  "SellerId": "30788",
  "Quantity": 200,
  "ModelName": "moel",
  "SupplierId": null,
  "ModelId": null,
  "ExternalUrl": null,
  "CategoryId": null,
  "CategoryName": "Dien Thoai",
  "QuantityUnit": 1,
  "SellerSKU": "Biaaaa",
  "Weight": 200,
  "BrandId": "",
  "InventoryId": "36",
  "ProductTags": "tag 1 tag 2",
  "ProductId": "11584"
}

HTTP Request

POST http://prod.boxme.vn/api/public/bxapi/product-sdk

Query Parameters

Parameter Default Description
ApiKey false You Key API.
SellerSKU false Product code (sku) to edit.
InventoryId false Id inventory (not boxme).
Name false Product Name.
CategoryName false Product CategoryName .
SupplierName false Product SupplierName .
BrandName false Product Brand.
Description false Product Description.
ProductTags false Product tag.
Quantity false Product quantity.
BasePrice false New product base price.
SalePrice false New product sale price (Price to create orders) .
Weight false New product weight (weight to create orders).
BarcodeManufacturer false Barcode (if exist).
ProductImages false Images (if exist) .

Get Lists Product

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/bxapi/list_product-sdk")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{}"

headers = { 'content-type': "application/json" }

conn.request("GET", "/api/public/bxapi/list_product-sdk", payload, headers)

res = conn.getresponse()
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://prod.boxme.vn/api/public/bxapi/list_product-sdk \
  --header 'content-type: application/json' \
  --data '{}'
var data = JSON.stringify({});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://prod.boxme.vn/api/public/bxapi/list_product-sdk");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "total_items": 26,
  "data": {
    "product": [
      {
        "Name": "iphone 9 ",
        "InventoryName": "Giau test",
        "SalePrice": 200000,
        "BasePrice": 10000,
        "Description": "Iphone 7s black new 100%",
        "SellerSKU": "A-377AAEE",
        "Weight": 1223,
        "ProductImages": [],
        "InventoryId": 137123,
        "Quantity": 1,
        "ProductId": "89034",
        "ToBoxme": false
      }
    ]
  }
}

HTTP Request

GET http://prod.boxme.vn/api/public/bxapi/list_product-sdk

Query Parameters

Parameter Default Description
ApiKey false You Key API.

Get List Product To Create Order

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/bxapi/get_list_products_create_order")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{}"

headers = { 'content-type': "application/json" }

conn.request("GET", "/api/public/bxapi/get_list_products_create_order", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://prod.boxme.vn/api/public/bxapi/get_list_products_create_order \
  --header 'content-type: application/json' \
  --data '{}'
var data = JSON.stringify({});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://prod.boxme.vn/api/public/bxapi/get_list_products_create_order");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "total_items": 1,
  "data": {
    "product": [
      {
        "InventoryName": "Vĩnh Lộc - HCM",
        "Waiting": 0,
        "InventoryLimit": 0,
        "SalePrice": "150000",
        "SellerSKU": "PO-150M4NU",
        "Weight": 200,
        "InventoryId": 133902,
        "Name": "Đồng hồ CẶP thời trang Pollock + 2 Pin dự phòng",
        "Quantity": 24,
        "ProductId": "88954"
      }
    ]
  }
}

HTTP Request

GET http://prod.boxme.vn/api/public/bxapi/get_list_products_create_order

Query Parameters

Parameter Default Description
ApiKey false You Key API.
inventory_id false ID inventory(boxme) (non-mandatory).
sellerSKU false SKU (non-mandatory).

Shipment

Create Shipment

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/bxapi/shipment-sdk")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"ApiKey\":\"7e4e80c6bdb03c5a2d639c4828bcf156\",\"ShipToAddress\":{\"InventoryId\":133455},\"ShipFromAddress\":{\"InventoryId\":105341},\"TypeTransport\":1,\"ShipmentStatus\":\"ReadyToShip\",\"Volumes\":\"10x10x10\",\"Weight\":500,\"ShippingMethod\":\"MYSELF\",\"ShipmentItems\":[{\"SKU\":\"14398602\",\"QuantityShipped\":100}]}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{\"ApiKey\":\"7e4e80c6bdb03c5a2d639c4828bcf156\",\"ShipToAddress\":{\"InventoryId\":133455},\"ShipFromAddress\":{\"InventoryId\":105341},\"TypeTransport\":1,\"ShipmentStatus\":\"ReadyToShip\",\"Volumes\":\"10x10x10\",\"Weight\":500,\"ShippingMethod\":\"MYSELF\",\"ShipmentItems\":[{\"SKU\":\"14398602\",\"QuantityShipped\":100}]}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/public/bxapi/shipment-sdk", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/bxapi/shipment-sdk \
  --header 'content-type: application/json' \
  --data '{"ApiKey":"7e4e80c6bdb03c5a2d639c4828bcf156","ShipToAddress":{"InventoryId":133455},"ShipFromAddress":{"InventoryId":105341},"TypeTransport":1,"ShipmentStatus":"ReadyToShip","Volumes":"10x10x10","Weight":500,"ShippingMethod":"MYSELF","ShipmentItems":[{"SKU":"14398602","QuantityShipped":100}]}'
var data = JSON.stringify({
  "ApiKey": "7e4e80c6bdb03c5a2d639c4828bcf156",
  "ShipToAddress": {
    "InventoryId": 133455
  },
  "ShipFromAddress": {
    "InventoryId": 105341
  },
  "TypeTransport": 1,
  "ShipmentStatus": "ReadyToShip",
  "Volumes": "10x10x10",
  "Weight": 500,
  "ShippingMethod": "MYSELF",
  "ShipmentItems": [
    {
      "SKU": "14398602",
      "QuantityShipped": 100
    }
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/bxapi/shipment-sdk");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "inventory": [
    {
      "City": "TP. Hồ Chí Minh",
      "Code": null,
      "Name": "Kho - Huyện Nhà Bè - TP.Hồ Chí Minh",
      "District": "Huyện Nhà Bè",
      "Phone": "0938131593",
      "InventoryId": "92932",
      "Type": 0,
      "AddressLine": "aaa"
    }
  ]
}

HTTP Request

POST http://prod.boxme.vn/api/public/bxapi/shipment-sdk

Query Parameters

Parameter Default Description
ApiKey false Your api key of seller.

Orders

Calculate Shipping fee

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/rest/courier/calculate")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"From\":{\"City\":18,\"Province\":167},\"To\":{\"City\":54,\"Province\":587},\"Order\":{\"Amount\":503400,\"Weight\":2000},\"Config\":{\"Service\":2,\"CoD\":1,\"Protected\":1,\"Checking\":1,\"Payment\":2,\"Fragile\":2},\"Domain\":\"haravan.com\",\"MerchantKey\":\"e80d1bb5cde172364fdd6c338b8966ac\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{\"From\":{\"City\":18,\"Province\":167},\"To\":{\"City\":54,\"Province\":587},\"Order\":{\"Amount\":503400,\"Weight\":2000},\"Config\":{\"Service\":2,\"CoD\":1,\"Protected\":1,\"Checking\":1,\"Payment\":2,\"Fragile\":2},\"Domain\":\"haravan.com\",\"MerchantKey\":\"e80d1bb5cde172364fdd6c338b8966ac\"}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/public/api/rest/courier/calculate", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/api/rest/courier/calculate \
  --header 'content-type: application/json' \
  --data '{"From":{"City":18,"Province":167},"To":{"City":54,"Province":587},"Order":{"Amount":503400,"Weight":2000},"Config":{"Service":2,"CoD":1,"Protected":1,"Checking":1,"Payment":2,"Fragile":2},"Domain":"haravan.com","MerchantKey":"e80d1bb5cde172364fdd6c338b8966ac"}'
var data = JSON.stringify({
  "From": {
    "City": 18,
    "Province": 167
  },
  "To": {
    "City": 54,
    "Province": 587
  },
  "Order": {
    "Amount": 503400,
    "Weight": 2000
  },
  "Config": {
    "Service": 2,
    "CoD": 1,
    "Protected": 1,
    "Checking": 1,
    "Payment": 2,
    "Fragile": 2
  },
  "Domain": "haravan.com",
  "MerchantKey": "e80d1bb5cde172364fdd6c338b8966ac"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/api/rest/courier/calculate");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": "success",
  "error_message": "Tính phí thành công",
  "data": {
    "fee": {
      "total_fee": 0,
      "vas": {
        "protected": 0
      },
      "collect": 250000,
      "base_collect": 250000,
      "total_vas": 0,
      "seller": {
        "pvc": 0,
        "pcod": 0
      },
      "discount": {
        "seller": 0
      }
    },
    "inventory": 24531,
    "courier": {
      "system": {
        "courier_id": 1,
        "courier_name": "Viettel Post",
        "money_pickup": 10000,
        "money_delivery": 0,
        "leatime_pickup": 54809,
        "optional": 0,
        "leatime_delivery": 36,
        "leatime_ward": 0,
        "leatime_total": 54845
      }
    }
  }
}

HTTP Request

POST http://prod.boxme.vn/api/public/api/rest/courier/calculate

Query Parameters

Parameter Default Description
ApiKey (MerchantKey) false Your api key of seller.
From.City false From city send order.
From.Province false From province send order.
From.Province false From province send order.
To.City false To city receive order.
To.Province false To province receive order.
Order.Amount false Order amount.
Order.Weight false Order weight.
Config.Service false Shipping method:1. Economy delivery service,2. Express delivery service.
Config.CoD false Cash On Delivery (COD) 1: Use; 2: Don’t use.
Config.Protected false Insurance.
Config.Checking false Accept receiver view item in order before confirm received or not.
Config.Payment false Payment.
Config.Fragile false Fragile.

Create Order Fulfillment (Boxme)

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/rest/courier/create")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"Domain\":\"boxme.vn\",\"MerchantKey\":\"e80d1bb5cde172364fdd6c338b89661ac\",\"From\":{\"City\":52,\"Province\":551,\"Stock\":104047,\"Ward\":4394,\"Address\":\"89A Thăng Long, Phường 4, Quận Tân bình, TP Hồ Chí Minh\",\"Phone\":\"1668669897\",\"Name\":\"Nguyễn Anh Bảo Quốc\"},\"Courier\":1,\"To\":{\"City\":46,\"Province\":496,\"Address\":\"TRƯỜNG MẪU GIÁO TÂN THƯỢNG - Thôn 2, Xã Tân Thượng, Huyện Di Linh Xã Tân Thượng, Huyện Di Linh, Lâm Đồng\",\"Country\":237,\"Ward\":\"5243\",\"Phone\":\"0914392331\",\"PhoneCode\":\"84\",\"Name\":\"Nguyễn Thị Sen\"},\"Items\":[{\"Name\":\"Cám Gạo Tinh Nghệ Mật Ong Nguyên Chất\",\"Price\":700000,\"Quantity\":22,\"Weight\":600,\"BSIN\":\"CGT-12\"}],\"Order\":{\"Weight\":600,\"Amount\":700000,\"Quantity\":2,\"Collect\":\"400000\",\"ProductName\":\"Cám Gạo Tinh Nghệ Mật Ong Nguyên Chất\"},\"Config\":{\"Service\":1,\"Protected\":2,\"Checking\":1,\"Fragile\":2,\"CoD\":1,\"Payment\":1,\"AutoAccept\":1}}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{\"Domain\":\"boxme.vn\",\"MerchantKey\":\"e80d1bb5cde172364fdd6c338b89661ac\",\"From\":{\"City\":52,\"Province\":551,\"Stock\":104047,\"Ward\":4394,\"Address\":\"89A Thăng Long, Phường 4, Quận Tân bình, TP Hồ Chí Minh\",\"Phone\":\"1668669897\",\"Name\":\"Nguyễn Anh Bảo Quốc\"},\"Courier\":1,\"To\":{\"City\":46,\"Province\":496,\"Address\":\"TRƯỜNG MẪU GIÁO TÂN THƯỢNG - Thôn 2, Xã Tân Thượng, Huyện Di Linh Xã Tân Thượng, Huyện Di Linh, Lâm Đồng\",\"Country\":237,\"Ward\":\"5243\",\"Phone\":\"0914392331\",\"PhoneCode\":\"84\",\"Name\":\"Nguyễn Thị Sen\"},\"Items\":[{\"Name\":\"Cám Gạo Tinh Nghệ Mật Ong Nguyên Chất\",\"Price\":700000,\"Quantity\":22,\"Weight\":600,\"BSIN\":\"CGT-12\"}],\"Order\":{\"Weight\":600,\"Amount\":700000,\"Quantity\":2,\"Collect\":\"400000\",\"ProductName\":\"Cám Gạo Tinh Nghệ Mật Ong Nguyên Chất\"},\"Config\":{\"Service\":1,\"Protected\":2,\"Checking\":1,\"Fragile\":2,\"CoD\":1,\"Payment\":1,\"AutoAccept\":1}}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/public/api/rest/courier/create", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/api/rest/courier/create \
  --header 'content-type: application/json' \
  --data '{"Domain":"boxme.vn","MerchantKey":"e80d1bb5cde172364fdd6c338b89661ac","From":{"City":52,"Province":551,"Stock":104047,"Ward":4394,"Address":"89A Thăng Long, Phường 4, Quận Tân bình, TP Hồ Chí Minh","Phone":"1668669897","Name":"Nguyễn Anh Bảo Quốc"},"Courier":1,"To":{"City":46,"Province":496,"Address":"TRƯỜNG MẪU GIÁO TÂN THƯỢNG - Thôn 2, Xã Tân Thượng, Huyện Di Linh Xã Tân Thượng, Huyện Di Linh, Lâm Đồng","Country":237,"Ward":"5243","Phone":"0914392331","PhoneCode":"84","Name":"Nguyễn Thị Sen"},"Items":[{"Name":"Cám Gạo Tinh Nghệ Mật Ong Nguyên Chất","Price":700000,"Quantity":22,"Weight":600,"BSIN":"CGT-12"}],"Order":{"Weight":600,"Amount":700000,"Quantity":2,"Collect":"400000","ProductName":"Cám Gạo Tinh Nghệ Mật Ong Nguyên Chất"},"Config":{"Service":1,"Protected":2,"Checking":1,"Fragile":2,"CoD":1,"Payment":1,"AutoAccept":1}}'
var data = JSON.stringify({
  "Domain": "boxme.vn",
  "MerchantKey": "e80d1bb5cde172364fdd6c338b89661ac",
  "From": {
    "City": 52,
    "Province": 551,
    "Stock": 104047,
    "Ward": 4394,
    "Address": "89A Thăng Long, Phường 4, Quận Tân bình, TP Hồ Chí Minh",
    "Phone": "1668669897",
    "Name": "Nguyễn Anh Bảo Quốc"
  },
  "Courier": 1,
  "To": {
    "City": 46,
    "Province": 496,
    "Address": "TRƯỜNG MẪU GIÁO TÂN THƯỢNG - Thôn 2, Xã Tân Thượng, Huyện Di Linh Xã Tân Thượng, Huyện Di Linh, Lâm Đồng",
    "Country": 237,
    "Ward": "5243",
    "Phone": "0914392331",
    "PhoneCode": "84",
    "Name": "Nguyễn Thị Sen"
  },
  "Items": [
    {
      "Name": "Cám Gạo Tinh Nghệ Mật Ong Nguyên Chất",
      "Price": 700000,
      "Quantity": 22,
      "Weight": 600,
      "BSIN": "CGT-12"
    }
  ],
  "Order": {
    "Weight": 600,
    "Amount": 700000,
    "Quantity": 2,
    "Collect": "400000",
    "ProductName": "Cám Gạo Tinh Nghệ Mật Ong Nguyên Chất"
  },
  "Config": {
    "Service": 1,
    "Protected": 2,
    "Checking": 1,
    "Fragile": 2,
    "CoD": 1,
    "Payment": 1,
    "AutoAccept": 1
  }
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/api/rest/courier/create");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": "success",
  "error_message": "Tạo vận đơn thành công",
  "data": {
    "TrackingCode": "SC5732160351",
    "CourierId": 1,
    "MoneyCollect": 250000,
    "ShowFee": {
      "pvc": 0,
      "cod": 0,
      "pbh": 0
    },
    "Discount": {
      "seller": 0
    }
  }
}

HTTP Request

POST http://prod.boxme.vn/api/public/api/rest/courier/create

Query Parameters

Parameter Default Description
ApiKey (MerchantKey) false Your api key of seller.
Courier false Courier.
From.City false City inventory.
From.Province false Province inventoryr.
From.Stock false Id inventory.
From.Ward false Ward inventory.
From.Address false Address inventory.
From.Phone false Phone seller.
From.Name false Name seller.
To.City false City receive order.
To.Province false Province receive order.
To.Country false Country receive order.
To.Ward false Ward receive order.
To.Address false Address receive order.
To.Phone false Phone buyer.
To.Name false Name buyer.
To.PhoneCode false Name seller.
Items.Name false Name product.
Items.Price false Price product.
Items.Quantity false Quantity product.
Items.Weight false Weight product.
Items.BSIN false BSIN product.
Order.Weight false Total weight of item in order.
Order.Amount false Total product value.
Order.Quantity false Total quantity of item in order.
Order.Collect false Total money collect from buyer( when you use CoD). Currency: VND.
Order.ProductName false Info orders.
Config.Service false Shipping method:1. Economy delivery service,2. Express delivery service.
Config.CoD false Cash On Delivery (COD) 1: Use; 2: Don’t use.
Config.Protected false Insurance.
Config.Checking false Accept receiver view item in order before confirm received or not.
Config.Payment false Payment.
Config.Fragile false Fragile.
Config.AutoAccept false 1.Auto accept 0. No accept (default).

Create Shipping Order (Only Ship)

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/rest/courier/create")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"From\":{\"City\":18,\"Province\":167,\"Ward\":479,\"Name\":\"Fashion Collections\",\"Phone\":\"123123123\",\"Address\":\"123/67 PVH\"},\"To\":{\"City\":54,\"Province\":587,\"Ward\":11250,\"Name\":\"HCK\",\"Phone\":\"123123123123\",\"Address\":\"123/67 Phan Van Hon\"},\"Order\":{\"Amount\":503400,\"Weight\":2000,\"Code\":4,\"Quantity\":1,\"ProductName\":\"Leather shoes (M)\"},\"Type\":\"excel\",\"Config\":{\"Service\":2,\"CoD\":1,\"Protected\":1,\"Checking\":1,\"Payment\":2,\"Fragile\":2,\"AutoAccept\":0},\"Domain\":\"haravan.com\",\"MerchantKey\":\"e80d1bb5cde172364fdd6c338b8966ac\"}"

response = http.request(request)
import http.client

conn = http.client.HTTPConnection("prod.boxme.vn")

payload = "{\"From\":{\"City\":18,\"Province\":167,\"Ward\":479,\"Name\":\"Fashion Collections\",\"Phone\":\"123123123\",\"Address\":\"123/67 PVH\"},\"To\":{\"City\":54,\"Province\":587,\"Ward\":11250,\"Name\":\"HCK\",\"Phone\":\"123123123123\",\"Address\":\"123/67 Phan Van Hon\"},\"Order\":{\"Amount\":503400,\"Weight\":2000,\"Code\":4,\"Quantity\":1,\"ProductName\":\"Leather shoes (M)\"},\"Type\":\"excel\",\"Config\":{\"Service\":2,\"CoD\":1,\"Protected\":1,\"Checking\":1,\"Payment\":2,\"Fragile\":2,\"AutoAccept\":0},\"Domain\":\"haravan.com\",\"MerchantKey\":\"e80d1bb5cde172364fdd6c338b8966ac\"}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/public/api/rest/courier/create", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/api/rest/courier/create \
  --header 'content-type: application/json' \
  --data '{"From":{"City":18,"Province":167,"Ward":479,"Name":"Fashion Collections","Phone":"123123123","Address":"123/67 PVH"},"To":{"City":54,"Province":587,"Ward":11250,"Name":"HCK","Phone":"123123123123","Address":"123/67 Phan Van Hon"},"Order":{"Amount":503400,"Weight":2000,"Code":4,"Quantity":1,"ProductName":"Leather shoes (M)"},"Type":"excel","Config":{"Service":2,"CoD":1,"Protected":1,"Checking":1,"Payment":2,"Fragile":2,"AutoAccept":0},"Domain":"haravan.com","MerchantKey":"e80d1bb5cde172364fdd6c338b8966ac"}'
var data = JSON.stringify({
  "From": {
    "City": 18,
    "Province": 167,
    "Ward": 479,
    "Name": "Fashion Collections",
    "Phone": "123123123",
    "Address": "123/67 PVH"
  },
  "To": {
    "City": 54,
    "Province": 587,
    "Ward": 11250,
    "Name": "HCK",
    "Phone": "123123123123",
    "Address": "123/67 Phan Van Hon"
  },
  "Order": {
    "Amount": 503400,
    "Weight": 2000,
    "Code": 4,
    "Quantity": 1,
    "ProductName": "Leather shoes (M)"
  },
  "Type": "excel",
  "Config": {
    "Service": 2,
    "CoD": 1,
    "Protected": 1,
    "Checking": 1,
    "Payment": 2,
    "Fragile": 2,
    "AutoAccept": 0
  },
  "Domain": "haravan.com",
  "MerchantKey": "e80d1bb5cde172364fdd6c338b8966ac"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/api/rest/courier/create");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": "success",
  "error_message": "Tạo vận đơn thành công",
  "data": {
    "TrackingCode": "SC5732160351",
    "CourierId": 1,
    "MoneyCollect": 250000,
    "ShowFee": {
      "pvc": 0,
      "cod": 0,
      "pbh": 0
    },
    "Discount": {
      "seller": 0
    }
  }
}

HTTP Request

POST http://prod.boxme.vn/api/public/api/rest/courier/create

Query Parameters

Parameter Default Description
ApiKey (MerchantKey) false Your api key of seller.
Courier false Courier.
From.City false City inventory.
From.Province false Province inventoryr.
From.Stock false Id inventory.
From.Ward false Ward inventory.
From.Address false Address inventory.
From.Phone false Phone seller.
From.Name false Name seller.
To.City false City receive order.
To.Province false Province receive order.
To.Country false Country receive order.
To.Ward false Ward receive order.
To.Address false Address receive order.
To.Phone false Phone buyer.
To.Name false Name buyer.
To.PhoneCode false Name seller.
Order.Weight false Total weight of item in order.
Order.Amount false Total product value.
Order.Quantity false Total quantity of item in order.
Order.Collect false Total money collect from buyer( when you use CoD). Currency: VND.
Order.ProductName false Info orders.
Config.Service false Shipping method:1. Economy delivery service,2. Express delivery service.
Config.CoD false Cash On Delivery (COD) 1: Use; 2: Don’t use.
Config.Protected false Insurance.
Config.Checking false Accept receiver view item in order before confirm received or not.
Config.Payment false Payment.
Config.Fragile false Fragile.
Config.AutoAccept false 1.Auto accept 0. No accept (default).
Type false “Type”: “excel” : We auto select best courier. You don’t define params Courier.

Cancel Order

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/rest/lading/cancel")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"TrackingCode\":\"SC52078917691\",\"ApiKey\":\"string (required)\"}"

response = http.request(request)
puts response.read_body
import requests

url = "http://prod.boxme.vn/api/public/api/rest/lading/cancel"

payload = "{\"TrackingCode\":\"SC52078917691\",\"ApiKey\":\"string (required)\"}"
headers = {'content-type': 'application/json'}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/api/rest/lading/cancel \
  --header 'content-type: application/json' \
  --data '{"TrackingCode":"SC52078917691","ApiKey":"string (required)"}'
var data = JSON.stringify({
  "TrackingCode": "SC52078917691",
  "ApiKey": "string (required)"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/api/rest/lading/cancel");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

HTTP Request

POST http://prod.boxme.vn/api/public/api/rest/lading/cancel

Query Parameters

Parameter Default Description
ApiKey (MerchantKey) false Your api key of seller.
TrackingCode false Shipchung Tracking Code.

Accept Order

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/merchant/rest/lading/accept")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"TrackingCode\":\"string (optional)\",\"ApiKey\":\"string (optional)\"}"

response = http.request(request)
puts response.read_body
import requests

url = "http://prod.boxme.vn/api/public/api/merchant/rest/lading/accept"

payload = "{\"TrackingCode\":\"string (optional)\",\"ApiKey\":\"string (optional)\"}"
headers = {'content-type': 'application/json'}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/api/merchant/rest/lading/accept \
  --header 'content-type: application/json' \
  --data '{"TrackingCode":"string (optional)","ApiKey":"string (optional)"}'
var data = JSON.stringify({
  "TrackingCode": "string (optional)",
  "ApiKey": "string (optional)"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/api/merchant/rest/lading/accept");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": true,
  "error_message": {
    "TrackingCode": [
      "The tracking code format is invalid."
    ]
  }
}

HTTP Request

POST http://prod.boxme.vn/api/public/api/merchant/rest/lading/accept

Query Parameters

Parameter Default Description
ApiKey (MerchantKey) false Your api key of seller.
TrackingCode false Shipchung Tracking Code.

Merchant receive order status

This is webhook api. We will push order status and journey of order to your system via RestApi. Config at:

https://seller.boxme.vn/#/app/config/key

https://seller.shipchung.vn/#/app/config/key

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/your-webhook-api")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["http_x_shipchung_refesh_token"] = 'your key'
request["content-type"] = 'application/json'
request.body = "{\"TrackingCode\":\"SC5238848343\",\"StatusId\":\"string (required)\",\"StatusName\":\"string (required)\",\"TimeStamp\":\"integer (required)\"}"
import requests

url = "http://prod.boxme.vn/api/public/your-webhook-api"

payload = "{\"TrackingCode\":\"SC5238848343\",\"StatusId\":\"string (required)\",\"StatusName\":\"string (required)\",\"TimeStamp\":\"integer (required)\"}"
headers = {
    'http_x_shipchung_refesh_token': "your key",
    'content-type': "application/json"
    }

response = requests.request("POST", url, data=payload, headers=headers)
# With shell, you can just pass the correct header with each request
curl --request POST \
  --url http://prod.boxme.vn/api/public/your-webhook-api \
  --header 'content-type: application/json' \
  --header 'http_x_shipchung_refesh_token: your key' \
  --data '{"TrackingCode":"SC5238848343","StatusId":"string (required)","StatusName":"string (required)","TimeStamp":"integer (required)"}'
var data = JSON.stringify({
  "TrackingCode": "SC5238848343",
  "StatusId": "string (required)",
  "StatusName": "string (required)",
  "TimeStamp": "integer (required)"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://prod.boxme.vn/api/public/your-webhook-api");
xhr.setRequestHeader("http_x_shipchung_refesh_token", "your key");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": true,
  "error_message": {
    "TrackingCode": [
      "The tracking code format is invalid."
    ]
  }
}

HTTP Request

POST http://prod.boxme.vn/api/public/your-webhook-api

Query Parameters

Parameter Default Description
ApiKey (MerchantKey) false Your api key of seller.
TrackingCode false Shipchung Tracking Code.
StatusId false Status Code defined status api.
StatusName false Status name.
TimeStamp false Time update this status.

List Status Order

This is webhook api. We will push order status and journey of order to your system via RestApi. Config at:

https://seller.boxme.vn/#/app/config/key

https://seller.shipchung.vn/#/app/config/key

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/merchant/rest/lading/status")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request.body = "{}"

response = http.request(request)
puts response.read_body
import requests

url = "http://prod.boxme.vn/api/public/api/merchant/rest/lading/status"

payload = "{}"
response = requests.request("GET", url, data=payload)

print(response.text)
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://prod.boxme.vn/api/public/api/merchant/rest/lading/status \
  --data '{}'
var data = "{}";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://prod.boxme.vn/api/public/api/merchant/rest/lading/status");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": false,
  "message": "Thành công",
  "data": [
    {
      "StatusId": 12,
      "StatusName": "Chờ duyệt",
      "StatusName_EN": "Waiting approve"
    },
    {
      "StatusId": 13,
      "StatusName": "Đã duyệt",
      "StatusName_EN": "Approved"
    },
    {
      "StatusId": 14,
      "StatusName": "Đang lấy hàng",
      "StatusName_EN": "Picking"
    },
    {
      "StatusId": 15,
      "StatusName": "Lấy không thành công",
      "StatusName_EN": "Pickup failed"
    },
    {
      "StatusId": 16,
      "StatusName": "Đã lấy hàng",
      "StatusName_EN": "Picked"
    },
    {
      "StatusId": 17,
      "StatusName": "Đang phát hàng",
      "StatusName_EN": "Delivering"
    },
    {
      "StatusId": 18,
      "StatusName": "Phát không thành công",
      "StatusName_EN": "Delivery failed"
    },
    {
      "StatusId": 19,
      "StatusName": "Đã phát thành công",
      "StatusName_EN": "Delivered"
    },
    {
      "StatusId": 20,
      "StatusName": "Chờ XN chuyển hoàn",
      "StatusName_EN": "Waiting return"
    },
    {
      "StatusId": 21,
      "StatusName": "Chuyển hoàn",
      "StatusName_EN": "Returning"
    },
    {
      "StatusId": 22,
      "StatusName": "Hủy đơn hàng",
      "StatusName_EN": "Cancelled"
    }
  ]
}

HTTP Request

GET http://prod.boxme.vn/api/public/api/merchant/rest/lading/status

Errors

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
403 Forbidden – The kitten requested is hidden for administrators only
404 Not Found – The specified kitten could not be found
405 Method Not Allowed – You tried to access a kitten with an invalid method
406 Not Acceptable – You requested a format that isn’t json
410 Gone – The kitten requested has been removed from our servers
418 I’m a teapot
429 Too Many Requests – You’re requesting too many kittens! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.