Express order number query API interface – SF Express

Time:2020-11-9

How to use the interface provided by express bird to query the logistics track of SF express.

Let’s take a look at the actual display effect after the interface is completed

Here is a screenshot of the application,
Express order number query API interface - SF Express
In fact, the message information returned by express bird will be more detailed, and the information displayed to customers can be packaged according to product needs.

Now let’s talk about how to achieve it!

First of all, we have the resources we need,
Test merchant ID:

test1617571

Test API key:

554343b2-7252-439b-b4eb-1af42c8f2175 (this key is only used in test environment)

API test address:

http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInvoke.json

Next, let’s talk about request parameters

Description of request system level parameters: 1. Interface description / description

Express order number query API interface - SF Express
Note: r-required, o-optional, c-message, the parameter is optional under certain conditions

The system level parameters mentioned here are equivalent to public parameters. These parameters must be passed to each interface when calling.

2、 Interface parameters

Request content field definition:
Express order number query API interface - SF Express
Interface parameters, also known as business parameters, request business interfaces are different, parameter fields, content is also different, is with the business changes, here we implement the instant query interface, request instruction type: 1002, express bird official website requires that the express company code and logistics order number must be passed, SF Express Express Express’s code is SF

It should be noted that an application level parameter customername needs to be added to query SF express bill No., and it is required

To view the codes of other express companies, click this link:

http://www.kdniao.com/documents

We use SF No. 295734066970 to realize the track query,

SF express request JSON

{

‘OrderCode’: ”,

‘ShipperCode’: ‘SF’,

‘LogisticCode’: ‘295734066970’,

‘CustomerName’: ‘6073’

}

Complete message of request (after URL encoding)

RequestData=%0d%0a++++++++++++%7b%27OrderCode%27%3a%27%27%2c%27ShipperCode%27%3a%27SF%27%2c%27LogisticCode%27%3a%27295734066970%27%2c%27CustomerName%27%3a%276073%27%7d%0d%0a++++++++&EBusinessID=1264783&RequestType=1002&DataSign=ZTJlZWU0NjI1YTljNTlmYzY5Y2M4YjMzYjcxYWU3MDA%3d&DataType=2

Uncoded request message:

RequestData={‘OrderCode’:”,’ShipperCode’:’SF’,’LogisticCode’:’295734066970′,’CustomerName’:’6073′}&EBusinessID=1264783&RequestType=1002&DataSign=ZTJlZWU0NjI1YTljNTlmYzY5Y2M4YjMzYjcxYWU3MDA=&DataType=2

Return parameter definition:

Express order number query API interface - SF Express
Return message information of SF No. 295734066970

{

“LogisticCode”: “295734066970”,

“ShipperCode”: “SF”,

“Traces”: [{

“Acceptstation”: “SF Express has received the express”,

“AcceptTime”: “2020-02-13 18:39:21”

}, {

“Acceptstation”: “the express has been loaded in [Hengshui Taocheng District Collection customer business department] and is ready to be sent to [Shijiazhuang GaoKai distribution center]”,

“AcceptTime”: “2020-02-13 18:39:31”

}, {

“Acceptstation”: “express has already started”,

“AcceptTime”: “2020-02-13 19:15:24”

}, {

“Acceptstation”: “express arrives at [Shijiazhuang GaoKai distribution center]”,

“AcceptTime”: “2020-02-14 04:27:00”

}, {

“Acceptstation”: “the express has been loaded in [Shijiazhuang GaoKai distribution center] and is ready to be sent to [Changsha Xingsha distribution center]”,

“AcceptTime”: “2020-02-14 08:36:14”

}, {

“Acceptstation”: “express has already started”,

“AcceptTime”: “2020-02-14 18:34:31”

}, {

“Acceptstation”: “express arrives at [Changsha Xingsha distribution center]”,

“AcceptTime”: “2020-02-16 09:58:05”

}, {

“Acceptstation”: “the express has been loaded in [Changsha Xingsha distribution center] and is ready to be sent to [Huaihua Yingkou Distribution Center]”,

“AcceptTime”: “2020-02-16 11:03:53”

}, {

“Acceptstation”: “express has already started”,

“AcceptTime”: “2020-02-16 11:50:35”

}, {

“Acceptstation”: “express arrives at [Huaihua Yingkou hub]”,

“AcceptTime”: “2020-02-16 20:20:42”

}, {

“Acceptstation”: “the express has been loaded at [Huaihua Yingkou distribution point] and is ready to be sent to [yuxincheng business office of Yuanling County]”,

“AcceptTime”: “2020-02-17 05:33:23”

}, {

“Acceptstation”: “express has already started”,

“AcceptTime”: “2020-02-17 05:33:37”

}, {

“Acceptstation”: “express arrives at [yuxincheng business office, Yuanling County]”,

“AcceptTime”: “2020-02-17 07:55:20”

}, {

“Acceptstation”: “the express has been loaded in [yuxincheng business point of Yuanling County] and is ready to be sent to [cooperation point of Eryou Miao nationality township, Yuanling County, Huaihua City]”,

“AcceptTime”: “2020-02-17 09:31:53”

}, {

“Acceptstation”: “express arrival [cooperation point of Eryou Miao nationality township, Yuanling County, Huaihua City]”,

“AcceptTime”: “2020-02-17 09:32:16”

}, {

“Acceptstation”: “on the way of delivery, please prepare to sign for it (sender: Deng Xiaoyun, Tel: 13298660182)”,

“AcceptTime”: “2020-02-17 09:32:31”

}, {

“Acceptstation”: “the express is delivered to Deng Xiaoyun and is on the way of delivery (contact number: 13298660182, SF has opened” safe call “to protect your phone privacy, please feel free to answer it!) “

“AcceptTime”: “2020-02-17 09:33:26”

}, {

“Acceptstation”: “received, thank you for using SF, looking forward to serving you again (total number of main orders: 1)”,

“AcceptTime”: “2020-02-17 22:41:24”

}, {

“Acceptstation”: you can view the information of the signer on the official website “waybill data & sign in chart”,

“AcceptTime”: “2020-02-17 22:41:26”

}],

“State”: “3”,

“EBusinessID”: “1264783”,

“Success”: true

}

If there is no logistics track, the following message will be returned:

{

“LogisticCode”: “295734066970”,

“ShipperCode”: “SF”,

“Traces”: [],

“State”: “0”,

“EBusinessID”: “1264783”,

“Reason”: “no track information for the time being”,

“Success”: true

}

If the real name authentication is not performed, the package is not ordered or the available query quantity of the package has been used up, the following message is returned:

{

“LogisticCode”: “295734066970”,

“ShipperCode”: “SF”,

“Traces”: [],

“State”: “0”,

“EBusinessID”: “1264783”,

“Reason”: “business error [no packages available]”,

“Success”: false

}

Here according to our actual business needs to choose free package or charge package.

The detailed interface document is attached to you:

http://www.kdniao.com/documents

Recommended Today

Introduction to vernacular spring cloud

First of all, let me show you a picture. If you don’t understand this picture very well, I hope you will suddenly realize it after reading my article. What is spring cloud Building a distributed system doesn’t need to be complex and error prone. Spring cloud provides a simple and easy to accept programming model […]