查询分账

更新时间 2024-07-24 02:58:49
收藏
我的收藏

开发者可通过此接口查询订单的分账记录。

使用限制

无。

注意事项

无。

基本信息

基本信息


HTTP URL

https://open.douyin.com/api/apps/trade/v2/settle/query_settle

HTTP Method

POST

Scope

industry_open.trade.settle

权限要求

  • 需要Scope权限
  • 不需要用户授权

请求头

参考通用参数

请求参数

名称

类型

是否必填

描述

示例值

out_order_no

string

开发者侧订单 id,长度 <= 64 字节

out_order_example_1

out_settle_no

string

开发者侧分账单 id,长度 <= 64字节

out_settle_example_1

order_id

string

抖音开平侧订单 id,长度 <= 64字节

ot7053735385750849836

settle_id

string

抖音开平侧分账单 id,长度 <= 64字节

example_settle_no

  • 以上 4 个参数选填一个,查询优先级:settle_id > order_id > out_settle_no > out_order_no。例如:请求填写了settle_id 和 order_id,服务只会按 settle_id 来查询,忽略 order_id 。如果未查询到结果,会返回空数组。
  • 注意:对于担保交易订单,如果需要根据 order_id/out_order_no 查询订单的分账记录,建议使用 order_id(抖音开平侧支付单 id 查询),若使用 out_order_no 可能存在查询不到的情况。

请求示例

curl -X POST '
-H 'Content-Type:application/json'
--data '{
    "out_order_no":"",
    "out_settle_no":"",
    "order_id":"ot7053735385750849836",
    "settle_id":""
}'

响应参数

名称

类型

描述

示例值

data

Array(object)

分账结果

见下文示例

extra

object

额外信息


data 字段说明

名称

类型

描述

示例值

out_order_no

string

开发者侧交易订单 id,长度 <= 64 字节,由数字、ASCII 字符组成

out_order_example_1

out_settle_no

string

开发者侧分账单 id,长度 <= 64字节,由数字、ASCII 字符组成

out_settle_example_1

order_id

string

抖音开平侧交易订单 id,长度 <= 64 字节,由数字、ASCII 字符组成

ot7053735385750849836

settle_id

string

抖音开平侧分账单id,长度 <= 64 字节,由数字、ASCII 字符组成

ot7053723547314981164

item_order_id

string

抖音开平侧item单 id,长度 <= 64 字节,由数字、ASCII 字符组成,按券分账时该字段不为空

ot78318372940872837161

settle_amount

int64

分账金额,单位分

1000

settle_status

string

分账状态:

  • INIT:初始化
  • PROCESSING:处理中
  • SUCCESS:处理成功
  • FAIL:处理失败

SUCCESS

settle_detail

string

分账详情

商户号68882720803499563550-分成金额(分)840

settle_time

int64

分账时间,13 位时间戳,单位毫秒

1639733782000

rake

int64

手续费,单位分

60

commission

int64

佣金,单位分

100

cp_extra

string

开发者自定义透传字段,长度 <= 2048 字节,不支持二进制数据

test

inner_settle_id

string

用于退分账场景,对应退分账接口文档中settle_no,长度<= 64字节

7163169266042108164

extra 信息

名称

类型

是否必填

描述

示例值

error_code

int

错误码,0为成功

0

description

string

错误码描述

success

sub_error_code

int

子错误码

0

sub_description

string

子错误码描述

success

logid

string

请求id

2022092115392201020812109511046

now

int

毫秒级时间戳

1663745962686

响应示例

正常示例

  • 按券分账时,item_order_id不为空
  • 整单分账是,item_order_id为空
{
  "data": [
    {
      "out_order_no": "out_order_example_1",
      "out_settle_no": "out_settle_example_1",
      "order_id": "ot7053735385750849836",
      "settle_id": "ot7053723547314981164",
      "item_order_id": "ot78318372940872837161",
      "settle_amount": 1000,
      "settle_status": "SUCCESS",
      "settle_detail": "商户号68882720803499563550-分成金额(分)840",
      "settle_time": 1639733782000,
      "rake": 60,
      "commission": 100,
      "cp_extra": "test",
      "inner_settle_id": "7163169266042108164"
    }
  ],
  "extra": {
    "sub_error_code": 0,
    "sub_description": "success",
    "logid": "2022092115392201020812109511046",
    "now": 1663745962686,
    "error_code": 0,
    "description": "success"
  }
}

异常示例

{
  "extra": {
    "sub_error_code": 23002,
    "sub_description": "订单id,分账单id至少指定一个",
    "logid": "2022092115392201020812109511046",
    "now": 1663745962686,
    "error_code": 2190004,
    "description": "应用未获得该能力, 请去https://open.douyin.com/申请"
  }
}

错误码

详情参见错误码/返回码