# 订单管理

本文档面向自研商家和 ISV 服务商,覆盖订单管理模块从查询、处理、发货到结算的完整接入流程。

# 开发前准备

  • 权限与凭证:商家自研可直接调用,使用小店 access_token;第三方服务商需获得商家对 权限集 ID:131(订单管理 + 发货接口)的授权,使用 authorizer_access_token。电子面单接口的权限配置详见 物流发货 - 开发指南
  • 消息推送配置:需配置消息推送回调 URL(配置一次即可接收所有事件回调),本模块涉及 8 个事件通知。详见 消息通知(回调)说明

# 接入流程

# 阶段一:订单查询与同步

商家接入后首先对接订单查询接口,实现订单数据同步。

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%% flowchart LR A["[事件] 订单下单<br/>channels_ec_order_new"] --> B["[API] 获取订单详情<br/>getorder"] C["[API] 获取订单列表<br/>getorderlist"] --> B D["[API] 订单搜索<br/>searchorder"] --> B B --> E[同步到商家系统] style E fill:#ffffff,stroke:#0ab8a6,color:#666666

推荐通过事件通知驱动订单同步,减少轮询开销。[API] 获取订单列表 / getorderlist 适合全量/增量拉取,[API] 订单搜索 / searchorder 适合按条件检索。

# 阶段二:待发货阶段的订单处理

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%% flowchart LR A["[事件] 订单支付成功<br/>channels_ec_order_pay"] --> B[待发货] B --> C["[API] 修改订单备注<br/>changemerchantnotes"] B --> D["[API] 修改订单地址<br/>changeorderaddress"] B --> F[进入发货流程] style B fill:#ffffff,stroke:#0ab8a6,color:#666666 style F fill:#ffffff,stroke:#0ab8a6,color:#666666

[API] 修改订单价格 / changeorderprice 仅在待付款状态下可用,支付后不可改价。[API] 修改订单地址 / changeorderaddress 为商家主动修改,用户申请修改需通过 [API] 同意用户修改收货地址申请 / acceptorderaddressmodifyapply 审批。

# 阶段三:发货流程

订单进入待发货状态后,需通过电子面单取号、打印、发货完成履约。物流发货和电子面单打印的完整接入流程已有独立文档,此处不再重复说明:

发货完成后,订单状态流转回本模块:

  • 发货后触发 [事件] 订单发货 / channels_ec_order_deliver,其中 finish_delivery=0 表示部分发货,=1 表示全部发货完成
  • 多包裹场景需多次调用发货接口,每次都会触发发货事件

# 阶段四:收货与结算

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%% flowchart LR A["[事件] 订单确认收货<br/>channels_ec_order_confirm"] --> B[等待结算] B --> C["[事件] 订单结算成功<br/>channels_ec_order_settle"] C --> D[资金到账] style B fill:#ffffff,stroke:#0ab8a6,color:#666666 style D fill:#ffffff,stroke:#0ab8a6,color:#666666

[事件] 订单确认收货 / channels_ec_order_confirm 包含 confirm_type 字段区分用户主动确认(1)和超时自动确认(2)。结算完成后可通过资金结算接口查询流水。

# 订单状态流转

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%% flowchart LR A[待付款 10] -->|用户支付| B[待发货 20] A -->|用户取消/超时| F[已取消 250] A -->|送礼场景| H[礼物待收下 12] A -->|一起买| I[待成团 13] H -->|收礼成功| B H -->|未收下取消| G[订单取消 200] I -->|成团成功| B I -->|未成团取消| G B -->|部分发货| C[部分发货 21] B -->|全部发货| D[待收货 30] C -->|剩余发货完成| D D -->|用户确认/超时| E[完成 100] E -->|全部售后完成| G[订单取消 200]

订单状态值说明详见 [API] 获取订单详情 / getorder 返回参数中的 order.status 枚举。

# 按需接入场景

以下功能按业务需要选择接入,非必接:

# 用户修改收货地址

用户下单后申请修改地址时,通过 [事件] 订单其他信息更新 / channels_ec_order_ext_info_update 事件(type=4)感知,商家调用 [API] 同意用户修改收货地址申请 / acceptorderaddressmodifyapply 或 [API] 拒绝用户修改收货地址申请 / rejectorderaddressmodifyapply 处理。

# 发货前更换 SKU

用户申请换款时,通过 [事件] 订单其他信息更新 / channels_ec_order_ext_info_update 事件(type=9)感知,商家调用 [API] 同意待发货前更换sku请求 / approvepreshipmentchangesku 或 [API] 拒绝待发货前更换sku请求 / rejectpreshipmentchangesku 处理。也可通过 [API] 获取所有待发货前更换sku待处理请求 / getpreshipmentchangeskuwaithandlelist 主动查询。

# 隐私号与地址解密

订单默认返回脱敏的手机号和地址信息。需要完整信息时:

# 礼物订单

礼物订单的核心信息可通过 [API] 获取订单详情 / getorder 获取,关键字段如下:

字段 说明
is_present 是否礼物订单
present_giver_openid / present_giver_unionid 赠送者身份(注意:order.openid收礼者
present_send_type 礼物单类型(0-普通单聊 / 1-普通群聊 / 2-公众号送礼 / 3-视频号送礼 / 4-企微单聊 / 5-企微群聊 / 7-小程序送礼 / 8-评价抽奖送礼 / 9-橱窗送礼 / 10-见面礼)
present_note 礼物订单留言
present_order_id_str 礼物订单 ID(present_order_id 已废弃)
order_present_info.is_b2c_free_present 是否商家免费赠送(无需付款场景,此时 pay_info 仅返回 payment_method

礼物订单特有状态:12(礼物待收下),收礼成功后流转为待发货(20)。

补充接口:

# 质检管理

部分类目(珠宝玉石、生鲜等)的订单需在发货前完成质检。可通过 [API] 获取订单详情 / getorderdelivery_info.quality_inspect_type 字段判断质检类型(0-无需质检 / 1-珠宝玉石类 / 2-生鲜类)。完整的质检接入流程详见独立文档:

# 前端对接说明

订单管理为纯服务端接口,无前端组件对接需求。商家需在自有系统中实现订单管理界面。

# 相关运营文档

# 常见问题 FAQ

Q:如何高效同步订单数据? A:推荐「事件驱动 + 定时全量」组合方案。监听 [事件] 订单下单 / channels_ec_order_new 等事件通知实时同步,同时每日通过 [API] 获取订单列表 / getorderlist 全量对账补漏。

Q:订单中的收货地址信息为什么是脱敏的? A:出于隐私保护,订单返回的手机号和地址默认脱敏。需调用 [API] 解密订单中的详细收货信息 / decodesensitiveinfo 获取完整信息。

Q:虚拟号过期了怎么办? A:可调用 [API] 订单再次申请虚拟号 / applyvirtualnumberagain 重新获取,或在过期前调用 [API] 订单虚拟号延期 / delayvirtualnumber 延长。

Q:事件通知推送失败怎么办? A:微信服务器会自动重试。建议商家同时配置定时拉取作为兜底。

# 附录:接口速查表

# 订单管理 API 接口

中文名 / 英文名 请求方式 功能说明
获取订单列表 / getorderlist POST /channels/ec/order/list/get 全量/增量拉取订单列表
获取订单详情 / getorder POST /channels/ec/order/get 获取单个订单的完整信息
订单搜索 / searchorder POST /channels/ec/order/search 按条件检索订单
修改订单价格 / changeorderprice POST /channels/ec/order/price/update 待付款状态下修改订单价格
修改订单备注 / changemerchantnotes POST /channels/ec/order/merchantnotes/update 修改商家备注信息
修改订单地址 / changeorderaddress POST /channels/ec/order/address/update 商家主动修改收货地址
修改物流信息 / changedeliveryinfo POST /channels/ec/order/deliveryinfo/update 修改已发货订单的物流信息
同意用户修改收货地址申请 / acceptorderaddressmodifyapply POST /channels/ec/order/addressmodify/accept 同意用户的地址修改申请
拒绝用户修改收货地址申请 / rejectorderaddressmodifyapply POST /channels/ec/order/addressmodify/reject 拒绝用户的地址修改申请
礼物订单新增备注信息 / presentnote POST /channels/ec/order/presentnote/add 为礼物订单新增备注
获取礼物单的子单列表 / getpresentsuborder POST /channels/ec/order/presentsuborder/get 获取礼物订单下的子订单
获取所有待发货前更换sku待处理请求 / getpreshipmentchangeskuwaithandlelist POST /channels/ec/order/preshipmentchangesku/get 查询用户换款待处理请求
同意待发货前更换sku请求 / approvepreshipmentchangesku POST /channels/ec/order/preshipmentchangesku/approve 同意用户的换款请求
拒绝待发货前更换sku请求 / rejectpreshipmentchangesku POST /channels/ec/order/preshipmentchangesku/reject 拒绝用户的换款请求
解密订单中的详细收货信息 / decodesensitiveinfo POST /channels/ec/order/sensitiveinfo/decode 解密脱敏后的收货信息
申请查看订单真实号码 / applyrealnumber POST /channels/ec/order/realnumber/apply 申请查看真实手机号
查看订单真实号审核状态 / getrealnumberviewaudit POST /channels/ec/order/realnumberviewaudit/get 查询真实号申请审核结果
订单再次申请虚拟号 / applyvirtualnumberagain POST /channels/ec/order/virtualnumber/applyagain 虚拟号过期后重新获取
订单虚拟号延期 / delayvirtualnumber POST /channels/ec/order/virtualnumber/delay 延长虚拟号有效期
添加待认证的手机号 / privatenumberaddphone POST /channels/ec/merchant/privatenumber/addphone 添加待认证的商家手机号
获取短信验证码 / privatenumbersendverifycode POST /channels/ec/merchant/privatenumber/sendverifycode 获取手机认证验证码
获取小店手机号认证状态 / privatenumbergetshopphone POST /channels/ec/merchant/privatenumber/getphone 查询手机号认证状态

# 事件通知

中文名 / 英文名 事件标识 功能说明
订单下单 / channels_ec_order_new Event: channels_ec_order_new 用户下单时通知
订单取消 / channels_ec_order_cancel Event: channels_ec_order_cancel 订单取消时通知
订单支付成功 / channels_ec_order_pay Event: channels_ec_order_pay 用户完成支付时通知
订单待发货 / channels_ec_order_wait_shipping Event: channels_ec_order_wait_shipping 订单进入待发货状态时通知
订单发货 / channels_ec_order_deliver Event: channels_ec_order_deliver 订单发货时通知
订单确认收货 / channels_ec_order_confirm Event: channels_ec_order_confirm 用户确认收货时通知
订单结算成功 / channels_ec_order_settle Event: channels_ec_order_settle 订单结算完成时通知
订单其他信息更新 / channels_ec_order_ext_info_update Event: channels_ec_order_ext_info_update 订单附属信息变更时通知
文档变更日志(1条)
2026 年 04 月 03 日
新增 订单管理 - 开发指南