划转
- POST
/api/v3/wallet/transfer/self
权重(IP): 20
在当前认证用户自己的资金、现货 Pro 和合约账户之间划转资产,需要 TRANSFER 划转权限。用户身份来自 API Key 鉴权结果,不接受请求参数指定用户 UID。
请求体(Request Body)
| 参数名 | 参数类型 | 是否必须 | 描述 |
|---|---|---|---|
| amount | String | 是 | 划转数量,必须大于 0,精度不得超过币种配置精度,超出返回 -1160。 |
| fromAccountType | String | 是 | 划出账户类型:UNIMARGIN(合约账户)、SPOT(现货账户)、FUNDING(资金账户)。 |
| toAccountType | String | 是 | 划入账户类型,枚举同 fromAccountType,且不能与划出账户相同。 |
| coin | String | 是 | 币种编码。 |
| bizId | String | 否 | 业务 ID。传入时业务部分必须为 16-32 位 ASCII 字母或数字,可带 openapi_ 前缀;无前缀时服务端自动补齐后存储和回传。不传时生成 openapi_ 加 32 位随机串。 |
| params | String | 否 | 业务备注或扩展说明。 |
请求示例
Code
返回参数
| 字段名 | 类型 | 字段说明 |
|---|---|---|
| code | Integer | 业务码,0 表示成功。 |
| msg | String | 响应信息。 |
| data.bizId | String | 实际使用的业务 ID。 |
| data.result | Boolean | true 表示划转成功。 |
| data.transferId | String | 划转 ID,有可能为 Null。 |
返回示例
Code
错误码
| 错误码 | Message |
|---|---|
| -2413 | Insufficient balance. |
| -2442 | Asset transfer failed. |
| -2443 | Asset transfer is processing. Retry with the same bizId. |
| -2444 | fromAccountType and toAccountType cannot be the same. |
| -2445 | bizId already exists. Reuse it only with the original request parameters. |
| -2446 | Legacy spot account is not supported. Use SPOT instead. |
| -2447 | bizId must contain 16 to 32 ASCII letters or digits, optionally prefixed with 'openapi_'. |
| -2452 | Exceeds the maximum amount available for transfer. |
| -1160 | Decimal precision error. |
其他钱包与前置校验错误见钱包接口错误码。