发起分账
开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
https://open.douyin.com/api/trade_basic/v1/developer/settle_create
使用限制
接口说明
接入前准备
分账规则
举个例子 小程序 A 是核销 D+3 分账,用户的一笔订单 X 买了 5 张团购券 按整单分账时,对于订单 X,其中 3 张先核销,剩余 2 张再退款,最终退款完成的时间就是订单到达终态的时间。订单到达终态 3 天后,则可以发起分账 按券分账时,对于订单 X,其中 1 张券先核销,核销 3 天后可以发起这张券的分账 如果是次卡订单,对于订单 X,履约了第 1、2 次发起分账,则本次分账会将第 1、2 次对应的金额进行结算
分账类型
分账发起方
错误码
HTTP 状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 10000 | param error | 请根据返回错误信息,修正传参。 |
400 | 23000 | system error | 内部错误,可以原参重新请求 |
400 | 23024 | item_order_id not exist | item_order_id对应订单不存在,请检查传参是否正确 |
400 | 23025 | item_order_id not match out_order_no | item_order_id对应订单与out_order_no对应订单不匹配 |
400 | 23101 | order does not exist | 对应的订单不存在,请检查传参 |
400 | 23102 | order not pay | 订单未支付成功,无法分账 |
400 | 23107 | order not finish | 订单未完成,当前无法分账(配置了核销后分账,当前订单未核销) |
400 | 23111 | out_settle_no has existed | 该分账单已存在,请用查询接口查询分账结果 |
400 | 23112 | no money to settle | 已无可分账金额 |
400 | 23113 | order not allow settle | 订单不允许分账,当前无可分账子单 |
400 | 23117 | this appID is configured with automatic settlement | 该订单属于自动结算单,无需开发者请求分账 |
400 | 23118 | not allow entire settle | 不允许整单结算,当前已存在子单券结算,不再允许整单结算 |
400 | 23124 | partial settle is grayscale | 部分分账功能灰度中,请联系运营开通 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open.douyin.com/api/trade_basic/v1/developer/settle_create' \
--header 'Content-Type: application/json' \
--data-raw '{
"out_order_no":"out_order_example_1",
"out_settle_no":"out_settle_example_1",
"settle_desc":"分账描述",
"settle_params":"[{\"merchant_uid\":\"分账方商户号1\",\"amount\":100}]",
"ext":"test",
"notify_url":"https://www.xxxx.com"
}'
响应示例响应示例
200 - 示例 1
{
"err_msg": "string",
"err_no": 0,
"log_id": "string",
"data": {
"wallet_settle_id": "string",
"settle_id": "string"
}
}
请求参数
Body 参数application/json