> ## Documentation Index
> Fetch the complete documentation index at: https://docs.velafi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建加密货币划转

> 在两个 VelaFi 商户托管钱包之间即时进行加密资产内部划转，无需支付链上 Gas 费。

使用此端点将加密资产从一个商户的 VelaFi 托管钱包内部划转到另一个商户的钱包。内部划转即时结算，不产生区块链 Gas 费。发送方余额记录显示为负的 `amount`（借记），接收方余额记录显示为正的 `amount`（贷记）。提供 `clientId` 可实现幂等性——使用相同 `clientId` 的重复请求将返回原始结果，而不会创建第二笔划转。

> [!NOTE]
>
> 所有请求都必须包含 `X-BH-TOKEN` 请求头和 `Content-Type: application/json`。

## 端点

`POST https://api.velafi.com/v2/assets/internalTransfer`

## 请求参数

**fromMerchantId** `number` *required*

发送加密货币的商户 ID。

**toMerchantId** `number` *required*

接收加密货币的商户 ID。

**tokenId** `string` *required*

要划转的代币符号。支持的值：`USDT`、`USDC`、`BTC`、`MMXN`。

**amount** `number` *required*

要划转的代币数量。

**clientId** `string`

您为此次划转指定的唯一标识符，用于实现幂等性。

## 响应字段

**code** `number`

HTTP 风格的响应码。`200` 表示成功。

**msg** `string`

可读的状态消息，例如 `SUCCESS`。

**data** `object`

**data 字段**

**id** `string`

此次划转的唯一记录 ID。

**tokenId** `string`

已划转的代币。

**amount** `string`

划转数量。在发送方记录中为负数（借记），在接收方记录中为正数（贷记）。

**clientId** `string`

您为此次划转提供的客户端标识符。

**merchantId** `string`

该记录所属的商户 ID（与 `fromMerchantId` 相同）。

**fromMerchantId** `string`

发送方商户 ID。

**toMerchantId** `string`

接收方商户 ID。

## 示例

```bash cURL theme={null}
curl -X POST https://api.velafi.com/v2/assets/internalTransfer \
  -H "X-BH-TOKEN: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fromMerchantId": 246,
    "toMerchantId": 61,
    "tokenId": "USDT",
    "amount": 10,
    "clientId": "crypto-transfer-001"
  }'
```

```json Response theme={null}
{
  "code": 200,
  "msg": "SUCCESS",
  "data": {
    "id": "4352",
    "tokenId": "USDT",
    "amount": "-10",
    "clientId": "crypto-transfer-001",
    "merchantId": "246",
    "fromMerchantId": "246",
    "toMerchantId": "61"
  }
}
```

> [!NOTE]
>
> 响应中的 `amount` 为负数，因为它表示发送方账户的借记。使用[查询加密货币划转](https://docs.velafi.com/cn/api-reference/merchant/query-crypto-transfers.md)端点可查看划转双方的记录。


## Related topics

- [创建加密货币提现](https://docs.velafi.com/cn/api-reference/crypto-wallet/create-crypto-withdrawal.md)
- [获取加密货币划转记录](https://docs.velafi.com/cn/api-reference/merchant/query-crypto-transfers.md)
- [加密货币提现事件](https://docs.velafi.com/cn/api-reference/webhooks/crypto-withdraw-message-push.md)
- [创建出金订单](https://docs.velafi.com/cn/api-reference/order/create-a-crypto-to-fiat-order.md)
- [获取加密货币提现记录](https://docs.velafi.com/cn/api-reference/crypto-wallet/get-crypto-withdrawal-history.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.