# 查询商户余额

本文档描述服务器端接收的消息或事件,详细说明参见消息推送

事件英文名:logistics.onGetQuota

查询商户余额事件

# 1. 消息参数

# 请求体 Request Payload

参数名类型说明
ToUserNamestring快递公司小程序 UserName
FromUserNamestring微信团队的 OpenID (固定值)
CreateTimenumber事件时间,Unix时间戳
MsgTypestring消息类型,固定为 event
Eventstring事件类型,固定为 get_quota,不区分大小写
BizIDstring商户ID,即商户在快递注册的客户编码或月结账户名
BizPwdstringBizID 对应的密码
ShopAppIDstring商户小程序的 AppID

# 2. 消息返回

# 返回体 Response Payload

参数名类型必填说明枚举
ToUserNamestring原样返回请求中的 FromUserName-
FromUserNamestring快递公司小程序 UserName-
CreateTimenumber事件时间,Unix时间戳-
MsgTypestring消息类型,固定为event-
Eventstring事件类型,固定为get_quota,不区分大小写-
BizIDstring商户ID-
ResultCodenumber处理结果错误码枚举值
ResultMsgstring处理结果详情-
Quotanumber商户可用余额,0 表示无可用余额-

# 3. 枚举信息

# Res.ResultCode Enum

处理结果错误码

枚举值描述
0查询成功
-1其他错误
10001客户编码或者月结账户不存在
10002客户密码不正确

# 4. 注意事项

本事件无特殊注意事项

# 5. 代码示例

# 5.1 XML 格式

请求示例

<xml>
    <ToUserName><![CDATA[gh_abcdefg]]></ToUserName>
    <FromUserName><![CDATA[oABCD]]></FromUserName>
    <CreateTime>1533042556</CreateTime>
    <MsgType><![CDATA[event]]></MsgType>
    <Event><![CDATA[get_quota]]></Event>
    <BizID><![CDATA[xyz]]></BizID>
    <BizPwd><![CDATA[xyz123]]></BizPwd>
    <ShopAppID><![CDATA[wxABCD]]></ShopAppID>
</xml>

返回示例

<xml>
    <ToUserName><![CDATA[oABCD]]></ToUserName>
    <FromUserName><![CDATA[gh_abcdefg]]></FromUserName>
    <CreateTime>1533042556</CreateTime>
    <MsgType><![CDATA[event]]></MsgType>
    <Event><![CDATA[get_quota]]></Event>
    <BizID><![CDATA[xyz]]></BizID>
    <ResultCode>0</ResultCode>
    <ResultMsg><![CDATA[success]]></ResultMsg>
    <Quota>0</Quota>
</xml>

# 5.2 JSON 格式

请求示例

{
  "ToUserName": "gh_abcdefg",
  "FromUserName": "oABCD",
  "CreateTime": 1533042556,
  "MsgType": "event",
  "Event": "get_quota",
  "BizID": "xyz",
  "BizPwd": "xyz123",
  "ShopAppID": "wxABCD"
}

返回示例

{
  "ToUserName": "oABCD",
  "FromUserName": "gh_abcdefg",
  "CreateTime": 1533042556,
  "MsgType": "event",
  "Event": "get_quota",
  "BizID": "xyz",
  "ResultCode": 0,
  "ResultMsg": "success",
  "Quota": 0
}