# 搜索订单

# 接口调用请求说明

http请求方式:POST
https://api.weixin.qq.com/product/order/search?access_token=xxxxxxxxx

# 请求参数示例

{
    "start_pay_time": "2020-03-25 12:05:25",
    "end_pay_time": "2020-04-25 12:05:25",
    "title": "标题关键字",
    "sku_code": "12321",
    "user_name": "张三",
    "tel_number": "13700000000",
    "on_aftersale_order_exist": 0,
    "status": 20,
    "source": 1, //订单来源,默认0, 0:全部, 1:小商店自营订单, 2:带货订单
    "order_id": 123,    // 选填,只搜一个订单时使用
    "page": 1,
    "page_size": 10
}

# 回包示例

{
    "errcode": 0,
    "errmsg":"ok",
    "orders": 
    [
        {
            "order_id": 12123121332,
            "status": 20,
            "create_time": "2020-03-25 13:05:25",
            "update_time": "2020-03-25 14:05:25",
            "order_detail": {
                "product_infos": 
                [
                    {
                        "product_id": 234245,
                        "sku_id": 23424,
                        "sku_cnt": 10,
                        "on_aftersale_sku_cnt": 10,
                        "finish_aftersale_sku_cnt": 0,
                        "title": "健身环",
                        "thumb_img": "http://img10.360buyimg.com/n1/s450x450_jfs/t1/85865/39/13611/488083/5e590a40E4bdf69c0/55c9bf645ea2b727.jpg",
                        "sku_attrs": 
                        [
                            {
                                "attr_key": "选择颜色",
                                "attr_value": "红蓝主机"
                            }
                        ],
                        "sale_price": 2000,
                        "market_price": 2000
                    },
                    ...
                ],
                "pay_info": {
                    "pay_method": "微信支付",
                    "prepay_id": "42526234625",
                    "transaction_id": "131456479687",
                    "prepay_time": "2020-03-25 14:04:25",
                    "pay_time": "2020-03-25 14:05:25"
                },
                "price_info": {
                    "product_price": 20000,
                    "order_price": 10500,
                    "freight": 500,
                    "discounted_price": 10000,
                    "is_discounted": true
                },
                "delivery_info": {
                    "address_info": {
                        "user_name": "陈先生",
                        "postal_code": "2435245",
                        "province_name": "广东",
                        "city_name": "广州",
                        "county_name": "海珠区",
                        "detail_info": "大塘",
                        "national_code": "234234",
                        "tel_number": "24534252"
                    },
                    "delivery_method": "快递",
                    "express_fee": 
                    [
                        {
                            "shipping_method": "ShippingMethod_Express"
                        }
                    ],
                    "delivery_product_info": 
                    [
                        {
                            "waybill_id": "134654612313",
                            "delivery_id": "STO",
                            "delivery_time": "1620738080",
                            "deliver_type": "DELIVERY_TYPE_OPTIONAL_EXPRESS",
                            "delivery_address": {
                                "user_name": "陈先生",
                                "postal_code": "2435245",
                                "province_name": "广东",
                                "city_name": "广州",
                                "county_name": "海珠区",
                                "detail_info": "大塘",
                                "national_code": "234234",
                                "tel_number": "24534252"
                            },
                            "product_infos": 
                            [
                                {
                                    "product_id": 234245,
                                    "sku_id": 23424,
                                    "product_cnt": 1
                                }
                            ]
                        },
                        ...
                    ],
                    "ship_done_time": "1620738080",
                    "insurance_info": {
                        "type": "InsuranceSourceType_None",
                        "insurance_price": 0
                    },
                    "deliver_type": "DELIVERY_TYPE_OPTIONAL_EXPRESS",
                    "offline_delivery_time": 0,
                    "offline_pickup_time": 0
                }
            },
            "aftersale_detail": {
                "aftersale_order_list": 
                [
                    {
                        "aftersale_order_id": 1234,
                        "status": 13
                    },
                    ...
                ],
                "on_aftersale_order_cnt": 1
            },
            "openid": "oDNt95V1edm_RT8K5GSLW4dQYciE",
            "ext_info": {
                "customer_notes": "发顺丰",
                "merchant_notes": "库存不足,取消"
            },
            "order_type": 0
        },
        ...
    ],
    "total_num": 20
}

# 请求参数说明

参数 类型 是否必填 说明
start_pay_time string 订单支付时间的搜索开始时间,,格式yyyy-MM-dd HH:mm:ss,例如2021-06-08 10:00:00,不可早于1970-01-01 08:00:00
end_pay_time string 订单支付时间的搜索结束时间,格式yyyy-MM-dd HH:mm:ss,例如2021-06-08 10:00:00,不可早于1970-01-01 08:00:00
title string 商品标题关键词
sku_code string 商品编码
user_name string 收件人
tel_number string 收件人电话
on_aftersale_order_exist number 不填该参数:全部订单 0:没有正在售后的订单, 1:正在售后单数量大于等于1的订单
status number 订单状态,不填时默认搜索已付款订单,枚举值见RequestOrderStatus
source number 订单来源,默认0, 1:小商店自营订单, 2:带货订单
order_id number 选填,只搜一个订单时使用
page number 第几页(最小填1)
page_size number 每页数量(不超过1000)

# 回包参数说明

参数 类型 说明
errcode string 错误码
errmsg string 错误信息
orders array Order 订单列表,结构定义见获取订单详情Order
total_num number 订单总数

# 枚举-RequestOrderStatus

枚举值 描述
10 待付款
15 拼团活动 支付成功 等待成团中
16 支付成功 等待商家接单中 (同城配送, 线下自提)
17 支付成功待核销
20 待发货
21 部分发货
30 待收货
100 完成
181 订单自动取消并退款(核销券、团购等)
190 商品超卖商家取消订单
200 全部商品售后之后,订单取消
250 订单取消(包括未付款用户取消,超时未付款自动取消,售后取消,超卖商家取消,核销券或团购订单自动退款取消等各种取消情况)

# 返回码

返回码 错误类型
-1 系统异常
-2 token太长
9401020 参数有误