API FOR AUTOMATIONShipping API

Ship from China API version: 1.1


Develop with test account: test@qq.com password: 123456

1. Read info of a waybill
URL https://www.shipforwarder.com/api/readwaybill.php
Request example https://www.shipforwarder.com/api/readwaybill.php?key=*&id=*
Request parameter
key  (Required. The API key you can get in user center)
id  (Required. ID of the waybill you want to check)
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
2. Read waybills info of certain status
URL https://www.shipforwarder.com/api/readwaybills.php
Request example https://www.shipforwarder.com/api/readwaybills.php?key=*&st=*
Request parameter
key (Required. The API key you can get in user center)
st (Required. 1-Pending,20-Arrived warehouse,21-combining,22-splitting,25-combined,26-split,30-submit to ship, 40-shipping, 41-shipped, 5-received)
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
3. Delete pending waybill
URL https://www.shipforwarder.com/api/deletewaybill.php
Request example https://www.shipforwarder.com/api/deletewaybill.php?key=*&id=*
Request parameter
key (Required. The API key you can get in user center)
id (Required. waybill ID)
Success return example {"status":200}
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note Only pending waybill can be deleted
4. Ship a waybill
URL https://www.shipforwarder.com/api/shipwaybill.php
Request example https://www.shipforwarder.com/api/shipwaybill.php?key=*&id=*&shid=*&recipient=*&company=*&street=*&city=*&state=*&countrycode=*&zipcode=*&phone=*&declarenamecn[0]=*&declarenameen[0]=*&unitvalue[0]=*&qty[0]=*&declarenamecn[1]=*&declarenameen[1]=*&unitvalue[1]=*&qty[1]=*...
Request parameter
key (Required. The API key you can get in user center)
id (Required. Waybill ID)
shid (Required. Shipping method ID)
recipient   (Required)
company   (Optional)
street        (Required)
city            (Required)
state          (Required)
countrycode (Required, Such as "United state"-> "US" The country ISO code list is shown at the bottom)
zipcode     (Required)
phone       (Required)
declarenamecn[] (Optional, The Chinese product name of custom declaration)
declarenameen[] (Optional, The English product name of custom declaration, if this reference is entered, the previous declaration of this waybill will be auto replaced.)
unitvalue[] (Optional, Value of one unit for custom declaration/ USD)
qty[] (Optional, Quantity for custom declaration)
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
{"status":510} -- Balance is not enough
{"status":522} -- Cannot find this waybill or this waybill still not ready to be shipped
{"status":530} -- The shipping method you request do not support the country or the weight range
{"status":533} -- Can not find the country code
Note The address and shipping methed ID you filled will cover and replace the exist one in waybill
5. Get shipping method list of one waybill
URL https://www.shipforwarder.com/api/getwaybillship.php
Request example https://www.shipforwarder.com/api/getwaybillship.php?key=*&id=*&countrycode=*&
Note This API will use the country code you now provide to calculate shipping quote, will not use the address data in this waybill
Request parameter
key (Required. The API key you can get in user center)
id (Required. Waybill ID)
countrycode (Required. Such as "United state"-> "US" The country ISO code list is shown at the bottom)
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
{"status":522} -- Cannot find this order
{"status":530} -- The shipping method you request do not support the country or the weight range
{"status":533} -- Can not find the country code
5.1. Get shipping method list of one waybill
URL https://www.shipforwarder.com/api/getwaybillship2.php
Request example https://www.shipforwarder.com/api/getwaybillship.php?key=*&id=*
Note This API will use the address in the waybill, so require that address data already be filled in the waybill
Request parameter
key (Required. The API key you can get in user center)
id (Required. Waybill ID)
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
{"status":522} -- Cannot find this order
{"status":530} -- The shipping method you request do not support the country or the weight range
{"status":533} -- Can not find the country code
6. Get shipping method list by countrycode, weight and size
URL https://www.shipforwarder.com/api/getship.php
Request example https://www.shipforwarder.com/api/getship.php?key=*&countrycode=*&wei=*&len=*&wid=*&hei=*sen=*
Request parameter
key  (Required. The API key you can get in user center)
countrycode  (Required. Such as "United state"-> "US")
wei  (Required. Weight /g )
len  (Optional. Lenth cm )
wid  (Optional. Width cm )
hei  (Optional. Height cm )
sen  (Optional. Default is 1; 1-normal product, 2-brand product, 3-famous brand product, 4-with battery, 5-pure battery, 6-liquid or powder)
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
{"status":522} -- Cannot find this order
{"status":530} -- The shipping method you request do not support the country or the weight range
{"status":533} -- Can not find the country code
7. Send a waybill message to our worker
URL https://www.shipforwarder.com/api/sendmessage.php
Request example https://www.shipforwarder.com/api/sendmessage.php?key=*&id=*&message=*
Request parameter
key  (Required. The API key you can get in user center)
id  (Required. The waybill ID which this message belong to)
message  (Required. Content of the message to remind something of this waybill to our worker )
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
8. Read waybill message of a waybill
URL https://www.shipforwarder.com/api/readmessage.php
Request example https://www.shipforwarder.com/api/readmessage.php?key=*&id=*
Request parameter
key  (Required. The API key you can get in user center)
id  (Required. The waybill ID which this message belong to)
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
9. Create a pending waybill
URL https://www.shipforwarder.com/api/createwaybill.php
Request example https://www.shipforwarder.com/api/createwaybill.php??key=*¬e=*&orderid=*&isship=*&shid=*&sen=*&recipient=*&company=*&street=*&city=*&state=*&countrycode=*&zipcode=*&phone=*&declarenamecn[0]=*&declarenameen[0]=*&unitvalue[0]=*&qty[0]=*&declarenamecn[1]=*&declarenameen[1]=*&unitvalue[1]=*&qty[1]=*...
Request parameter
key  (Required. The API key you can get in user center)
note     (Optional, Note something about this waybill)
orderid  (Optional, Your order ID in your system)
isship  (Optional, 1-Ship immediately when we receive your parcel(if balance not enough or shipping method is not support, auto ship will be fail then need you manually edit and ship it again);
0-(default)don't ship and put it storage in warehouse until your father request)
shid  (Require, The ID of shipping way. The shipping way list is shown below)
sen  (Optional,The kind of goods. 1-(default)normal. 2-level-2 brand product; 3- level-1 brand product; 4- With battery; 5- Pure battery; 6- Liquid or Powder )
recipient   (Required)
company   (Optional)
street        (Required)
city            (Required)
state          (Required)
countrycode (Required, Such as "United state"-> "US" The country ISO code list is shown at the bottom)
zipcode     (Required)
phone       (Required)
declarenamecn[] (Optional, The Chinese product name of custom declaration)
declarenameen[] (Optional, The English product name of custom declaration)
unitvalue[] (Optional, Value of one unit for custom declaration/ USD)
qty[] (Optional, Quantity for custom declaration)
Request success return example
Fail return example {"status":500} -- Others error
{"status":501} -- API key is not correct
{"status":234} -- Your pending waybill is over limited! You can contact us to increase
{"status":505} -- Miss required parameter
Note After creating the pending waybill successfully, You will get the waybill ID. Then print the label with this waybill ID to mark on the parcel. We will update this waybill in system after we receive this parcel
Shipping way list array= ["","China DHL","China UPS","China TNT","China FEDEX","China ARAMEX","EMS","China Post small parcel by air","HongKong Post Air Mail","Guangzhou ePacket","Road Freight To Door","Road Freight","Air Freight To Door","Air Freight","Ocean Freight To Door","Ocean Freight","Normal Express","SF-express","dhl global mail","Fedex-packet","UK packet","Normal packet","PostNL","Epacket-fast","Malaysia post","Singapore Post","Sweden Post","USPS","DPEX","Road Freight To Door(tax free)","Air Freight To Door(tax free)","Ocean Freight To Door(tax free)","Pick up","Air Freight(tax free)","Ocean Freight(tax free)","STO(申通)", "YT(圆通)","ZTO(中通)", "BEST(百世)","YUNDA(韵达)", "TK(天天)", "DEPPON(德邦)","ANE(安能)" , "SF-packet" , "SF-E-commerce" , "China post big parcel Surface" , "LWE express" , "China post big parcel by air" , "China post big parcel SAL", "ETK", "Hongkong DHL", "Taiwan DHL", "Hongkong UPS", "Hongkong FEDEX", "Hongkong TNT", "Hongkong ARAMEX", "Special line-A", "Special line-B" , "Special line-C" , "Special line-D", "ePacket-B", "ePacket-C", "ePacket-D", "China Post small parcel Surface", "Belgium Post", "DHL-packet", "UPS-packet", "DHL-packet-2", "DHL-packet-3", "USPS-2", "USPS-3", "China DHL-2", "China DHL-3", "Hongkong DHL-2", "Hongkong DHL-3", "China UPS-2", "China UPS-3", "Hongkong UPS-2", "Hongkong UPS-3", "China FEDEX-2", "China FEDEX-3", "Hongkong FEDEX-2", "Hongkong FEDEX-3", "China ARAMEX-2", "China ARAMEX-3", "Hongkong ARAMEX-2", "Hongkong ARAMEX-3", "Ocean Freight To Door(tax free)-2", "Ocean Freight To Door(tax free)-3", "Train Freight", "Train Freight To Door(tax free)-1", "Train Freight To Door(tax free)-2", "Train Freight To Door(tax free)-3", "Normal express-2", "Normal express-3", "USPS-4", "USPS-5", "FCL 20GP", "FCL 40GP", "FCL 40HC", "Singapore-EMS", "J&T-1", "J&T-2", "J&T-3", "air Freight To Door(tax free)-2", "air Freight To Door(tax free)-3", "Belgium Post-1", "Belgium Post-2", "KYE", "JDL", "Hong Kong FedEx-Time limit price", "China FedEx-Time limit price", "Hong Kong UPS-Time limit price", "China UPS-Time limit price", "Hong Kong DHL-Time limit price", "China DHL-Time limit price", "FLYT-1", "FLYT-2", "FLYT-3", "yunexpress-1", "yunexpress-2", "yunexpress-3" ];
Country ID list countryarray= array("","Afghanistan", "Albania", "Algeria", "American Samoa", "Angola", "Anguilla", "Antartica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Ashmore and Cartier Island", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China Guangdong(广东省)", "Christmas Island", "Clipperton Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo, Democratic Republic of the", "Congo, Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Europa Island", "Falkland Islands (Islas Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "French Southern and Antarctic Lands", "Gabon", "Gambia, The", "Gaza Strip", "Georgia", "Germany", "Ghana", "Gibraltar", "Glorioso Islands", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard Island and McDonald Islands", "Holy See (Vatican City)", "Honduras", "Hong Kong", "Howland Island", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Ireland, Northern", "Israel", "Italy", "Jamaica", "Jan Mayen", "Japan", "Jarvis Island", "Jersey", "Johnston Atoll", "Jordan", "Juan de Nova Island", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, Former Yugoslav Republic of", "Madagascar", "Malawi", "West Malaysia", "Maldives", "Mali", "Malta", "Man, Isle of", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Midway Islands", "Moldova", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcaim Islands", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romainia", "Russia", "Rwanda", "Saint Helena", "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Scotland", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and South Sandwich Islands", "Spain", "Spratly Islands", "Sri Lanka", "Sudan", "Suriname", "Svalbard", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Tobago", "Toga", "Tokelau", "Tonga", "Trinidad", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "Uruguay", "USA", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands", "Wales", "Wallis and Futuna", "West Bank", "Western Sahara", "Yemen", "Serbia", "Zambia", "Zimbabwe", "China Anhui(安徽省)","China Beijing(北京市)","China Chongqing(重庆省)","China Fujian(福建省)","China Gansu(甘肃省)","China Guangxi(广西省)","China Guizhou(贵州省)","China Hainan(海南省)","China Hebei(河北省)","China Heilongjiang(黑龙江省)","China Henan(河南省)","China Hubei(湖北省)","China Hunan(湖南省)","China Jiangsu(江苏省)","China Jiangxi(江西省)","China Jilin(吉林省)","China Liaoning(辽宁省)","China Inner Mongol(内蒙古)","China Ningxia(宁夏省)","China Qinghai(青海省)","China Shandong(山东省)","China Shanxi(山西省)","China Shangxi(陕西省)","China Shanghai(上海市)","China Sichuan(四川省)","China Tianjin(天津市)","China Tibet(西藏)","China Xinjiang(新疆)","China Yunnan(云南省)","China Zhejiang(浙江省),"East Malaysia","Montenegro");

countrycodearray=array("","AF","AL","DZ","AS","AO","AI","AQ","AG","AR","AM","AW","AUS","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BA","BW","BR","VG","BN","BG","BF","MM","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","IP","CC","CO","KM","CD","CG","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","EU","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GZ","GE","DE","GH","GI","GO","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HQ","HU","IS","IN","ID","IR","IQ","IE","GB2","IL","IT","JM","JN","JP","DQ","JE","JQ","JO","JU","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","IM","MH","MQ","MR","MU","YT","MX","FM","UM","MD","MC","MN","MS","MA","MZ","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","SH","KN","LC","PM","VC","WS","SM","ST","SA","GB","SN","SC","SL","SG","SK","SI","SB","SO","ZA","GS","ES","XP","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TT2","TG","TK","TO","TT","TN","TR","TM","TV","UG","UA","AE","GB","UY","US","UZ","VU","VE","VN","VI","WLK","WF","WE","EH","YE","RS","ZM","ZW","CN1","CN2","CN3","CN4","CN5","CN6","CN7","CN8","CN9","CN10","CN11","CN12","CN13","CN14","CN15","CN16","CN17","CN18","CN19","CN20","CN21","CN22","CN23","CN24","CN25","CN26","CN27","CN28","CN29","CN30","MY","ME");
10. Get all the shipping rate data
URL https://www.shipforwarder.com/api/getshiprate.php
Request example https://www.shipforwarder.com/api/getshiprate.php?key=*
Request parameter
key (Required. The API key you can get in user center)
Success return example
Fail return example {"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note
This is all the orginal shipping rate data from our SQL database
You can save in your own database, and get any shipping cost from your own server.
We don't usually change the data, so you update it over 30 days a time should be OK.
But it's not easy to understand how to calculate
PHP Example code to calculate a shipping cost
PHP Example code to calculate a list shipping quote for all available shipping method