POST
发起分账或分账回退
该接口用于对已完成的支付发起分账,或对一笔已有分账发起回退,由
profitType 决定本次执行的操作。请求
gatewayReference条件:
要分账的 Onerway 支付交易,取创建支付时返回的 profitType 为 share 时必填。transactionId。示例:
replace_with_transaction_id约束
- 规则
- 创建支付时必须设置
paymentMethodOptions.share.profitShare=true,否则该笔支付不具备分账资格。 - 规则
profitType为return时不要传入;回退通过profitParentReference与profitGatewayReference定位原分账单。
merchantNo发起本次分账或分账回退的商户号。
示例:
replace_with_merchant_no约束
- 规则
- 平台模式下传收款的子商户号,与创建该笔支付时使用的
merchantNo保持一致。
profitCompleted条件:
本次请求是否已结束该笔支付的分账;后续还会继续分账时传 profitType 为 share 时必填。false。示例:
false约束
- 规则
- 一旦传入
true,该笔支付后续再发起分账会被拒绝。
profitGatewayReference条件:
被回退的原分账单号,由 Onerway 在发起分账时返回。profitType 为 return 时必填。示例:
replace_with_original_profit_gateway_referenceprofitParentReference条件:
被回退的原分账请求号。自动分账的请求号由 Onerway 生成。profitType 为 return 时必填。示例:
replace_with_original_profit_referenceprofitReference本次分账或分账回退的商户侧请求号。
示例:
example_profit_share_reference约束
- 规则
- 该字段作为幂等键使用;分账与分账回退的请求号需全局唯一。
profitType要执行的操作类型;该值决定哪些关联单号字段必填。
示例:
share可选值
share- 对已完成的支付发起分账。
return- 对一笔已有分账发起回退。
receivers{ profitDetailReference, type, ... }分账或分账回退的接收方列表;每条明细传入一个对象。
sign请求签名字符串;生成方式详见请求签名。
urlCallback条件:原支付未配置
接收本次 API 分账或分账回退结果通知的地址。原支付已配置 paymentMethodOptions.share.profitShareNotifyUrl 时必填。paymentMethodOptions.share.profitShareNotifyUrl 时,无需再传本字段。示例:
replace_with_callback_urlcurl -X POST 'https://sandbox-acq.onerway.com/profit/share' \
-H 'Content-Type: application/json' \
--data-raw '{
"currency": "USD",
"gatewayReference": "replace_with_transaction_id",
"merchantNo": "replace_with_merchant_no",
"profitCompleted": false,
"profitReference": "example_profit_share_reference",
"profitType": "share",
"receivers": "[{\"profitDetailReference\":\"example_profit_share_detail_reference\",\"type\":\"1\",\"account\":\"replace_with_receiver_merchant_no\",\"amount\":\"80.00\",\"description\":\"Seller settlement\"}]",
"sign": "replace_with_calculated_signature",
"urlCallback": "https://developers.onerway.com/example-profit-callback"
}'{
"respCode": "20000",
"respMsg": "Success",
"data": {
"profitType": "share",
"profitReference": "example_profit_share_reference",
"profitGatewayReference": "replace_with_profit_gateway_reference",
"state": "processing",
"currency": "USD",
"receivers": "[{\"profitDetailReference\":\"example_profit_share_detail_reference\",\"profitDetailGatewayReference\":\"replace_with_profit_detail_gateway_reference\",\"type\":\"1\",\"amount\":\"80.00\",\"result\":\"pending\",\"failReason\":null,\"createdAt\":\"2026-06-22 10:00:00\",\"finishedAt\":null}]",
"sign": "replace_with_sha256_signature"
}
}该接口暂未记录错误响应。