通过创建 royalty_template 对象来设置一个分润模板。
| 请求参数 | 描述 |
|---|---|
| app required string | 对应 app 对象的 id,查看如何获取App ID。 |
| rule[royalty_mode] required string | 分润模式。值为 rate 表示按订单金额(包含优惠券金额)比例计算;值为 fixed 表示按固定金额收取分润。 |
| rule[refund_mode] required string | 退分润模式。值为 no_refund 表示不退分润;值为 proportional 表示按退款占支付的比例退分润;值为 full_refund 表示一旦退款成功分润全退。 |
| rule[allocation_mode] required string | 分配模式。表示当订单确定的层级如果少于模板配置层级时,模板中计算出的多余分润金额是归属于收款方:receipt_reserved 或服务方:service_reserved。 |
| rule[data] required list | 分润数据列表,详见下方 rule[data] 列表参数说明 。 |
| name optional string | 模板名称,允许中英文等常用字符,取值范围 2~50 位。 |
| description optional string | 附加说明,最多 100 个 Unicode 字符。 |
| rule[data] 列表参数 | 描述 |
|---|---|
| level required integer | 商户层级,值为 0~5,其中 "0" 表示平台。 |
| value required integer | 分润数值。royalty_mode 为 rate 时,取值范围 0~10000,单位为 0.01%;royalty_mode 为 fixed 时,取值范围 0~1000000,单位为分。 |
返回
返回一个 royalty_template 对象,或者返回一个错误,详见 错误。
POST https://api.pingxx.com/v1/royalty_templates
待补充
待补充
待补充
待补充
待补充
待补充
待补充
curl https://api.pingxx.com/v1/royalty_templates \
-H "Pingplusplus-Signature: {SIGNATURE}" \
-H "Pingplusplus-Request-Timestamp: 1496728534" \
-u sk_test_ibbTe5jLGCi5rzfH4OqPW9KC: \
-d '{
"app": "app_1Gqj58ynP0mHeX1q",
"name": "royalty_templates name",
"rule": {
"royalty_mode": "rate",
"refund_mode": "no_refund",
"allocation_mode": "receipt_reserved",
"data": [
{
"level": 0,
"value": 11
},
{
"level": 1,
"value": 12
}
]
}
}
'待补充
待补充
待补充
待补充
待补充
待补充
待补充
{
"id": "450170814144600001",
"object": "royalty_template",
"livemode": false,
"app": "app_1Gqj58ynP0mHeX1q",
"name": "royalty_templates name",
"created": 1502693202,
"description": null,
"rule": {
"royalty_mode": "rate",
"refund_mode": "no_refund",
"allocation_mode": "receipt_reserved",
"data": [
{
"level": 0,
"value": 11
},
{
"level": 1,
"value": 12
}
]
}
}