One, city delivery order

Select Courier companies to place orders.

1.1 Interface Format

Provides a uniform format HTTP POST or GET invocation interface and returns uniform format JSON data.

1.2 Requesting an Address

Order.kuaidi100.com/sameCity/or…

Request parameters:

Parameter names If required type instructions
method is string Business type (default: order)
key is string Authorization code, please go to express 100 page to apply for enterprise version interface to obtainapi.kuaidi100.com/register
sign is string It is signed in 32-bit uppercase and used for authentication. MD5 encryption is performed according to the sequence of MD5 (Param + T +key+ secret). The secret number is not required
t is string Time stamp: 1576123932000
param is param Concatenated by other fields

Param data structure:

Parameter names If required type instructions
com is string Express company code, all lowercase letters, see “Express Company Code”
recManName is string Name of recipient
recManMobile is string Either the recipient’s mobile phone number or phone number is mandatory
recManPrintAddr is string The complete address of the recipient, such as Kingdee Software Park, No. 2, 12 South Keji Road, Nanshan District, Shenzhen city, Guangdong Province
sendManName is string Name of sender
sendManMobile is string Sender’s mobile phone number, mobile phone number or telephone number must be filled in
sendManPrintAddr is string Full address of sender, such as B10, Kingdee Software Park, No. 2, South 12th Keji Road, Nanshan District, Shenzhen city, Guangdong Province
callbackUrl is string CallBackUrl Order information callback
orderType no string Order type 0: immediate order (default) 1: reservation order
pickupTime no string Reservation pickup time (2020-02-02 22:00:00), reservation must be filled
weight is double The total weight of the article is KG, no unit is needed, for example: 1.5
serviceType is string Type of express service, for example: document advertisement; Reference parameter dictionary
remark no string note
salt no string Signature is a random string
orderSourceNo no String Item source number (such as Meituan and Ele. me orders are convenient for riders to pick up goods)
orderSourceType no String Source of goods (such as Meituan and Ele. me orders are convenient for riders to pick up)
storeId is String Store ID (corresponding to the store id provided by the express company)
additionFee no Int Tips in units, no units needed, for example: 1000
price is Int Commodity price, unit cent, do not need to bring unit, example: 1000
partnerId no String Service provider authorization information, compare with the parameter dictionary
partnerKey no String Service provider authorization information, compare with the parameter dictionary
goods no obj Product details (strongly recommended, so that the rider can confirm the product information when picking up goods)

Goods data structure:

Parameter names If required type instructions
name is String Name of commodity
price is Int Commodity prices
count is Int The number
uint is String Commodity unit

1.3 Returned Result

field type instructions note
result boolean Submit the results True The submission succeeds. False the submission fails
returnCode string Return codes
message string Return message description
data data

Data structure

field type instructions note
taskId string Task ID
orderId string The order ID
fee int Cost, unit cent
distance int Distance in kilometers
kuaidiNum string Express company order No

1.4 Provide data content

Param example

{

 		"com": "kfw"."recManName": "Test"."recManMobile": "13542651579"."recManPrintAddr": "Weiyida Da Summer, Nanshan District, Shenzhen"."sendManName": "Zhang"."sendManMobile": "13542651579"."sendManPrintAddr": "Exit B, Gaoxin South Subway Station, Nanshan District, Shenzhen city"."serviceType": "Hot pot"."weight": 1.00."remark": "Test order, to be cancelled."."salt": "123"."callBackUrl": "http://www.baiud.com"."pickupTime": ""."orderSourceNo": "168168168"."orderSourceType": "Meituan"."storeId": "106396"."additionFee": 1000."partnerId": "155555555"."partnerKey": "1111111111"

}
Copy the code

Return result example

{

  "returnCode": "200"."result": true."message": "Submission successful"."data": {

    "taskId": "13F873760DCB4CF28D666A13FDE6B31A"."com": "kfw"."orderId": "1000090"."fee": 5000."distance": 1000."kuaidiNum": "KFWZS1476131277"}}Copy the code

1.5 Meaning of information Code

Information code Information Description Causes and recommended handling methods
200 successful successful
400 Parameter error, etc. Submit data is incomplete, check whether the submit format is X-www-form-urlencoded POST format
500 Server error Sometimes, if the request is not submitted according to the standard, for example, the parameters of the express company are not filled in according to the document, etc., this error will also be reported
501 Repeat submit Sometimes, if the request is not submitted according to the standard, for example, the parameters of the express company are not filled in according to the document, etc., this error will also be reported
503 Failed to verify the signature Check the encryption mode. The sequence of param + t + key+ secret is encrypted by MD5. After the encryption, the string is uppercase
601 The key is expired There is no single unit available, the account needs to be recharged

Second, order callback interface

If the order has status change, the callback will be triggered. If the partner does not correctly return the order after the callback, the callback will be repeated for two more times, that is, a maximum of three times. Interval 30 minutes.

2.1 Interface Format

Provides HTTP POST in uniform format and returns JSON data in uniform format.

Request header: Content-type =application/x-www-form-urlencoded; charset=UTF-8

2.2 Requesting an Address

The callbackUrl that your company filled in when authorizing

Request parameters:

field type instructions note
taskId String Task id
sign String The signature Md5 (Param +salt) md5(Param +salt)
param param Parameters of the main body

Param data structure:

Parameter names If required type instructions
kuaidicom is string For the code of express company, all lowercase letters should be used. See “Express Company Code” and fill in.
kuaidinum is string The tracking number can contain a maximum of 32 characters.
message is string State description
orderId is string Platform Order ID
status is string Order status 0- Successful order 1- Received order 10- Received goods 13- signed for 9- User cancels 99- Order cancelled
courierName no string Name of Courier
courierMobile no string Courier Phone
weight no string The weight of the
freight no string The freight

2.3 Result

field instructions note
result Submit the results True The submission succeeds. False the submission fails
returnCode Return codes
message Return message description

2.4 Provide data content

Enter the param example

	{
  	"courierMobile":"15010033036"."courierName":Master "G"."kuaidiCom":"kfw"."kuaidiNum":"KFWZS1476130507"."message":"Order cancelled"."orderId":"1000086"."status":99
  }
Copy the code

Ask for results

{

  		"returnCode": "200"."result": true."message": "Success"

}
Copy the code

2.4 Explanation of Pushed Response Messages and Error codes

The field names Field meaning
result True indicates success, false indicates failure. If the address of the callback interface fails to be submitted, the callback fails again 30 minutes later
returnCode 200: submission succeeded 500: server error Other errors can be defined by yourself
message Return prompt