Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program capacity party to use onOrderAdd


May 20, 2021 WeChat Mini Program Development Document



immediateDelivery.onOrderAdd

This document describes messages or events received on the server side, see Message Push for details.

Real initiate ordering tasks

The message parameter

Object

Property Type Description
ToUserName string Express company small program UserName
FromUserName string WeChat team's OpenID (fixed value)
CreateTime number Event time, Unix timestamp
MsgType string Message type, pinned to event
Event string Event type, fixed to transport_add_order, is case insenso sensitive
wx_token string WeChat order Token. Save the Token, which needs to be passed in when you call the Update Order State interface
delivery_token string The token returned by the delivery company side at the time of pre-order to ensure that freight rates remain unchanged
shopid string Merchant id, appkey assigned by the distribution company
shop_no string Merchant store number, registered on the distribution company side
shop_order_id string The ID that uniquely identifies the order and is generated by the merchant
delivery_sign string A check string encrypted with appSecret provided on the side of the distribution company
sender Object Sender information, if the delivery company can be from the shopid shop_no corresponding to the store address, it does not need to be filled in, otherwise it needs to be filled in
receiver Object Recipient information
cargo Object Cargo information
order_info Object Order information

Sender's structure

Property Type Description
name string Name, up to a maximum of 256 characters
city string City name, such as Guangzhou City
address string Address (street, community, building, etc., for positioning)
address_detail string Address Details (5th number, unit number, layers)
phone string Phone / mobile phone number, up to 64 characters
lng number SME (Mars coordinates or Baidu coordinates, using the Coordinate_Type field, it is found that 6 digits after the decimal point
lat number Latitude (Mars coordinates or Baidu coordinates, using the Coordinate_Type field, using the accurate to 6 digits after the decimal point)
coordinate_type number Coordinate type, 0: Mars coordinates (Gao De, Tencent map all use Mars coordinates) 1: Baidu coordinates

Receiver's structure

Attributes type illustrate
name string Name, up to 256 characters
city string City name, such as Guangzhou
address string Address (street, community, building, etc., for positioning)
address_detail string Address Details (5th number, unit number, layers)
phone string Phone/mobile phone number, up to a maximum of 64 characters
Lng number Longness (Mars coordinates or Baidu coordinates, coordinate_type field, 6 places after the scale
lat number Latitude (Mars coordinates or Baidu coordinates, used in conjunction with the coordinate_type field, accurate to 6 bits after the scale)
coordinate_type number Coordinate type, 0: Mars coordinates (Gaudre, Tencent maps are using Mars coordinates) 1: Baidu coordinates

The structure of the cargo

Property Type Description
goods_value number 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 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 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 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 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 Details of the goods, up to a maximum of 10240 characters
goods_pickup_info string Cargo pick-up information for riders to pick up at the store, up to a maximum of 100 characters
goods_delivery_info string Delivery information for goods up to a maximum of 100 characters
cargo_first_class string Category 1 category, see category table in detail
cargo_second_class string Category 2 category

goods_detail structure of the system

Property Type Description
goods Array.<Object> A list of goods

The structure of the goods

Property Type Description
good_count number The quantity of the goods
good_name string The name of the item
good_price number 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 The unit of goods, up to a maximum of 20 characters

order_info structure of the system

Property Type Description
delivery_service_code string Distribution service code Different distribution companies customize, Shunfeng and Dada do not fill in
order_type number 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 Expect dispatch time (Dada support, which means Dada system scheduling time, until that time there will be callback notifications for status updates), unix-timestamp, such as 1586342180
expected_finish_time number Expected delivery time (U.S. Mission, Shunfeng Tongcheng Express Support), unix-timestamp, e.g. 1586342180
expected_pick_time number 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 Store order flow number, recommended to provide, convenient rider store pick-up, up to a maximum of 32 characters
note string Notes, up to a maximum of 200 characters
order_time number User order payment time, Shunfeng required, such as 1555220757
is_insured number Whether to guarantee the price, 0, non-guaranteed price, 1. Guaranteed price
declared_value number The amount of the guaranteed price, in yuan, accurate to the score
tips number Tip, unit is Yuan, orders generally do not include tip
is_direct_delivery number 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 The amount payable by the rider, in units of yuan, accurate to the score
cash_on_pickup number The amount receivable by the rider, in units of yuan, accurate to the score
rider_pick_method number 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 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 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 message returns

Property Type The default Required Description
ToUserName string Is Return as is fromUserName in the request
FromUserName string Is Express company small program UserName
CreateTime number Is Event time, Unix timestamp
MsgType string Is Message type, pinned to event
Event string Is Event type, fixed to transport_add_order, is case insenso sensitive
resultcode number Is Error code
resultmsg string Is The error description
fee number Is Actual shipping costs (in yuan), shipping charges minus coupon charges
deliverfee number Is Freight (in Yuan)
couponfee number Is Coupon fees (in yuan)
tips number Is Tip (units: yuan)
insurancefee number Is Guaranteed fee (unit: yuan)
distance number Whether Distribution distance (integer, in meters)
waybill_id string Whether The delivery order number can be updated in API1 and returned asynchronously
order_status number Is The status of the delivery order
finish_code number Whether The receipt code
pickup_code number Whether Pick up the code
dispatch_duration number Whether 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
sender_lng number Whether Shipper longiture, Mars coordinates, accurate to 6 places after the scale, for message notification, if there is shipper information in the order request is not required
sender_lat number Whether Shipper latitude, Mars coordinates, accurate to 6 places after the scale, for message notification, if there is shipper information in the order request is not required