DshipChina API version 1.6

Seller and buyer API

Develop with test account: jiangyanfeng1986@gmail.com password: 1

updated: 2019-07-02. Added GET TRACKING INFO api

updated: 2020-11-26. Added inventory, declared_name_cn in product

updated: 2021-01-19. Add in feedback result "min_day", "max_day", "ship_note" to Get shipping quote 1, 2 API

updated: 2021-06-23. Added tax in shipping rule; tax=0(no need to provide Europe tax ID for this shipping option), tax=1(need to provide Europe IOSS VAT ID); tax=2(need to provide Brazil TAX ID )

Fulfillment API / Get a product info

URL https://www.dshipchina.com/api1/getaproduct.php
Request example https://www.dshipchina.com/api1/getaproduct.php?key=db0d4c3acf6fb3a904bebdfc8e35fccf&product_id=2
Request parameter
key (Required)
product_id (Required) The value can be product ID or SKU
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note product_type: 1- normal product, 2-famous brand product, 3 Very famous brand product, 4-inside battery or magnetic, 5-pure battery, 6- liuid or powder

Fulfillment API / Get all products info

URL https://www.dshipchina.com/api1/getallproducts.php
Request example https://www.dshipchina.com/api1/getallproducts.php?key=db0d4c3acf6fb3a904bebdfc8e35fccf
Request parameter
key (Required)
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note product_type: 1- normal product, 2-famous brand product, 3 Very famous brand product, 4-inside battery or magnetic, 5-pure battery, 6- liuid or powder

Fulfillment API / Edit a product

URL https://www.dshipchina.com/api1/editproduct.php
Request example https://www.dshipchina.com/api1/editproduct.php?key=*&product_id=*&sku=*&product_name=*& note=*&declared_name=*&declared_name_cn=*&declared_value=*
Request parameter
key (Required)
product_id (Required) The value can be product ID or SKU
sku (Optional, fill this field only when you need to edit it)
product_name (Optional, fill this field only when you need to edit it)
note (Optional, fill this field only when you need to edit it)
declared_name (Optional, fill this field only when you need to edit it)
declared_name_cn (Optional, fill this field only when you need to edit it)
declared_value (Optional, fill this field only when you need to edit it)
Success return example {"status":200}
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note Use urlecode for the field if you want to make it alway safe incase meet some special character
(not urlecode the full link, only encode the content of each field)

Fulfillment API / Create a product

URL https://www.dshipchina.com/api1/createproduct.php
Request example https://www.dshipchina.com/api1/createproduct.php?key=*&sku=*&product_name=*& note=*&declared_name=*&declared_name_cn=*&declared_value=*&weight=*&length=*&width=*&height=*
Request parameter
key (Required)
sku (Optional, please make sure SKU is unique in our system in your account)
product_name (Optional)
note (Optional)
declared_name (Optional)
declared_name_cn (Optional)
declared_value (Optional)
weight (Optional) /g, after you create product , it can be edited only by our warehouse in future
length (Optional) /cm, after you create product , it can be edited only by our warehouse in future
width (Optional) /cm, after you create product , it can be edited only by our warehouse in future
height (Optional) /cm, after you create product , it can be edited only by our warehouse in future
Success return example {"status":200,"product_id":"3800"}
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":502} -- SKU is already exist
{"status":505} -- Miss required parameter
Note Use urlecode for the field if you want to make it alway safe incase meet some special character
(not urlecode the full link, only encode the content of each field)

Fulfillment API / Delete product

URL https://www.dshipchina.com/api1/deleteproduct.php
Request example https://www.dshipchina.com/api1/deleteproduct.php?key=*&pidsku=*
Request parameter
key (Required)
pidsku (Required), product ID or SKU
Success return example {"status":200,"pidsku":"3800"}
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note Only can delete the product that inventory is 0

Fulfillment API / Get an order info

URL https://www.dshipchina.com/api1/getanorder.php
Request example https://www.dshipchina.com/api1/getanorder.php?key=db0d4c3acf6fb3a904bebdfc8e35fccf&waybill_id=12954
Request parameter
key (Required)
waybill_id (Required)
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note

waybill_type: 1- normal product, 2-famous brand product, 3 Very famous brand product, 4-inside battery or magnetic, 5-pure battery, 6- liuid or powder

Fulfillment API / Get tracking info

URL https://www.dshipchina.com/api1/getshiptrack.php
Request example https://www.dshipchina.com/api1/getshiptrack.php?key=*&waybill_id=*
Request parameter
key (Required)
waybill_id (Required)
Success return example
Fail return example
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
{"status":508} -- Cannot find order
{"status":536} -- tracking info still not ready
{"status":538} -- fail to connect tracking data
Note Only can check the tracking info for an order, cannot track any tracking number that not belong to this order

Fulfillment API / Get local tracking number

URL https://www.dshipchina.com/api1/getshiptrackno.php
Request example http://www.dshipchina.com/api1/getshiptrackno.php?key=*&waybill_id=12281
Request parameter
key (Required. The API key you can get in user center)
waybill_id (Required.)
Note So far, only tracking number like 3000230681625CN OR shipping way like: Hongkong-Fedex, Hongkong-DHL, Hongkong-UPS support to get local tracking number. The local tracking number depend on country, If ship to USA, it's USPS tacking number
Success return example
Fail return example {"status":500} -- Other error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
{"status":508} -- Cannot find waybill
{"status":551} -- No support to get local tracking number for this order
{"status":561 - 569 } -- fail to get
{"status":580} -- Still pending, try again tomorrow

Fulfillment API / Get orders info

URL https://www.dshipchina.com/api1/getorders.php
Request example https://www.dshipchina.com/api1/getorders.php?key=db0d4c3acf6fb3a904bebdfc8e35fccf&time1=1515421665&time2=1531060065
Request parameter
key (Required)
time1 (Required, Unix timestamp, from time range time1-time2)
time2 (Required, Unix timestamp, from time range time1-time2)
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note

waybill_type: 1- normal product, 2-famous brand product, 3 Very famous brand product, 4-inside battery or magnetic, 5-pure battery, 6- liuid or powder

Fulfillment API / Create an order

URL https://www.dshipchina.com/api1/createorder.php
Request example https://www.dshipchina.com/api1/createorder.php?key=*&recipient=*&company=*&street=*&city=*&state=*&country_code=*&zipcode=*&phone=*&ship_id=*& note=*&product_id[0]=*&qty[0]=*&product_id[1]=*&qty[1]=*...
Request parameter
key (Required)
recipient (Required)
company (Optional)
street (Required)
recipient (Required)
city (Required)
state (Required)
country_code (Required, USA-> US, Australia-> AU)
zipcode (Required)
phone (Required)
note (Optional)
product_id[] (Required) The value can be product ID or SKU
qty[] (Required)
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":510} -- Balance is not enough
{"status":520} -- Product inventory is not enough
{"status":530} -- No such shipping way for this weight and country
{"status":533} -- Cannot find country code
{"status":505} -- Miss required parameter
Note Use urlecode for the field if you want to make it alway safe incase meet some special character
(not urlecode the full link, only encode the content of each field)

Fulfillment API / Mark order as received

URL https://www.dshipchina.com/api1/markreceived.php
Request example https://www.dshipchina.com/api1/markreceived.php?key=*&waybill_id=*
Request parameter
key (Required)
waybill_id (Required)
Success return example {"status":"200"}
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter

Fulfillment API / Get product flow

Products flow is a record log that record how your product qty change

URL https://www.dshipchina.com/api1/getproductflow.php
Request example https://www.dshipchina.com/api1/getproductflow.php?key=*&time1=*&time2=*product_id=*
Request parameter
key (Required)
time1 (Required, Unix timestamp, from time range time1-time2)
time2 (Required, Unix timestamp, from time range time1-time2)
product_id (Optional, If fill this, will returned product flow for one product, If not fill , will return all products')
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter

Admin tool API / Get balance

URL https://www.dshipchina.com/api4/getbalance.php
Request example https://www.dshipchina.com/api4/getbalance.php?key=*
Request parameter
key (Required)
Success return example {"status":"200","balance":"7578.80"}
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter

Admin tool API / Get Finance bill

URL https://www.dshipchina.com/api4/getbillrecord.php
Request example https://www.dshipchina.com/api4/getbillrecord.php?key=*&time1=*&time2=*
Request parameter
key (Required)
time1 (Required, Unix timestamp, from time range time1-time2)
time2 (Required, Unix timestamp, from time range time1-time2)
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter

Admin tool API / Get shipping quote 1

URL https://www.dshipchina.com/api4/getship1.php
Request example https://www.dshipchina.com/api4/getship1.php?key=*&weight=*&volume=*&country_code=*&waybill_type=*
Request parameter
key (Required)
weight (Required, g)
country_code (Required, Australia -> AU)
volume (Optional , Unix timestamp, cm3)
waybill_type (Optional, 1- normal product, 2-famous brand product, 3 Very famous brand product, 4-inside battery or magnetic, 5-pure battery, 6- liuid or powder)
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter

Admin tool API / Get shipping quote 2

URL https://www.dshipchina.com/api4/getship2.php
Request example https://www.dshipchina.com/api4/getship2.php?key=*&country_code=*&product_id[0]=*&qty[0]=*&product_id[1]=*&qty[1]=*...
Request parameter
key (Required)
weight (Required, g)
country_code (Required, Australia -> AU)
product_id[] (Required)
qty[] (Required)
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter

Admin tool API / Edit tracking number feedback URL link

If you set this link, when we ship your order and update tracking number. We will send a http request to notice your server
if your link is https://www.example.com/noticeme
We will send a http request like this:
https://www.example.com/noticeme?waybillid=12555&tracknumber=LY410909689CN

URL https://www.dshipchina.com/api4/editabckurl.php
Request example https://www.dshipchina.com/api4/editabckurl.php?key=*&url=*
Request parameter
key (Required)
url (Required, g)
Success return example {"status":200}
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
Note Use urlecode for the field if you want to make it alway safe incase meet some special character
(not urlecode the full link, only encode the content of each field)

Admin tool API / Get shipping rate database


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

URL https://www.dshipchina.com/api4/getshiprate.php
Request example https://www.dshipchina.com/api4/getshiprate.php?key=*
Request parameter
key (Required)
Success return example
Fail return example {"status":500} -- Unknown error
{"status":501} -- API key is not correct
{"status":505} -- Miss required parameter
PHP Example code to calculate a shipping cost
PHP Example code to calculate a list shipping quote for all available shipping method

Appendices / Product datasheet

product_id ID of product in our system
sku This can be edited , usually use to connect product between our system and your own system
seller_id The owner(seller) of the product
product_name The title of the product
note Your own note for this product
declare_value When this product ship out of China, we will declare as this value to custom.
declare_name When this product ship out of China, we will declare as this name to custom.
declare_name_cn When this product ship out of China, we will declare as this name in Chinese to custom.
weight Net weight of one product , g
length cm
width cm
height cm
price The selling price, USD
description1 description for the end customer
description2 description for the dropship buyer
catalog_id catalog id , the catalog sheet can be checked below
sell 0- only use our fulfillment service, not sell publicly; 1- sell publicly
isoption 0- disable option ; 1- enable option
product_type 1- normal product, 2-famous brand product, 3 Very famous brand product, 4-inside battery or magnetic, 5-pure battery, 6- liuid or powder
inventory inventory in our warehouse for this product
image This is array, in this array, 1. sort : use to control the order of the image show; 2. url: the image url of this product. The full url= "https://user.dshipchina.com/sell/" +url
options This is array, in this array,
1. option_id : ID of this option;
2. related_product_id: each option must be related to a product ID, if the customer choose this option, mean he is buying this related product ID, Each related product ID must be different, Usually the first option's related product ID is itself.
3. option_name : The text name of this option
4. image_id : If this is filled, This option will be shown as an image instead of a text name; If it's "0", mean no image for this option,

Appendices / Order datasheet

waybill_id ID of the order(waybill/shipment) in our system
weight Total weight of this order, inlcude package material , g
volume Total volume of this order, inlcude package material , cm3
time2 The time when you submit the order
price Total product cost in this order
ship_fee Shipping cost of this order
ship_id The ID of shipping method, shipping method sheet can be checked below
country_id part of the shipping address, the ID defined in our system for country, it is a number from 1- 256. In country sheet , we will show how to change to country code
country_code part of the shipping address, the strandard country code. such as Australis = US
recipient part of the shipping address
company part of the shipping address
city part of the shipping address
state part of the shipping address
street part of the shipping address
zipcode part of the shipping address
phone part of the shipping address
waybill_type 1- normal product, 2-famous brand product, 3 Very famous brand product, 4-inside battery or magnetic, 5-pure battery, 6- liuid or powder
note Note for the order
track_number Tracking number, if no tracking number, it will be show as "0" or ""
products It's array. it inlcude:
"product_id",
"qty",
"seller_id"",
"price"

Appendices / Product flow datasheet

flow_id ID of this row
worker_id If the product changed by our worker, we will fill worker ID here. Or fill as "0"
customer_id If the product changed by customer, we will fill customer ID here. Or fill as "0"
time The time for this operation happen
product_id Product ID that Inverory change
qty How many pcs is changed
qty_balance How many inventory leave after this change
flow_type 1-Storage, 2-Ship out, 3-Returned, 4-Inventory adjust, 5-Cancel waybill, 6-Cancel storage, 7-storage adjust, 8-Sell, 9-Cancel order
note If flow_type in (1, 6, 7), it's a storage batch ID, if flow_type in (2, 3, 5, 8, 9)

Appendices / Finance bill datasheet

bill_id ID of this row
bill_type 2- paypal, 14 credit card, 19-Manual Recharge, 20-Waybill Fee Adjust, 21- Pay fulfillment shipping cost...
Here is the array for all type in javascript:
note Note for this record
amount The amount that changed in this row
balance The remain balance after this change
time Time when this operation happen

Appendices / Shipping methods

In API, you must fill the shipping method ID instead of name
1."China DHL", 2."China UPS", 3."China TNT", 4."China FEDEX", 5."China ARAMEX",6."EMS",7."China Post small parcel by air", 8."HongKong Post Air Mail", 9."Guangzhou ePacket", 10."Road Freight To Door", 11."Road Freight", 12."Air Freight To Door", 13."Air Freight", 14."Ocean Freight To Door",15."Ocean Freight", 16."Normal Express",17."SF-express", 18."dhl global mail",19."Fedex-packet", 20."UK packet",21."Normal packet",22."PostNL", 23."Epacket-fast",24."Malaysia post", 25."Singapore Post",26."Sweden Post", 27."USPS packet",28."DPEX", 29."Road Freight To Door(tax free)", 30."Air Freight To Door(tax free)", 31."Ocean Freight To Door(tax free)", 32."Pick up",33."Air Freight(tax free)", 34."Ocean Freight(tax free)", 35."STO(申通)", 36."YT(圆通)",37."ZTO(中通)", 38."BEST(百世)", 39."YUNDA(韵达)", 40."TK(天天)",41."DEPPON(德邦)", 42."ANE(安能)" 43. "SF-packet ,44. “SF-E-commerce” 45. "China post big parcel Surface" 46. "LWE express" , 47."China post big parcel by air" , 48."China post big parcel SAL", 49."ETK", 50."Hongkong DHL", 51."Taiwan DHL", 52."Hongkong UPS", 53."Hongkong FEDEX", 54."Hongkong TNT", 55."Hongkong ARAMEX", 56."Special line-A", 57."Special line-B" , 58."Special line-C" , 59."Special line-D", 60."ePacket-B", 61."ePacket-C", 62."ePacket-D", 63."China Post small parcel Surface", 64."Belgium Post", 65."DHL-packet", 66."UPS-packet", 67."DHL-packet-2", 68."DHL-packet-3", 69."USPS-2", 70."USPS-3", 71."China DHL-2", 72."China DHL-3", 73."Hongkong DHL-2", 74."Hongkong DHL-3", 75."China UPS-2", 76."China UPS-3", 77."Hongkong UPS-2", 78."Hongkong UPS-3", 79."China FEDEX-2", 80."China FEDEX-3", 81."Hongkong FEDEX-2", 82."Hongkong FEDEX-3", 83."China ARAMEX-2", 84."China ARAMEX-3", 85."Hongkong ARAMEX-2", 86."Hongkong ARAMEX-3", 87."Ocean Freight To Door(tax free)-2", 88."Ocean Freight To Door(tax free)-3", 89."Train Freight", 90."Train Freight To Door(tax free)-1", 91."Train Freight To Door(tax free)-2", 92."Train Freight To Door(tax free)-3", 93."Normal express-2", 94."Normal express-3", 95."USPS-4", 96."USPS-5", 97."FCL 20GP", 98."FCL 40GP", 99."FCL 40HC", 100."Singapore-EMS", 101."J&T-1", 102."J&T-2", 103."J&T-3", 104."air Freight To Door(tax free)-2", 105."air Freight To Door(tax free)-3", 106."Belgium Post-1", 107."Belgium Post-2", 108."KYE", 109."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", "yunexpress-4", "yunexpress-5", "UBI-1", "UBI-2", "UBI-3", "SF-E-commerce-2", "SF-E-commerce-3", "SF-express-2", "SF-express-3"

Here is the array for all in javascript :

Appendices /Country


Country ID list in javascript:


Country code -> Country ID in PHP:


Country ID -> Country code in PHP:

Appendices / Catalog

Here is the Catalog array in javascript :