May 19, 2021 WeChat Mini Program Development Document
This interface should be called on the server side, as detailed in the Service Side API.
Pre-order interface
POST https://api.weixin.qq.com/cgi-bin/express/local/business/order/pre_add?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
shopid | string | Is | Merchant id, appkey assigned by the distribution company | |
shop_order_id | string | Is | The ID that uniquely identifies the order, generated by the merchant, does not exceed 128 bytes | |
shop_no | string | Is | Merchant store number, registered in the distribution company, U.S. group, flash delivery required | |
delivery_sign | string | Is | A check string description encrypted with appSecret provided by the distribution company | |
delivery_id | string | Is | Distribution company ID | |
Openid | string | Is | The openid of the user who ordered it | |
sender | Object | Is | Sender information, flash delivery, Shunfeng tongcheng emergency delivery must be filled in, the United States mission distribution, Dada, if passed the value of shop_no can not fill in the field | |
receiver | Object | Is | Recipient information | |
cargo | Object | Is | Cargo information | |
order_info | Object | Is | Order information | |
shop | Object | Is | Product information will be displayed in the logistics notification message | |
sub_biz_id | string | Whether | Sub-merchant id, distinguishing between multiple sub-merchants within a small program |
Sender's structure
Property | Type | The default | Required | Description |
---|---|---|---|---|
name | string | Is | Name, up to a maximum of 256 characters | |
city | string | Is | City name, such as Guangzhou City | |
address | string | Is | Address (street, neighborhood, building, etc., for location) | |
address_detail | string | Is | Address details (floor number, unit number, floor number) | |
phone | string | Is | Phone/mobile phone number, up to a maximum of 64 characters | |
lng | number | Yes | SME (Mars coordinates or Baidu coordinates, using the Coordinate_Type field, it is found that 6 digits after the decimal point | |
lat | number | Is | Latitude (Mars coordinates or Baidu coordinates, used in conjunction with the coordinate_type field, accurate to 6 bits after the scale) | |
coordinate_type | number | 0 | Whether | Coordinate type, 0: Mars coordinates (Gaudre, Tencent maps are using Mars coordinates) 1: Baidu coordinates |
The structure of the receiver
Property | Type | The default | Required | Description |
---|---|---|---|---|
name | string | Is | Name, up to a maximum of 256 characters | |
city | string | Is | City name, such as Guangzhou City | |
address | string | Is | Address (street, neighborhood, building, etc., for location) | |
address_detail | string | Is | Address details (floor number, unit number, floor number) | |
phone | string | Is | Phone/mobile phone number, up to a maximum of 64 characters | |
Lng | number | Is | Longness (Mars coordinates or Baidu coordinates, coordinate_type field, 6 places after the scale | |
lat | number | Is | Latitude (Mars coordinates or Baidu coordinates, used in conjunction with the coordinate_type field, accurate to 6 bits after the scale) | |
coordinate_type | number | 0 | Whether | Coordinate type, 0: Mars coordinates (Gaudre, Tencent maps are using Mars coordinates) 1: Baidu coordinates |
The structure of the cargo
Property | Type | The default | Required | Description |
---|---|---|---|---|
goods_value | number | Is | The price of the goods, in yuans, accurate to two digits after the scale (rounding to preserve two places if there are more than two digits after the scale), in the range of (0-5000) | |
goods_height | number | Whether | Cargo height, in cm, accurate to two digits after the scale (rounded to preserve two places if there are more than two digits after the scale), in the range (0-45) | |
goods_length | number | Whether | Cargo length, in cm, accurate to two digits after the scale (rounding to preserve two places if there are more than two digits after the scale), in the range (0-65) | |
goods_width | number | Whether | The width of the goods, in cm, is accurate to the last two digits of the scale (if there are more than two digits after the scale, the rounding retains two places), in the range (0-50) | |
goods_weight | number | Is | Weight of goods, in kg, accurate to two digits after the scale (rounding to preserve two places if there are more than two digits after the scale), in the range (0-50) | |
goods_detail | Object | Whether | Details of the goods, up to a maximum of 10240 characters | |
goods_pickup_info | string | Whether | Cargo pick-up information for riders to pick up at the store, up to a maximum of 100 characters | |
goods_delivery_info | string | Whether | Delivery information for goods up to a maximum of 100 characters | |
cargo_first_class | string | Is | Category 1 category, see category table in detail | |
cargo_second_class | string | Is | Category 2 category |
goods_detail structure of the system
Property | Type | The default | Required | Description |
---|---|---|---|---|
goods | Array.<Object> | Is | A list of goods |
The structure of the goods
Property | Type | The default | Required | Description |
---|---|---|---|---|
good_count | number | Is | The quantity of the goods | |
good_name | string | Is | The name of the item | |
good_price | number | Whether | Unit price of goods, accurate to two digits after the scale (rounding to preserve two places if there are more than two digits after the scale) | |
good_unit | string | Whether | The unit of goods, up to a maximum of 20 characters |
order_info structure of the system
Property | Type | The default | Required | Description |
---|---|---|---|---|
delivery_service_code | string | Whether | Distribution service code Different distribution companies customize, Shunfeng and Dada do not fill in | |
order_type | number | 0 | Whether | Order type, 0: Instant single 1 reservation, such as an appointment order, needs to be set expected_delivery_time or expected_finish_time or expected_pick_time |
expected_delivery_time | number | 0 | Whether | Expect dispatch time (U.S. mission, Dada support, U.S. delegation indicates the merchant order time, Dada indicates system scheduling time, until that time there will be status update callback notification), unix-timestamp, such as 1586342180 |
expected_finish_time | number | 0 | Whether | Expected delivery time (Shunfeng Tongcheng Express Support), unix-timestamp, e.g. 1586342180 |
expected_pick_time | number | 0 | Whether | Expect pickup time (flash delivery, Shunfeng tongcheng emergency delivery support, flash delivery needs to be set two hours later time, Shunfeng Tongcheng express delivery only need to pass expected_finish_time or expected_pick_time one of them, and both pass to expected_finish_time prevail), unix-timestamp, such as 1586342180 |
poi_seq | string | Whether | Store order flow number, recommended to provide, convenient rider store pick-up, up to a maximum of 32 characters | |
note | string | Whether | Notes, up to a maximum of 200 characters | |
order_time | number | Whether | The user orders payment time, such as 1555220757 | |
is_insured | number | 0 | Whether | Whether to guarantee the price, 0, non-guaranteed price, 1. Guaranteed price |
declared_value | number | Whether | The amount of the guaranteed price, in yuan, accurate to the score | |
tips | number | Whether | Tip, unit is Yuan, orders generally do not include tip | |
is_direct_delivery | number | Whether | Whether to choose direct delivery (0: no need; 1: need. After choosing direct delivery, at the same time riders can only deliver this order to completion, delivery costs are correspondingly higher, flash delivery must choose 1, up to optional 0 or 1, the rest of the distribution companies do not support direct delivery) | |
cash_on_delivery | number | Whether | The amount payable by the rider, in units of yuan, accurate to the score | |
cash_on_pickup | number | Whether | The amount receivable by the rider, in units of yuan, accurate to the score | |
rider_pick_method | number | Whether | Logistics flow, 1: pick-up from the store to the user, 2: pick-up from the user to the store | |
is_finish_code_needed | number | Whether | Receipt code (0: No; 1: Required). The function of the receipt code is: the rider must enter the receipt code to complete the order) | |
is_pickup_code_needed | number | Whether | Pick-up code (0: No; 1: Required). The role of the pick-up code is: the rider must enter the pick-up code to pick up from the merchant) |
The structure of the shop
Property | Type | The default | Required | Description |
---|---|---|---|---|
wxa_path | string | Is | The path to the merchant program, recommended for the order page | |
img_url | string | Is | Product thumbnail url | |
goods_name | string | Is | The name of the product | |
goods_count | number | Is | The quantity of goods | |
wxa_appid | string | Whether | If the settlement method is: third-party distribution company unified settlement, merchant follow-up and third-party settlement, then this parameter is required, in this settlement mode, the third party with their own development of small programs for authorized merchants to initiate orders, and the authorization of small program appid to the platform, follow-up delivery notification can be returned to the authorized merchant small program. |
Property | Type | Description |
---|---|---|
errcode | number | Error code, when errcode is 0 or does not exist also need to see resultcode |
errmsg | string | The error description |
resultcode | number | The error code returned by the capacity |
resultmsg | string | The error description returned by the capacity |
fee | number | Actual shipping costs (in yuan), shipping charges minus coupon charges |
deliverfee | number | Freight (in Yuan) |
couponfee | number | Coupon fees (in yuan) |
tips | number | Tip (units: yuan) |
insurancefee | number | Guaranteed fee (unit: yuan) |
distance | number | Delivery distance (in meters) |
dispatch_duration | number | It is expected that the rider will fill in 300 in order time, in units of seconds, such as 5 minutes, and cannot be expected to fill in 0 |
delivery_token | string | The shipping company can return this field and bring it with it when the user orders it, ensuring that shipping costs remain the same for a period of time |
{
"cargo": {
"cargo_first_class": "美食夜宵",
"cargo_second_class": "零食小吃",
"goods_detail": {
"goods": [
{
"good_count": 1,
"good_name": "水果",
"good_price": 10,
"good_unit": "元"
},
{
"good_count": 2,
"good_name": "蔬菜",
"good_price": 20,
"good_unit": "元"
}
]
},
"goods_height": 1,
"goods_length": 3,
"goods_value": 5,
"goods_weight": 1,
"goods_width": 2
},
"delivery_id": "SFTC",
"delivery_sign": "01234567890123456789",
"openid": "oABC123456",
"order_info": {
"delivery_service_code": "",
"expected_delivery_time": 0,
"is_direct_delivery": 0,
"is_finish_code_needed": 1,
"is_insured": 0,
"is_pickup_code_needed": 1,
"note": "test_note",
"order_time": 1555220757,
"order_type": 0,
"poi_seq": "1111",
"tips": 0
},
"receiver": {
"address": "xxx地铁站",
"address_detail": "2号楼202",
"city": "北京市",
"coordinate_type": 0,
"lat": 40.1529600000,
"lng": 116.5060300000,
"name": "老王",
"phone": "18512345678"
},
"sender": {
"address": "xx大厦",
"address_detail": "1号楼101",
"city": "北京市",
"coordinate_type": 0,
"lat": 40.4486120000,
"lng": 116.3830750000,
"name": "刘一",
"phone": "13712345678"
},
"shop": {
"goods_count": 2,
"goods_name": "宝贝",
"img_url": "https://mmbiz.qpic.cn/mmbiz_png/xxxxxxxxx/0?wx_fmt=png",
"wxa_path": "/page/index/index"
},
"shop_no": "12345678",
"sub_biz_id": "sub_biz_id_1",
"shop_order_id": "SFTC_001",
"shopid": "122222222",
}
The order was successfully ordered
{
"resultcode": 0,
"resultmsg": "ok",
"fee": 10,
"deliverfee": 10,
"couponfee": 0,
"tips": 0,
"insurancfee": 0,
"distance": 1000,
"dispatch_duration": 300,
"delivery_token": "1111111"
}
The order failed
{
"resultcode": 1010,
"resultmsg": "收件人信息不正确"
}