当前位置: API文档

stockout_order_query_trade_cancel.php(撤销发货的销售出库单查询)

奇门接口url:wdt.stockout.order.query.trade

¥基础   ¥扩展  ¥定制

1.接口说明

1.1 接口描述:销售出库单是基于订单的,订单可以撤销发货。当前接口是用于查询历史的撤销的已发货订单数据。举例:订单JY20250001在2025-01-01 12:00:00第一次发货, 在2025-01-01 12:30:00撤销发货。

1.2 适用版本:网页端

1.3 注意事项:Y目前没有走销售出库流程 目前没有   直接使用已发货的订单作为替代 ,已发货订单支持撤销,也就是同一个订单可以撤销发货

2.调用场景

2.1 举例说明:撤销发货的销售出库单查询

3.请求参数说明

   3.1 请求地址

环境HTTP地址
测试环境https://openapi.ali.huice.cc/openapi/stockout_order_query_trade_cancel.php
正式环境https://openapi.huice.com/openapi/stockout_order_query_trade_cancel.php

   3.2 公共请求参数

名称字段类型长度
必须描述
卖家账号sidString
购买ERP时由旺店通分配给ERP购买方,请从ERP购买方获取。
接口账号appkeyString

时间戳timestampint
北京时间1970-01-01 08:00:00起至现在的总秒数,10位int值,旺店通企业版API服务端允许请求最大时间误差为5min,date.timezone = Asia/Shanghai。
签名signString
API输入参数签名结果,签名算法介绍单击这里

   3.3 业务请求参数

名称字段Y字段必须
描述
开始时间start_timestart_time

修改起始时间,若无订单号/物流单号,则为必填。示例:“ 2021-11-11 00:00:00”。时间开始和结束和系统单号不能同时为空

结束时间end_timeend_time
修改结束时间,上同开始时间。示例:“ 2021-11-11 01:00:00”
系统订单号src_order_nosrc_order_no
系统订单号,多个用,分隔
分页大小page_sizepage_size
每页返回的数据条数,输入值范围1~100,不传本参数,输入值默认为100,使用举例单击这里
页号page_nopage_no
页号,不传默认从0页开始

4.响应参数

   4.1 公共响应参数

名称字段类型长度
必须描述
错误码codeint11状态码:0表示成功,其他表示失败
错误描述messagevarchar255错误描述
条数
total_countvarchar255

符合查询条件的总数量,只有page_no = 0 时才有值。
原始单节点 stockout_listdata[]
业务数据的一级节点,数组形式的订单数据,需要循环读取。

    4.2 业务响应参数

stockout_list

名称Y字段Y父级字段慧经营类型慧经营枚举是否必须默认值是否可变更
销售出库单idstockout_id
bigint(20)

销售出库单号order_no
string

发货状态status
tinyint(4)已发货95 已完成110 已取消5
系统订单号src_order_no
string

仓库idwarehouse_id
int(11)代表仓库所有属性的唯一id,用于仓库区分,在旺店通ERP【仓库信息维护】界面查看
出库时间consign_time
datetime已取消可以传null
邮资成本post_fee
decimal(19, 4)

物流公司idlogistics_id
bigint(20)

物流编号logistics_no
string

平台Idplatform_id
int(11)



平台单号src_tids
string


店铺idshop_id
int(11)代表店铺所有属性的唯一id,用于店铺区分,在旺店通ERP【绑定店铺】界面查看


备注remark
string

最后修改时间modified
datetime

称重重量weight
decimal(19, 4)

快递重量post_weight
decimal(19, 4)

是否本系统发货trade_status_type
int1 平台发货 2 erp发货


业务员

string
null
物流状态
tinyint(4)99推送失败
0待查询
1待取件
2已取件
3在途中
4待派件
5签收
6拒收
8未订阅
9退件中
10已退签
发货后是待取件状态,后边就是根据物流追踪信息去变更
null
货品列表details_list
array[]


销售出库明细idrec_iddetails_listbigint(20)

货品明细idspec_iddetails_listint(11)

原始子订单号 src_oiddetails_liststring



子单原始单号 src_tiddetails_liststring



出库单主键Idstockout_iddetails_listbigint(20)



出库单明细id 关联系统订单idsrc_order_detail_iddetails_listbigint(20)



系统订单明细idstockin_detail_iddetails_listbigint(20)

数量numdetails_listdecimal(19, 4)

分摊邮费share_postdetails_listdecimal(19, 4)
null
分摊后总价share_amountdetails_listdecimal(19, 4)

商家编码spec_nodetails_liststring

货品编号goods_nodetails_liststring

规格编号spec_codedetails_liststring

预估重量weightdetails_listdecimal(19, 4)

成本价cost_pricedetails_listdecimal(19, 4)

销售价sell_pricedetails_listdecimal(19, 4)

商品名称goods_namedetails_liststring

规格名称spec_namedetails_liststring

批次号details_liststring
null
最后修改时间modifieddetails_listdatetime

删除标记
details_listtinyint(4)0未删除 >0已删除0
出库批次号batch_nodetails_liststring

主播idanchor_iddetails_liststring

主播名称anchor_namedetails_liststring

货位批次明细数据position_listdetails_listarray[]

出库单明细或者订单明细Idstockout_order_detail_idposition_listbigint(20)

入库单号明细id stock_spec_detail_idposition_listbigint(20)

货位主键id rec_idposition_listbigint(20)

货位IDposition_idposition_listbigint(20)

批次号 batch_noposition_liststring

有效期 expire_dateposition_listdatetime举例 2025-01-01 00:00:00
生产日期production_dateposition_listdatetime

出库数量numposition_listdecimal(19, 4)

成本价cost_priceposition_listdecimal(19, 4)

最后修改时间modifiedposition_listdatetime

5.请求示例

PHP
<?php
	require_once '../WdtClient.php';
	$c = new WdtClient();
	$c->sid = '';
	$c->appkey = '';
	$c->appsecret = '';
	$c->gatewayUrl = 'https://openapi.ali.huice.cc/openapi/stockout_order_query_trade_cancel.php';

	$c->putApiParam('start_time', '2026-02-09 10:00:00');
	$c->putApiParam('end_time', '2026-02-09 23:59:59');
	$c->putApiParam('src_order_no', 'JY2512100886'); 
	$c->putApiParam('page_no', 0);
	$c->putApiParam('page_size', 1);

	$json = $c->wdtOpenApi();
	var_dump($json);
?>
JAVA
C#
python

6.响应示例

   6.1 正常响应示例 

JSON
{
    "code": 0,
    "message": "",
    "total_count": 3,
    "stockout_list": [
        {
            "trade_from": null,
            "stockout_id": "2793799624756822049",
            "order_no": "JY2602090107",
            "status": 5,
            "src_order_no": "JY2602090107",
            "warehouse_id": "95",
            "warehouse_name": null,
            "warehouse_type": null,
            "check_time": null,
            "consign_time": "2026-02-09 10:15:43",
            "platform_id": "127",
            "shop_id": "332",
            "shop_name": null,
            "post_fee": "2E+1",
            "logistics_id": null,
            "logistics_name": null,
            "logistics_no": "",
            "remark": null,
            "modified": null,
            "weight": null,
            "post_weight": null,
            "src_tids": "2071111001",
            "goods_count": "1E+1",
            "trade_status_type": 2,
            "goods_total_amount": "1E+3",
            "receiver_name": "******",
            "receiver_country": 0,
            "receiver_province": 110000,
            "receiver_city": 110100,
            "receiver_district": 110108,
            "buyer_nick": null,
            "logistics_type": null,
            "logistics_type_name": null,
            "oms_post_amount": null,
            "oms_purchase_amount": null,
            "oms_employ_amount": null,
            "pick_no": null,
            "refund_status": null,
            "fenxiao_nick_name": null,
            "fenxiao_nick_no": null,
            "fenxiao_shop_name": null,
            "provider_nick_no": null,
            "provider_name": null,
            "printman_name": null,
            "auditman_name": null,
            "goods_amount": null,
            "details_list": [
                {
                    "price": null,
                    "barcode": null,
                    "prop1": null,
                    "prop2": null,
                    "prop3": null,
                    "prop4": null,
                    "prop5": null,
                    "prop6": null,
                    "prop7": null,
                    "prop8": null,
                    "prop9": null,
                    "prop10": null,
                    "rec_id": "2793799624756824097",
                    "platform_id": null,
                    "stockout_id": "2793799624756822049",
                    "spec_id": "2787359232045875215",
                    "stockin_detail_id": "2793799624756824097",
                    "src_order_detail_id": "2793799624756824097",
                    "num": "1E+1",
                    "share_amount": "981",
                    "share_post": "12",
                    "spec_no": "c9711555111c1",
                    "goods_no": "2002205578005589",
                    "spec_code": "",
                    "weight": "0",
                    "cost_price": "0.0000",
                    "sell_price": "98.1",
                    "retail_price": null,
                    "goods_name": "货位000022",
                    "spec_name": "",
                    "modified": null,
                    "src_oid": "2071112227001a",
                    "src_tid": "2071111001",
                    "base_unit_id": "0",
                    "base_unit_name": "",
                    "batch_no": null,
                    "anchor_id": null,
                    "anchor_name": null,
                    "share_price": null,
                    "suit_flag": null,
                    "suite_id": null,
                    "is_package": 0,
                    "goods_cost": null,
                    "oms_post_amount": null,
                    "oms_purchase_amount": null,
                    "position_list": null,
                    "sn_list": null,
                    "refund_status": null,
                    "provider_nick_no": null,
                    "provider_name": null,
                    "goods_prop1": null,
                    "goods_prop2": null,
                    "goods_prop3": null,
                    "goods_prop4": null,
                    "goods_prop5": null,
                    "goods_prop6": null,
                    "gift_type": null,
                    "actual_num": null
                }
            ],
            "logistics_list": null
        }
    ]
}

   6.2 异常响应示例

JSON
{
    "code": 2220,
    "message": "page_size为正整数,请检查page_size是否为有效值"
}



常用工具