NAV Navbar
API Version:   V1.0.10
Logo
shell php 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.

Getting start

Integration step-by-step

  1. Download our vietnam location database.

  2. Upload our location database to your system or mapping your location database with our province_id, district_id, ward_id.

  3. Generate API Key on this link.

  4. Add your product on seller center (sandbox link) or create by API.

  5. Create order.

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.

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

API Supported

Products

Shipment

Location

Order

Location

CSV file

You can download it here : https://bitbucket.org/loihv/boxme-location-database

Get Province - City List

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/merchant/rest/lading/city');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
headers string yes ‘content-type’: ‘application/x-www-form-urlencoded’.

Get District(Province) List by City ID

To authorize, use this code:


<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/merchant/rest/lading/province/18');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
headers string yes ‘content-type’: ‘application/x-www-form-urlencoded’.

Get Ward by District ID

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/merchant/rest/lading/ward/172');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
headers string yes ‘content-type’: ‘application/x-www-form-urlencoded’.

Product

Get Lists Inventory

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/bxapi/list_inventory-sdk');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'ApiKey' => '7c2ab950ddfe7973d792fbaeafc288fb'
));

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/x-www-form-urlencoded'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/bxapi/list_inventory-sdk?ApiKey=7c2ab950ddfe7973d792fbaeafc288fb")

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

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

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

url = "http://prod.boxme.vn/bxapi/list_inventory-sdk"

querystring = {"ApiKey":"7c2ab950ddfe7973d792fbaeafc288fb"}

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

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
curl --request GET \
  --url 'http://prod.boxme.vn/bxapi/list_inventory-sdk?ApiKey=7c2ab950ddfe7973d792fbaeafc288fb' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/x-www-form-urlencoded'


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/bxapi/list_inventory-sdk

Query Parameters

Parameter Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.

Edit Product

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/bxapi/edit-product-sdk');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{"InventoryId":"137123","ApiKey":"YOUR API_KEY","SellerSKU":"KA-07","Name":"iphone 9 ","Description":"Iphone 7s black new 100%","BasePrice":10000,"SalePrice":20000,"Weight":1223,"Volume":"","ProductImages":""}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/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", "/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/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/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/bxapi/edit-product-sdk

Query Parameters

Parameter Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
SellerSKU string yes Product code (sku) to edit.
Name string yes New product name.
InventoryId string yes New ID warehouse (Pickup address config).
Description string yes New product description .
BasePrice string yes New product base price .
SalePrice string yes New product sale price (Price to create orders) .
Weight string yes New product weight (weight to create orders) .
Volume string yes New Volume product .

Add Product

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/bxapi/product-sdk');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{"InventoryId":"105341","ApiKey":"YOUR API_KEY","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":""}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/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", "/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/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/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/bxapi/product-sdk

Query Parameters

Parameter Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
SellerSKU string yes Product code (sku) to edit.
InventoryId string yes Id inventory (not boxme).
Name string yes Product Name.
CategoryName string yes Product CategoryName .
SupplierName string yes Product SupplierName .
BrandName string yes Product Brand.
Description string yes Product Description.
ProductTags string yes Product tag.
Quantity string yes Product quantity.
BasePrice string yes New product base price.
SalePrice string yes New product sale price (Price to create orders) .
Weight string yes New product weight (weight to create orders).
BarcodeManufacturer string yes Barcode (if exist).
ProductImages string yes Images (if exist) .

Get Lists Product

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/bxapi/list_product-sdk');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'apikey' => 'Your API_KEY',
  'content-type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/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", "/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/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/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/bxapi/list_product-sdk

Query Parameters

Parameter Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.

Get List Product To Create Order

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/bxapi/get_list_products_create_order');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'apikey' => 'Your API_KEY',
  'content-type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/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", "/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/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/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/bxapi/get_list_products_create_order

Query Parameters

Parameter Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
inventory_id string yes ID inventory(boxme).
sellerSKU string yes BSIN(SKU).

Shipment

Create Shipment

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/bxapi/shipment-sdk');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{"ApiKey":"YOUR API_KEY","ShipToAddress":{"InventoryId":133455},"ShipFromAddress":{"InventoryId":105341},"TypeTransport":1,"ShipmentStatus":"ReadyToShip","Volumes":"10x10x10","Weight":500,"ShippingMethod":"MYSELF","ShipmentItems":[{"SKU":"14398602","QuantityShipped":100}]}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.

Accept Shipment

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/bxapi/approve_shipment_by_partner');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{
"ApiKey":"xxxxxxxxxxxxxxxx",
"Shipment_Code":"xxxx-xxxx"}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
rrequire 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/bxapi/approve_shipment_by_partner")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["cache-control"] = 'no-cache'
request.body = "{\n\"ApiKey\":\"xxxxxxxxxxxxx\",\n\"Shipment_Code\":\"xxxx-xxxx"}"

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

url = "http://prod.boxme.vn/bxapi/approve_shipment_by_partner"

payload = "{\n\"ApiKey\":\"xxxxxxxxxxxxx\",\n\"Shipment_Code\":\"xxxx-xxxx"}"
headers = {
    'content-type': "application/json",
    'cache-control': "no-cache"
    }

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

print(response.text)
curl --request POST \
  --url http://prod.boxme.vn/bxapi/approve_shipment_by_partner \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --header 'postman-token: 70c299ca-1136-5f80-e127-781b8a06349c' \
  --data '{\n"ApiKey":"xxxxxxxxxxxxx",\n"Shipment_Code":"xxxx-xxxx"}'
var data = JSON.stringify({
  "ApiKey": "xxxxxxxxxxxxx",
  "Shipment_Code": "KA-07"
});

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

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

xhr.open("POST", "http://prod.boxme.vn/bxapi/approve_shipment_by_partner");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache")

xhr.send(data);

The above command returns JSON structured like this:

{
      'shipment_code' : 'BX111111111',
      'message'       : 'Cập nhật trạng thái thành công!',
      'error'         : 'false'
}

HTTP Request

POST http://prod.boxme.vn/bxapi/approve_shipment_by_partner

Query Parameters

Parameter Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
Shipment_Code string yes Your shipment code.

Orders

List of shipping services

id name
1 Chuyển phát tiết kiệm - Economy delivery service
2 Chuyển phát nhanh - Express delivery service
4 Giao qua ngày - Next day delivery service
7 Giao trong ngày - Same day delivery service
11 EMS tiết kiệm - EMS economy delivery service

Calculate Shipping fee

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/rest/courier/calculate');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{"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":"YOUR API_KEY"}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
From.City string yes From city send order.
From.Province string yes From province send order.
From.Province string yes From province send order.
To.City string yes To city receive order.
To.Province string yes To province receive order.
Order.Amount string yes Order amount.
Order.Weight string yes Order weight.
Config.Service string yes Shipping method:1. Economy delivery service,2. Express delivery service.
Config.CoD string yes Cash On Delivery (COD) 1: Use; 2: Don’t use.
Config.Protected string yes Insurance.
Config.Checking string yes Accept receiver view item in order before confirm received or not.
Config.Payment string yes Payment.
Config.Fragile string yes Fragile.

Create Order Fulfillment (Boxme)

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/rest/courier/create');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{"Domain":"boxme.vn","MerchantKey":"YOUR API_KEY","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}}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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": {
    "Code": "100010011",
    "Description": "Comment client",
    "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 Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
Courier string yes Courier.
From.Stock int yes Id inventory.
To.City int yes City receive order.
To.Province int yes Province receive order.
To.Country int yes Country receive order.
To.Ward int yes Ward receive order.
To.Address string yes Address receive order.
To.Phone string yes Phone buyer.
To.Name string yes Name buyer.
To.PhoneCode string no Buyer’s national area code.
Items.Name string yes Name product.
Items.Price string yes Price product.
Items.Quantity string yes Quantity product.
Items.Weight string yes Weight product.
Items.BSIN string yes BSIN product.
Order.Weight float yes Total weight of item in order.
Order.Amount float yes Total product value.
Order.Quaninty int yes otal quantity of item in order.
Order.Collect string yes Total money collect from buyer( when you use CoD). Currency: VND.
Order.ProductName string yes Info orders.
Config.Service int yes Shipping method:1. Economy delivery service,2. Express delivery service.
Config.CoD string yes Cash On Delivery (COD) 1: Use; 2: Don’t use.
Config.Protected int yes Insurance: 1: Use; 2: Don’t use.
Config.Checking int yes Accept receiver view item in order before confirm received or not. 1: Use; 2: Don’t use.
Config.Payment int yes 1: Use; 2: Don’t use.
Config.Fragile int yes Fragile: 1: Use; 2: Don’t use.
Config.AutoAccept int yes 1.Auto approve order 0. No accept (default).
Type string no “Type”: “excel” : We auto select best courier. You don’t define params Courier.

Create Shipping Order (Only Ship)

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/rest/courier/create');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{"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":"YOUR API_KEY"}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
Courier string yes Courier.
From.City string yes City inventory.
From.Province string yes Province inventoryr.
From.Stock string yes Id inventory.
From.Ward string yes Ward inventory.
From.Address string yes Address inventory.
From.Phone string yes Phone seller.
From.Name string yes Name seller.
To.City string yes City receive order.
To.Province string yes Province receive order.
To.Country string yes Country receive order.
To.Ward string yes Ward receive order.
To.Address string yes Address receive order.
To.Phone string yes Phone buyer.
To.Name string yes Name buyer.
To.PhoneCode string yes Name seller.
Order.Weight string yes Total weight of item in order.
Order.Amount string yes Total product value.
Order.Quantity string yes Total quantity of item in order.
Order.Collect string yes
Order.ProductName string yes Info orders.
Config.Service string yes Shipping method:1. Economy delivery service,2. Express delivery service.
Config.CoD string yes Cash On Delivery (COD) 1: Use; 2: Don’t use.
Config.Protected string yes Insurance.
Config.Checking string yes Accept receiver view item in order before confirm received or not.
Config.Payment string yes Payment.
Config.Fragile string yes Fragile.
Config.AutoAccept string yes 1.Auto accept 0. No accept (default).
Type string yes “Type”: “excel” : We auto select best courier. You don’t define params Courier.

Cancel Order

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/rest/lading/cancel');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{"TrackingCode":"SC52078917691","ApiKey":"string (required)"}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
TrackingCode string yes Shipchung Tracking Code.

Accept Order

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/merchant/rest/lading/accept');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

$request->setBody('{"TrackingCode":"SC52078917691","ApiKey":"string (required)"}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
TrackingCode string yes Shipchung Tracking Code.

Webhooks API

A webhook is a tool for retrieving and storing data from certain events.

Boxme sends webhooks upon successful status changes in the lifespan of an Order.

This documentation covers the core resources needed to receive webhooks from the Boxme platform.

Config at:

Webhook Events:

Parameter Description
Waiting approve A Order has been created and is in Staging phase.
Approved Order has been confirmed and is pending pickup.
Picking Order has been picked up and is en-route to Sorting Hub.
Pickup failed Pickup has failed and the Order is awaiting re-schedule.
Picked Proof of pickup is now ready.
Delivering Order is on the way to receiver.
Out of delivery Delivery failed and awaiting sender feedback.
Delivered Delivery has been successfully completed.
Waiting return Delivery of Order has failed repeatedly, sending back to Sender.
Returning Order is returning to sender.
Cancelled Order has been cancelled.

To authorize, use this code:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/your-webhook-api');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'http_x_shipchung_refesh_token' => 'YOUR API_KEY',
));

$request->setBody('{"TrackingCode":"SC5238848343","StatusId":"string (required)","StatusName":"string (required)","TimeStamp":"integer (required)"}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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 Type Required Description
ApiKey (MerchantKey) string yes Your api key of seller.
TrackingCode string yes Shipchung Tracking Code.
StatusId string yes Status Code defined status api.
StatusName string yes Status name.
TimeStamp string yes 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:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/merchant/rest/lading/status');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
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"
    }
  ]
}

Get Status List 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:

<?php

$request = new HttpRequest();
$request->setUrl('http://prod.boxme.vn/api/public/api/merchant/rest/lading/statusmultil/{listorder}?MerchantKey={MerchantKey}');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("http://prod.boxme.vn/api/public/api/merchant/rest/lading/statusmultil/{listorder}?MerchantKey={MerchantKey}")

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/statusmultil/[listorder]?MerchantKey=[MerchantKey]"

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/statusmultil/[listorder] \
  --data '{MerchantKey=[MerchantKey]}'
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/statusmultil/[listorder]?MerchantKey=[MerchantKey]");

xhr.send(data);

The above command returns JSON structured like this:

{
  "error": false,
  "message": "Thành công",
  "data": [
    {
      "tracking_code": "SC51786275290",
      "status": 20,
      "status_name": "Chờ duyệt",
      "status_name_en": "Awaiting approve",
      "status_group_name": "Chờ duyệt",
      "status_group_name_en": "Waiting approve"
    }
  ]
}

HTTP Request

GET http://prod.boxme.vn/api/public/api/merchant/rest/lading/statusmultil/[listorder]?MerchantKey=[MerchantKey]

International Shipping

Steps to create an international order:

Get country

The above command returns JSON structured like this:

    {
    "error": false,
    "data": [{
              "id": 1,
              "country_code": "AF",
              "country_name": "Afghanistan",
              "active": 1,
              "required_zipcode": 0,
              "phone_code": 93
            },{
              "id": 2,
              "country_code": "AL",
              "country_name": "Albania",
              "active": 1,
              "required_zipcode": 0,
              "phone_code": 355
        }]
 }      

HTTP Request

GET https://seller.shipchung.vn/api/public/api/base/country

Get city from country

The above command returns JSON structured like this:

{
    "error": false,
    "data": [{
            "id": 742492,
            "_id": 742492,
            "country_id": 230,
            "country_code": "US",
            "country_name": "UNITED STATES OF AMERICA",
            "state_code": "MN",
            "state_name": "MINNESOTA",
            "city_name": "NEW YORK MILLS",
            "city_name_local": null,
            "airport": "STP",
            "zipcode": "56567",
            "to_zipcode": "\u000056567",
            "col9": "STP",
            "col10": "",
            "region": null,
            "priority": null,
            "code": null
        }]
 }        

Query Parameters

Parameter Default Description
id_country false ID country get from “api get country”.
keyword false Name city in country.

HTTP Request

GET https://seller.shipchung.vn/api/public/api/v1/mobile/city-global/{id_country}?q={keyword}

Calculate Fee

HTTP Request

POST http://services.shipchung.vn/api/rest/global/calculate

Query Parameters

Parameter Default Description
ApiKey (MerchantKey) Required Your api key of seller.
From.City Required From city send order.
From.Province Required From province send order.
From.Stock Required ID inventory
To.Country Required Id country
To.City Required Id city
Order.Weight Required Order weight.
Order.Amount Required Total product value
Order.Quantity Required Quantity.
Order.ProductName Required Name product
Config.Service Required Shipping method:9. Economy delivery service,8. Express delivery
Type Required “Type”: “excel” : We auto select best courier. You don’t define params Courier.
——— ——- ———–

The body request JSON structured like this:

{"Domain": "seller.shipchung.vn",
  "From": {
    "City": 52,
    "Province": 551,
    "Stock": 206963,
    "Address": "18h cong hoa",
    "Phone": "0123456789",
    "Name": "Dev"
  },
  "To": {
   "Country": 230,
    "City": 750012,
    "Address": "a",
    "Zipcode": "11444"
  },
  "Order": {
    "Weight": 100,
    "Amount": 200000,
    "Quantity": 1,
    "ProductName": "Book"
  },
  "Config": {
    "Service": 8,
    "Checking": 1,
    "Fragile": 2,
    "AutoAccept": 0
  },
  "MerchantKey": ""
}

The above command returns JSON structured like this:

{
    "error": false,
    "code": "SUCCESS",
    "message": "success",
    "error_message": "success",
    "data": {
        "courier": {
            "system": [
                {
                    "courier_id": 17,
                    "courier_name": "DHL",
                    "courier_description": "",
                    "courier_logo": "https://seller.shipchung.vn/img/logo-hvc/17.png",
                    "money_pickup": 0,
                    "leatime_delivery": 120,
                    "leatime_courier": 1,
                    "leatime_total": 120,
                    "leatime_ward": 0,
                    "leatime_str": "5 ngày",
                    "priority": 9,
                    "fee": {
                        "fee_id": 1364,
                        "detail_id": 59647,
                        "pvc": 856548,
                        "collect": 0,
                        "vas": {
                            "cod": 0,
                            "protected": 0
                        },
                        "discount": {
                            "pvc": 0,
                            "pcod": 0
                        }
                    }
                },
                {
                    "courier_id": 15,
                    "courier_name": "UPS",
                    "courier_description": "",
                    "courier_logo": "https://seller.shipchung.vn/img/logo-hvc/15.png",
                    "money_pickup": 0,
                    "leatime_delivery": 72,
                    "leatime_courier": 1,
                    "leatime_total": 72,
                    "leatime_ward": 0,
                    "leatime_str": "3 ngày",
                    "priority": 9,
                    "fee": {
                        "fee_id": 2109,
                        "detail_id": 61480,
                        "pvc": 720196,
                        "collect": 0,
                        "vas": {
                            "cod": 0,
                            "protected": 0
                        },
                        "discount": {
                            "pvc": 0,
                            "pcod": 0
                        }
                    }
                }
            ]
        }
    },
    "stock": 206963
}     

Create Order

HTTP Request

POST http://services.shipchung.vn/api/rest/global/calculate

Query Parameters

Parameter Default Description
ApiKey (MerchantKey) Required Your api key of seller.
From.City Required From city send order.
From.Province Required From province send order.
From.Stock Required ID inventory
To.Country Required Id country
To.City Required Id city
To.Zipcode Required Zipcode to city
To.Address Required addresss
To.Name Required Name buyer
To.Phone Required Phone number
To.PhoneCode Required Phone number
Order.Weight Required Order weight.
Order.Amount Required Total product value
Order.Quantity Required Quantity.
Order.ProductName Required Name product
Config.Service Required Shipping method:9. Economy delivery service,8. Express delivery
Config.Checking Required Accept receiver view item in order before confirm received or not.
Config.AutoAccept Required 1.Auto accept 0. No accept (default).
Config.Fragile Required Fragile.
Type Required “Type”: “excel” : We auto select best courier. You don’t define params Courier.

The body request JSON structured like this:

{
  "Domain": "seller.shipchung.vn",
  "From": {
    "City": 52,
    "Province": 551,
    "Stock": 206963,
    "Ward": 4394,
    "Address": "18h cong hoa",
    "Phone": "0123456789",
    "Name": "dev"
  },
  "To": {
   "Country": 230,
    "City": 750012,
    "Address": "a",
    "Zipcode": "11444",
    "Phone": "123456789",
    "PhoneCode": 1,
    "Name": "Jack"
  },
  "Order": {
    "Weight": 100,
    "Amount": 200000,
    "Quantity": 1,
    "ProductName": "Book"
  },
  "Config": {
    "Service": 8,
    "Checking": 1,
    "Fragile": 2,
    "AutoAccept": 0
  },
  "Type":"excel",
  "MerchantKey": ""
}

The above command returns JSON structured like this:

{
    "error": false,
    "code": "SUCCESS",
    "message": "success",
    "data": {
        "TrackingCode": "SC51851803887",
        "CourierId": 17,
        "ShowFee": {
            "pvc": 856548
        }
    }
}  

Manifest

Create manifest

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://services.boxme.vn/api/manifests")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["cache-control"] = 'no-cache'
request["postman-token"] = 'efeb234f-600b-e7ce-ea49-ab8b6ac3a57c'
request.body = "{ \"token\":\"29cf9d7c9c6d1ecef3812034c75f34ec\",  \"reference_code\":\"MF-TEST\",    \"inventory_id\":186019,\"entry_point\":\"VTPHN01\", \"overpacks\":[ {\"description\" : \"Test manifes boxme\",\"volume\" : \"10x10x10\",\"weight\" : 1100,\"color\" : \"red\",\"total\" : 100,\"overpack_partner_code\" : \"MFXXXXXX\",\"manifest_orders\":[ {\"tracking_code\" : \"SC5388176946\",\"quantity_tracking\" : 50,\"volume_tracking\" : \"10x10x10\",\"color_tracking\" : \"Red\",\"material_tracking\" : \"Plastic\",\"qc_tracking\" : \"Test\",\"tag_warehouse_code\" : \"MFXXXXXX\",\"partner_code\" : \"MFXXXXXX\",\"weight_tracking\" : 100,\"images\":[{\"tracking_code\" : \"SC5388176946\",\"url\" : \"http://placehold.it/170x100&text=one\"},{\"tracking_code\" : \"SC5388176946\",\"url\" : \"http://placehold.it/170x100&text=one\"}]} ]} ]}"

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

import requests

url = "http://services.boxme.vn/api/manifests"

payload = "{    \"token\":\"29cf9d7c9c6d1ecef3812034c75f34ec\", \"reference_code\":\"MF-TEST\",  \"inventory_id\":186019, \"entry_point\":\"VTPHN01\",\"overpacks\":[  { \"description\" : \"Test manifes boxme\",\"volume\" : \"10x10x10\",  \"weight\" : 1100, \"color\" : \"red\", \"total\" : 100,\"overpack_partner_code\" : \"MFXXXXXX\",\"manifest_orders\":[ {  \"tracking_code\" : \"SC5388176946\",\"quantity_tracking\" : 50,\"volume_tracking\" : \"10x10x10\",\"color_tracking\" : \"Red\",\"material_tracking\" : \"Plastic\",\"qc_tracking\" : \"Test\",\"tag_warehouse_code\" : \"MFXXXXXX\",\"partner_code\" : \"MFXXXXXX\",\"weight_tracking\" : 100,\"images\":[{\"tracking_code\" : \"SC5388176946\",\"url\" : \"http://placehold.it/170x100&text=one\"},{\"tracking_code\" : \"SC5388176946\",\"url\" : \"http://placehold.it/170x100&text=one\"}] }]}]}"
headers = {
    'content-type': "application/json",
    'cache-control': "no-cache",
    'postman-token': "2c7edb7b-ecfa-1824-5722-1752155bfdf1"
    }

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

print(response.text)
curl --request POST \
  --url http://services.boxme.vn/api/manifests \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --header 'postman-token: f6f86e0a-d1d2-ce55-db9d-ca5c77bf65c1' \
  --data '{"token":"29cf9d7c9c6d1ecef3812034c75f34ec",  "reference_code":"MF-TEST","inventory_id":186019, "entry_point":"VTPHN01",    "overpacks":[{"description" : "Test manifes boxme","volume" : "10x10x10",       "weight" : 1100, "color" : "red","total" : 100, "overpack_partner_code" : "MFXXXXXX","manifest_orders":[ {"tracking_code" : "SC5388176946","quantity_tracking" : 50,  "volume_tracking" : "10x10x10",         "color_tracking": "Red","material_tracking" : "Plastic",                    "qc_tracking" : "Test", "tag_warehouse_code" : "MFXXXXXX",                  "partner_code" : "MFXXXXXX","weight_tracking" : 100,    "images":[{"tracking_code" : "SC5388176946","url" :"http://placehold.it/170x100&text=one"   },{"tracking_code" : "SC5388176946","url" :"http://placehold.it/170x100&text=one"}]}]} ]}'
var data = JSON.stringify({
  "token": "xxxxxxxxx",
  "reference_code": "MF-TEST",
  "inventory_id": 186019,
  "entry_point": "VTPHN01",
  "overpacks": [
    {
      "description": "Test manifes boxme",
      "volume": "10x10x10",
      "weight": 1100,
      "color": "red",
      "total": 100,
      "overpack_partner_code": "MFXXXXXX",
      "manifest_orders": [
        {
          "tracking_code": "SC5388176946",
          "quantity_tracking": 50,
          "volume_tracking": "10x10x10",
          "color_tracking": "Red",
          "material_tracking": "Plastic",
          "qc_tracking": "Test",
          "tag_warehouse_code": "MFXXXXXX",
          "partner_code": "MFXXXXXX",
          "weight_tracking": 100,
          "images": [
            {
              "tracking_code": "SC5388176946",
              "url": "http://placehold.it/170x100&text=one"
            },
            {
              "tracking_code": "SC5388176946",
              "url": "http://placehold.it/170x100&text=one"
            }
          ]
        }
      ]
    }
  ]
});

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

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

xhr.open("POST", "http://services.boxme.vn/api/manifests");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("postman-token", "d23635ff-98ac-0288-f985-ba65bc13fa35");

xhr.send(data);

The above command returns JSON structured like this:

{
    "manifest": {
        "overpacks": [
            {
                "overpack_reference_code": null,
                "overpack_weight": 1100,
                "_embedded": {
                    "data": [
                        {
                            "tracking_code": "SC5388176946",
                            "volume": "10x10x10",
                            "qc": "Test",
                            "weight": 100,
                            "overpack_code": "OPae0613",
                            "warehouse": "VTPHN01",
                            "images": [
                                {
                                    "tracking_code": "SC5388176946",
                                    "urls": "http://placehold.it/170x100&text=one"
                                },
                                {
                                    "tracking_code": "SC5388176946",
                                    "urls": "http://placehold.it/170x100&text=one"
                                }
                            ],
                            "material": "Plastic",
                            "color": "Red",
                            "quantity": 50
                        }
                    ]
                },
                "overpack_code": "OPae0613",
                "overpack_id": 244,
                "time_create": "2017-07-23 11:13:12.130950",
                "overpack_partner_code": "MFXXXXXX",
                "overpack_total": 100,
                "overpack_volume": "10x10x10"
            }
        ],
        "entry_point": "VTPHN01",
        "id": 147,
        "created": "2017-07-23 11:13:12.122047"
    },
    "error": "false"
}

HTTP Request

POST http://services.boxme.vn/api/manifests

Query Parameters

Parameter Type Required Description
token string yes Your api key of seller.
reference_code string yes Partner reference code.
inventory_id string yes Id inventory of Boxme/Shipchung.
entry_point string yes Warehouse of Boxme.
overpacks.description string yes Description of Overpacks .
overpacks.volume string yes Volume of Overpacks .
overpacks.weight string yes
overpacks.color string yes Color of Overpacks .
overpacks.overpack_partner_code string yes Reference code of Overpacks .
overpacks.manifest_orders.tracking_code string yes Tracking code of Boxme/Shipchung.
overpacks.manifest_orders.quantity_tracking string yes Quantity of tracking code.
overpacks.manifest_orders.volume_tracking string yes Volume of tracking code.
overpacks.manifest_orders.color_tracking string yes Color of tracking code.
overpacks.manifest_orders.material_tracking string yes Material of tracking code.
overpacks.manifest_orders.qc_tracking string yes Quality control.
overpacks.manifest_orders.tag_warehouse_code string yes Warehouse partner reference code.
overpacks.manifest_orders.partner_code string yes Partner code.
overpacks.manifest_orders.weight_tracking string yes Weight of tracking code.
overpacks.manifest_orders.images.url string yes Partner reference code.

The above command body JSON structured like this:

{
    "token":"xxxxxxxxxxx",
    "reference_code":"MF-TEST",
    "inventory_id":144469,
    "entry_point":"VTPHN01",
    "overpacks":[
        {
            "description" : "Test manifes boxme",
            "volume" : "10x10x10",
            "weight" : 1100,
            "color" : "red",
            "total" : 100,
            "overpack_partner_code" : "MFXXXXXX",
            "manifest_orders":[
                {
                    "tracking_code"         : "SC123456789",
                    "quantity_tracking"     : 50,
                    "volume_tracking"       : "10x10x10",
                    "color_tracking"        : "Red",
                    "material_tracking"     : "Plastic",
                    "qc_tracking"           : "Test",
                    "tag_warehouse_code" : "MFXXXXXX",
                    "partner_code" : "MFXXXXXX",
                    "weight_tracking"       : 100,
                    "images":[
                        {
                            "url" : "http://placehold.it/170x100&text=one"
                        },
                        {
                            "url" : "http://placehold.it/170x100&text=one"
                        }
                    ]
                }
            ]
        }
    ]
}

Get list manifest

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://devwms.boxme.vn/api/list_manifests")

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("devwms.boxme.vn")

payload = "{}"

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

conn.request("GET", "/api/list_manifests", payload, headers)

res = conn.getresponse()
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://devwms.boxme.vn/api/list_manifests \
  --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://devwms.boxme.vn/api/list_manifests");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  total_items: 7,
  _embedded: {
    data: [
      {
        status: 1,
        created: "2017-07-13 16:59:07",
        manifest_code: "MF3daa18",
        inventory_id: 166911,
        entry_point: "VTPHCM01",
        reference_code: "WV-TEST"
      },
      {
        status: 1,
        created: "2017-07-13 17:03:32",
        manifest_code: "MF12a5d1",
        inventory_id: 166911,
        entry_point: "VTPHCM01",
        reference_code: "WV-TEST"
      },
      {
        status: 6,
        created: "2017-07-15 13:43:35",
        manifest_code: "MF761659",
        inventory_id: 183333,
        entry_point: "VTPHCM01",
        reference_code: "WV-218B"
      },
      {
        status: 3,
        created: "2017-07-18 11:53:07",
        manifest_code: "MF6a139a",
        inventory_id: 183333,
        entry_point: "VTPHCM01",
        reference_code: "WV-220"
      },
      {
        status: 3,
        created: "2017-07-18 16:02:14",
        manifest_code: "MF8e344d",
        inventory_id: 183333,
        entry_point: "VTPHCM01",
        reference_code: "WV-221"
      },
      {
        status: 3,
        created: "2017-07-20 15:21:26",
        manifest_code: "MFa297a4",
        inventory_id: 186019,
        entry_point: "VTPHCM01",
        reference_code: "WV-222"
      },
      {
        status: 2,
        created: "2017-07-21 16:02:00",
        manifest_code: "MF51df58",
        inventory_id: 186019,
        entry_point: "VTPHCM01",
        reference_code: "WV-223"
      }
    ]
  },
  page_count: 1,
  page_size: 25,
  _links: {
    next: {
      href: "/list_manifests?page=1"
    },
    self: {
      href: "/list_manifests"
    },
    prev: {
      href: "/list_manifests?page=1"
    },
    last: {
      href: "/list_manifests?page=1"
    },
    first: {
      href: "/list_manifests?page=1"
    }
  },
  error: "false"
}

HTTP Request

GET http://devwms.boxme.vn/api/list_manifests

Query Parameters

Parameter Type Required Description
token string yes Your api key of seller.

Get detail manifest

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://services.boxme.vn/api/manifests/manifest_code")

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("http://wms.boxme.vn")

payload = "{}"

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

conn.request("GET", "/api/manifests/manifest_code", payload, headers)

res = conn.getresponse()
# With shell, you can just pass the correct header with each request
curl --request GET \
  --url http://services.boxme.vn/api/manifests/manifest_code \
  --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://services.boxme.vn/api/manifests/manifest_code");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

The above command returns JSON structured like this:

{
  manifest: {
    status: 6,
    user_phone: "0902165440",
    manifest_code: "MF761659",
    inventory_id: 183333,
    total_ovepacked: 2,
    overpacks: [
      {
        total_order: 2,
        status: 2,
        weight: 2200,
        volume: "",
        total: 22,
        total_receive: 22,
        overpack_code: "OP248798",
        status_name: "Packed",
        overpack_partner_code: "WV-218B-BOX-4",
        created: "2017-07-15 13:43:36",
        overpack_id: "189"
      },
      {
        total_order: 1,
        status: 2,
        weight: 1500,
        volume: "",
        total: 9,
        total_receive: 9,
        overpack_code: "OPf747ab",
        status_name: "Packed",
        overpack_partner_code: "WV-218B-BOX-1",
        created: "2017-07-15 13:43:36",
        overpack_id: "190"
      }
    ],
    total: 31,
    status_name: "Closed",
    created: "2017-07-15 13:43:35",
    order_mf: [
      {
        status: 11,
        weight: 1900,
        tracking_code: "SC5836474452",
        overpack_id: 189,
        images: [
          {
            url: "http://admin.weshop.asia/uploads/warehouse_proxy/stock_in/2017/06/30/3691086/rdfus6ozxz6wu08.png"
          },
          {
            url: "http://admin.weshop.asia/uploads/warehouse_proxy/stock_in/2017/06/30/3691086/6klujinrzbap7ot.png"
          },
          {
            url: "http://admin.weshop.asia/uploads/warehouse_proxy/stock_in/2017/06/30/3691086/sqn6kl1bfpae1lb.png"
          }
        ],
        courier_id: 1,
        total: 12,
        check: "[7, 7]",
        volume: "NonexNonexNone",
        overpack_code: "OP248798",
        status_name: "Sẵn sàng giao hàng",
        created: "2017-07-15 13:43:36",
        warehouse: "VTPHCM01"
      },
      {
        status: 11,
        weight: 1700,
        tracking_code: "SC51537766825",
        overpack_id: 189,
        images: [
          {
            url: "http://admin.weshop.asia/uploads/warehouse_proxy/stock_in/2017/06/30/NT_1498776131016/dr1hmk58h1g8da7.png"
          },
          {
            url: "http://admin.weshop.asia/uploads/warehouse_proxy/stock_in/2017/06/30/NT_1498776131016/tmpfx0j7hmta1fd.png"
          }
        ],
        courier_id: 1,
        total: 10,
        check: "[7]",
        volume: "NonexNonexNone",
        overpack_code: "OP248798",
        status_name: "Sẵn sàng giao hàng",
        created: "2017-07-15 13:43:36",
        warehouse: "VTPHCM01"
      },
      {
        status: 11,
        weight: 1500,
        tracking_code: "SC51755077834",
        overpack_id: 190,
        images: [
          {
            url: "http://admin.weshop.asia/uploads/warehouse_proxy/stock_in/2017/06/30/NT_1498776877622/8z3yex5zha6qmtj.png"
          },
          {
            url: "http://admin.weshop.asia/uploads/warehouse_proxy/stock_in/2017/06/30/NT_1498776877622/58uycertaq28lbs.png"
          }
        ],
        courier_id: 1,
        total: 9,
        check: "[7, 7]",
        volume: "NonexNonexNone",
        overpack_code: "OPf747ab",
        status_name: "Sẵn sàng giao hàng",
        created: "2017-07-15 13:43:36",
        warehouse: "VTPHCM01"
      }
    ],
    entry_point: "VTPHCM01",
    user_name: "Weshop Vietnam"
  },
  error: "false"
}

HTTP Request

GET http://services.boxme.vn/api/manifests/manifest_code

Query Parameters

Parameter Type Required Description
token string yes Your api key of seller.

Update orders hold

To authorize, use this code:

require 'uri'
require 'net/http'

url = URI("http://services.boxme.vn/api/update_orders_hold")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request["cache-control"] = 'no-cache'
request["postman-token"] = '2d8c1289-cc95-e4ae-acb8-358dd0b9ff2a'

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

url = "http://services.boxme.vn/api/update_orders_hold"

payload = ""
headers = {
    'content-type': "application/x-www-form-urlencoded",
    'cache-control': "no-cache",
    'postman-token': "5ecb3c24-4ffc-dfdb-b703-f083adf144fe"
    }

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

print(response.text)
curl --request POST \
  --url http://services.boxme.vn/api/update_orders_hold \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --header 'postman-token: 49305424-7f22-727a-2fd0-2a0dc5d31680'
var data = null;

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

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

xhr.open("POST", "http://services.boxme.vn/api/update_orders_hold");
xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("postman-token", "2ad0febf-f0e7-7475-49e9-7c5c0b956388");

xhr.send(data);

The above command returns JSON structured like this:

{
    'error'     : 'false',
    '_embedded' : {
        'created'   : '2017-07-10 14:14:14',
        'data'  : [
            {
                'tracking_code' : 'SC5145506872',
                'note'  : 'Cập nhật trạng thái đơn thành công.'  
        }
        ]
}

HTTP Request

POST http://services.boxme.vn/api/update_orders_hold

Query Parameters

Parameter Type Required Description
token string yes Your api key of seller.
order_list.tracking_code string yes Tracking code of seller BOXME/SHIPCUNG.
order_list.note string yes Note.

The above command body JSON structured like this:

{
  "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "order_list": [
        {
            "tracking_code" : "SC51627745352",
            "note" : "Boxme test"
        },
        {
            "tracking_code" : "SC5145506872",
            "note" : "Boxme test"
        }
    ]
}

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.