微信直连商户分账

微信直连商户分账

{{ profitSharing.versionWarning() }}

对某一订单进行分账,请查看订单操作文档

添加分账接收方

BaaS.wechat.profitSharing.addReceiver(options)

参数说明

options 是 Object 类型,它包括以下几个属性

参数
类型
必填
说明

mch_id

String

商户号

appid

String

微信分配的公众账号 ID

type

ReceiverType

分账接收方类型

account

String

分账接收方账户 id

relation_type

ReceiverRelationType

与分账商户的关系类型

name

String

分账接收方全称,type 不为 PERSONAL_OPENID 时必填

custom_relation

String

relation_type 为 CUSTOM 时必填

{{profitSharing.receiverType()}}

ReceiverRelationType 可选值说明:

说明

'SERVICE_PROVIDER'

服务商

'STORE'

门店

'STAFF'

员工

'STORE_OWNER'

店主

'PARTNER'

合作伙伴

'HEADQUARTER'

总部

'BRAND'

品牌方

'DISTRIBUTOR'

分销商

'USER'

用户

'SUPPLIER'

供应商

'CUSTOM'

自定义

示例代码

返回示例

成功时 res 对象结构如下

删除分账接收方

BaaS.wechat.profitSharing.removeReceiver(options)

参数说明

options 是 Object 类型,它包括以下几个属性

参数
类型
必填
说明

mch_id

String

商户号

appid

String

微信分配的公众账号 ID

type

ReceiverType

分账接收方类型

account

String

分账接收方账户 id

{{profitSharing.receiverType()}}

示例代码

返回示例

成功时 res 对象结构如下

分账订单操作

分账单查询

BaaS.wechat.profitSharing.Order#getOrderList()

支持分页操作 offsetlimit

params 是 Object 类型,为订单过滤条件,你可以参考后面的返回参数说明,进行筛选。

参数说明

参数
类型
说明

params.trade_no

String

分账单号

params.status

Status

分账单状态

params.order_type

Type

分账单类型

Status 可选值说明:

说明

'accepted'

受理成功

'processing'

处理中

'finished'

处理完成

'closed'

处理失败,已关单

Type 可选值说明:

说明

'profit_sharing'

单次分账单

'multi_profit_sharing'

多次分账单

'finish'

完结分账单

示例代码

返回示例

成功时 res 对象结构如下

完结分账

BaaS.wechat.profitSharing.Order#finish(options)

{{ profitSharing.warning() }}

参数说明

options 是 Object 类型,它包括以下几个属性

参数
类型
必填
说明

trade_no

String

支付订单订单号(必须为微信支付订单)

appid

String

微信分配的公众账号 ID

description

String

分账完结描述

示例代码

返回示例

成功时 res 对象结构如下

分账回退

BaaS.wechat.profitSharing.Order#refund(options)

info 此功能需要接收方在商户平台-交易中心-分账-分账接收设置下,开启同意分账回退后,才能使用。

{{ profitSharing.warning() }}

参数说明

options 是 Object 类型,它包括以下几个属性

参数
类型
必填
说明

trade_no

String

分账单单号(非支付订单单号)

appid

String

微信分配的公众账号 ID

refund_no

String

分账回退单号,用户自己生成自己维护,商户系统内部唯一,同一回退单号多次请求等同一次,只能是数字、大小写字母_-

type

ReceiverType

分账回退方类型

account

String

分账回退方账户 id

amount

Number

分账金额,单位为分,只能为整数,不能超过原订单支付金额及最大分账比例金额

description

String

分账回退描述

{{profitSharing.receiverType()}}

示例代码

返回示例

成功时 res 对象结构如下

分账回退结果查询

BaaS.wechat.profitSharing.Order#getRefundmentOrder(options)

参数说明

options 是 Object 类型,它包括以下几个属性

参数
类型
必填
说明

trade_no

String

分账单单号(非支付订单单号)

appid

String

微信分配的公众账号 ID

refund_no

String

分账回退单号,用户自己生成自己维护,商户系统内部唯一,同一回退单号多次请求等同一次,只能是数字、大小写字母_-

示例代码

返回示例

成功时 res 对象结构如下

Last updated

Was this helpful?