vip_stockout_sales_weight_push.php(重量回传)
¥增值
1.接口说明
1.1 接口描述:将重量回传写入旺店通ERP销售订单出库单 |
1.2 适用版本:客户端 V2.4.5.0及以上版本 |
2.调用场景
2.1 自动化称重机、自动化分拣系统、仓储设备控制系统等称重以后,将重量回传写入ERP销售订单出库单。 |
3.请求参数说明
3.1 请求地址
环境 | HTTP地址 |
---|
测试环境 | https://sandbox.wangdian.cn/openapi2/vip_stockout_sales_weight_push.php |
正式环境 | https://api.wangdian.cn/openapi2/vip_stockout_sales_weight_push.php |
3.2 公共请求参数
名称 | 字段 | 类型 | 长度
| 必须 | 描述 |
---|
卖家账号 | sid | String |
| 是 | 购买ERP时由旺店通分配给ERP购买方,请从ERP购买方获取。 |
接口账号 | appkey | String |
| 是 | 本开放平台“自助对接”功能模块内自助申请,获取方式点击这里
|
时间戳 | timestamp | int |
| 是 | 北京时间1970-01-01 08:00:00起至现在的总秒数,10位int值,旺店通企业版API服务端允许请求最大时间误差为5min,date.timezone = Asia/Shanghai。 |
签名 | sign | String |
| 是 | API输入参数签名结果,签名算法介绍单击这里
|
3.3 业务请求参数
名称 | 字段 | 类型 | 长度
| 必须 | 描述 |
---|
物流单号
| logistics_no | varchar |
| 是
| 物流单号
|
重量
| weight | decimal | (19,4) | 是 | 重量
|
校验重量是否超限
| is_setting | tinyint | 1 | 否
| 0:不校验,1:校验,默认为0不进行校验(重量超限校验根据客户端配置进行校验,路径:系统设置——库存设置——称重)
|
是否判断退款状态 | is_check_trade_status | tinyint | 1 | 否 | 0:不判断,1判断;默认为0 |
打包员编号
| packager_no | varchar | 40
| 否
| 打包员编号
|
长 | length | decimal | (19,4) | 否 | 长 |
宽 | width | decimal | (19,4) | 否 | 宽 |
高 | height | decimal | (19,4) | 否 | 高 |
4.响应参数
4.1 公共响应参数
名称 | 字段 | 类型 | 长度 | 必须 | 描述 |
---|
错误码 | code | int | 11 | 是 | 状态码:0表示成功,其他表示失败 |
错误描述 | message | varchar | 255 | 是 | 错误描述 |
物流类型
| logistics_name | String | 40
| 是 | 物流名称
|
物流方式
| logistics_type | smallint | 6 | 是
| 响应值为代表物流方式的数字,数字对应的物流方式名称单击这里 |
物流编号
| logistics_code | String | 20 | 是 | 代表物流所有属性的唯一编码,用于物流区分,ERP内支持自定义(ERP物流界面设置) |
4.2 业务响应参数
5.请求示例
PHP | <?php
require_once("../WdtClient.php");
$c = new WdtClient;
$c->sid = '';
$c->appkey = '';
$c->appsecret = '';
$c->gatewayUrl = 'http://sandbox.wangdian.cn/openapi2/vip_stockout_sales_weight_push.php';
//添加查询参数
$c->putApiParam('logistics_no', '120453002806');
$c->putApiParam('weight', '27');
$c->putApiParam('is_setting', '0');
$c->putApiParam('packager_no', '0');
$json = $c->wdtOpenApi();
var_dump($json);
?> |
JAVA | package com.wangdian.api.vip;
import com.wangdian.api.WdtClient;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class VipStockoutSalesWeightPush {
public static void main(String[] args) {
WdtClient client = new WdtClient("传入sid", "传入appkey", "传入appsecret", "传入url");
//测试环境sid、appkey、密钥请到旺店通开放平台-自助对接-申请测试环境内查看,测试环境url=https://sandbox.wangdian.cn/openapi2/
//调用正式环境时请将sid、appkey、appsecret切换为实际参数,参数在旺店通开放平台-自助对接-应用管理内应用状态为已上线的应用中查看,调用正式环境注意切换正式环境url=https://api.wangdian.cn/openapi2/
Map<String, String> params = new HashMap<String, String>();
params.put("logistics_no", "120453002806");
params.put("weight", "10");
params.put("is_setting", "0");
params.put("packager_no", "0");
try {
String response = client.execute("vip_stockout_sales_weight_push.php", params);
System.out.println(response);
} catch (IOException e) {
e.printStackTrace();
}
}
} |
C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WdtSdk;
namespace VipStockoutSalesWeightPush
{
class VipStockoutSalesWeightPush
{
static void Main(string[] args)
{
WdtClient client = new WdtClient();
client.sid = "";
client.appkey = "";
client.appsecret = "";
client.gatewayUrl = "http://sandbox.wangdian.cn/openapi2/vip_stockout_sales_weight_push.php";
client.putParams("logistics_no", "120453002806");
client.putParams("weight", "20");
client.putParams("is_setting", "0");
client.putParams("packager_no", "0");
string result = client.wdtOpenapi();
Console.WriteLine(result);
Console.ReadKey();
}
}
} |
python
| import WdtClient
t = WdtClient.WdtClient('appkey', 'appsecret', 'sid', 'http://sandbox.wangdian.cn/openapi2/')
params = {}
params.update({"logistics_no": '12345678'})
params.update({"weight": '10'})
params.update({"is_setting": '1'})
params.update({"packager_no": '001'})
response = t.execute("vip_stockout_sales_weight_push.php", params)
print(response) |
6.响应示例
6.1 正常响应示例
JSON
| {
"code": 0,
"message": "操作成功",
"logistics_name": "中通快运",
"logistics_type": "2110",
"logistics_code": "ZTKY001"
} |
6.2 异常响应示例
JSON
| {
"code": -3,
"message": "物流单号 1204530028061 没有找到对应的订单"
} |