# 【推送订单】

# 接口调用请求说明

http请求方式:POST
https://api.weixin.qq.com/wxa/servicemarket/connector/shop/order/push?access_token=xxxxxxxxx

# 接口说明

小程序订单更新的时候,调用此接口将订单发送给ERP。

  • 调用方:小程序
  • 接收方:ERP

# 请求参数示例

{
  "trade":{
    "trade_id":"t111",
    "create_time":1634212545663,
    "update_time":1634212545664,
    "status":30,
    "pay_info":{
      "pay_method_type":0,
      "pay_id":"p111",
      "pay_time":1634212545663
    },
    "price_info":{
      "trade_price":18000,
      "freight":7000,
      "discounted_price":1000
    },
    "buyer_info":{
      "id":"buyerid-xxx",
      "mobile":"1338888888"
    },
    "address_info":{
      "name":"李四",
      "address":"广东省广州市海珠区TIT创意园腾讯微信总部",
      "mobile":"1338888888",
      "country":"中国",
      "province":"广东省",
      "city":"广州市",
      "district": "海珠区",
      "town":"",
      "self_pick_up_detail":{
        "id":"sp1",
        "name":"WeStore自提点",
        "address":"广东省广州市海珠区TIT创意园腾讯微信总部B4",
        "country":"中国",
        "province":"广东省",
        "city":"广州市",
        "district": "海珠区",
        "town":""
      }
    },
    "remark_info":{
      "buyer_message":"多送点赠品",
      "seller_message":""
    },
    "invoice_info":{
      "type":2,
      "title":"广州腾讯科技有限公司",
      "code":"0000",
      "email":"weixin@tencent.com"
    },
    "orders":[
      {
        "order_id":"o111",
        "status":30,
        "total_price" : 10000,
        "product_info":{
          "spu_id":"spu111",
          "sku_id":"sku111",
          "out_spu_id":"out_spu_222",
          "out_sku_id":"out_sku_222",
          "cnt":1,
          "sale_price":11000,
          "real_price":10000,
          "spu_name":"笑脸抱枕",
          "sku_name":"标准版"
        },
        "discount_details":[
          {
            "benefit_type":1,
            "benefit_source":0,
            "coupon_id":"c111",
            "benefit_name":"满10免1券",
            "benefit_info":"商品金额满10元,减1元",
            "benefit_condition":1000,
            "benefit_value":1000
          }
        ],
        "delivery_detail":{
          "delivery_type":1,
          "delivery_id":"sf",
          "waybill_id":"sf111"
        }
      }
      
    ]
  }
}

# 回包示例

{
    "errcode": 0,
    "errmsg":"ok"
}

# 请求参数说明

参数 类型 是否必填 说明
trade Trade 交易

Trade

参数 类型 是否必填 说明
trade_id string 交易ID
create_time number 创建时间
update_time number 更新时间
status number 订单状态,10待付款; 11支付完成; 20待发货(已付款/用户已付尾款); 30待收货; 100确认收货200全部商品售后之后,订单取消; 250 订单取消,用户主动取消/待付款超时取消/商家取消;详细见后面“订单状态转移图”
pay_info PayInfo 支付信息,未付款的订单可以不填
price_info PriceInfo 价格信息
buyer_info BuyerInfo 买家信息
address_info AddressInfo 收货地址信息
remark_info RemarkInfo 备注信息
invoice_info InvoiceInfo 发票信息
orders Order List 订单列表

PayInfo

参数 类型 是否必填 说明
pay_method_type number 支付方式,0,微信支付,1: 货到付款,2:商家会员储蓄卡,3:其他
prepay_id string 预支付ID
prepay_time number 预付款时间(拿到prepay_id的时间),unix时间戳,单位:毫秒
pay_id string 支付ID
pay_time number 付款时间,unix时间戳,单位:毫秒

PriceInfo

参数 类型 是否必填 说明
trade_price number 该笔交易最终的金额(单位:分)
freight number 运费(单位:分)
discounted_price number 优惠金额(单位:分)
additional_price number 附加金额(单位:分)
additional_remarks string 附加金额备注

BuyerInfo

参数 类型 是否必填 说明
id string 买家ID
mobile string 手机号码

AddressInfo

参数 类型 是否必填 说明
name string 收件人姓名
address string 详细收货地址信息,自提订单不用填写
mobile string 收件人手机号码
country string 国家,自提订单不用填写
province string 省份,自提订单不用填写
city string 城市,自提订单不用填写
district string
town string 乡镇
self_pick_up_detail SelfPickUpDetail 自提点信息

SelfPickUpDetail

参数 类型 是否必填 说明
id string 自提点id
name string 自提点名称
address string 自提点详细地址
country string 自提点国家
province string 自提点省份
city string 自提点城市
district string
town string 自提点乡镇

RemarkInfo

参数 类型 是否必填 说明
buyer_message string 买家留言
seller_message string 卖家备注

InvoiceInfo

参数 类型 是否必填 说明
type number 发票类型,0不开发票;1普通发票;2增值税发票;3电子发票
title string 发票抬头
code string 识别号
email string 买家邮箱

Order

参数 类型 是否必填 说明
order_id string 子订单号
status number 子订单状态,,10待付款; 11支付完成; 20待发货(已付款/用户已付尾款); 30待收货; 100确认收货200全部商品售后之后,订单取消; 250 订单取消,用户主动取消/待付款超时取消/商家取消;12售后流程
shop_id string 门店id
total_price number 所有商品总价,可以大于product_info.real_price * product_info.cnt
guide_info GuideInfo 导购信息
product_info ProductInfo 商品信息
discount_details DiscountDetail List 优惠列表
delivery_detail DeliveryDetail 物流信息,发货订单必填

GuideInfo

参数 类型 是否必填 说明
id string 导购员id
name string 导购员姓名

ProductInfo

参数 类型 是否必填 说明
spu_id string 平台SPU ID
sku_id string 平台SKU ID
out_spu_id string 外部SPU ID
out_sku_id string 外部SKU ID
cnt number 购买的数量
sale_price number 生成订单时商品的售卖价(单位:分)
real_price number 扣除优惠后的均摊价格(单位:分)
spu_name string spu名称,若商品不存在,则返回空
sku_name string sku名称

DiscountDetail

参数 类型 是否必填 说明
benefit_type number 优惠方式 0无 1减免金额 2打折 3改价
benefit_source number 优惠来源,0商家优惠,1平台优惠
coupon_id string 优惠券id
benefit_name string 优惠券名称
benefit_info string 优惠券描述
benefit_condition number 满减条件金额
benefit_value number 优惠金额

DeliveryDetail

参数 类型 是否必填 说明
delivery_type number 1: 正常快递, 2: 无需快递, 3: 线下配送, 4: 用户自提
finish_all_delivery number 是否发货完成,0表示没发货完成,1表示发货完成
delivery_id string 快递公司ID,通过获取快递公司列表获取
waybill_id string 快递单号

# 说明

  1. 订单状态流转图:

  2. 子订单状态可以跟主订单状态不一致,比如说有两个子订单,一个“待收货”,一个“支付完成”,那此时主订单的状态为“支付完成”。