codecamp

微信小程序 运力方使用·onGetQuota

logistics.onGetQuota

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

查询商户余额事件。

消息参数

Object

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

消息返回

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

ResultCode 的合法值

说明最低版本
0查询成功
-1其他错误
10001客户编码或者月结账户不存在
10002客户密码不正确

消息数据包示例

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>

JSON 格式

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

返回数据包示例

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>

JSON 格式

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


微信小程序 运力方使用·onCheckBusiness
微信小程序 运力方使用·previewTemplate
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

微信小程序 指南

目录结构

开放能力

微信小程序 调试

微信小程序 实时日志

微信小程序 小程序测速

微信小程序 基础组件

微信小程序 API

媒体

界面

微信小程序API 绘图

微信小程序 服务端

接口调用凭证

统一服务消息

微信小程序 服务市场

微信小程序 生物认证

微信小程序 云开发

服务端

微信小程序云开发服务端API 数据库

SDK文档

微信小程序 扩展能力

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }