> ## 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.

# 提取待处理资金

> 将商户待处理资金 (Pending Fund) 账户中的可用余额提取到已注册的支付方式，并获取可追踪的交易 ID。

使用此端点从商户的待处理资金 (Pending Fund) 账户发起提现。请指定商户、法币、金额以及目标支付方式 ID（可通过 `GET /v2/payments` 获取）。VelaFi 会返回一个 `txId`，您可以通过[资金记录](https://docs.velafi.com/cn/api-reference/merchant/retrieve-funding-records.md)端点使用它来追踪该提现。根据提现渠道的不同，可能会收取手续费。

> [!NOTE]
>
> 所有请求都必须包含 `X-BH-TOKEN` 请求头和 `Content-Type: application/json`。目前支持的币种为 MXN 和 ARS。

## 端点

`POST https://api.velafi.com/v2/merchant/claimfunds`

## 请求参数

**merchantId** `number` *required*

发起提现的商户 ID。

**fiat** `string` *required*

要提现的法币。目前支持：`MXN`、`ARS`。

**amount** `number` *required*

以指定法币计的提现金额。

**userPaymentId** `number` *required*

用于接收资金的用户已注册支付方式的 ID。可通过 `GET /v2/payments` 获取。

**clientId** `string`

您为此次提现自定义的唯一标识符，用于幂等性控制和追踪。

## 响应字段

**code** `number`

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

**msg** `string`

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

**data** `object`

**data 字段**

**txId** `number`

此次提现交易的唯一 ID。

**merchantId** `number`

发起提现的商户 ID。

**clientId** `string`

您为此交易提供的客户端标识符。

**fiat** `string`

提现的法币。

**totalAmount** `number`

从待处理资金余额中扣除的总金额（金额 + 手续费）。

**amount** `number`

实际到账至支付方式的净金额。

**fee** `number`

此次提现收取的手续费。

**userPaymentId** `number`

接收资金的支付方式 ID。

**createTime** `string`

提现创建时的 Unix 时间戳（毫秒）。

## 示例

```bash cURL theme={null}
curl -X POST https://api.velafi.com/v2/merchant/claimfunds \
  -H "X-BH-TOKEN: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "merchantId": 3,
    "clientId": "withdraw-2024-001",
    "fiat": "MXN",
    "amount": 20.00,
    "userPaymentId": 91
  }'
```

```json Response theme={null}
{
  "code": 200,
  "msg": "SUCCESS",
  "data": {
    "txId": 1123123123,
    "merchantId": 3,
    "clientId": "withdraw-2024-001",
    "fiat": "MXN",
    "totalAmount": 22.00,
    "amount": 20.00,
    "fee": 2.00,
    "userPaymentId": 91,
    "createTime": "1737452292000"
  }
}
```

> [!TIP]
>
> 请始终为每个提现请求提供唯一的 `clientId`。如果检测到重复的 `clientId`，API 将返回原始交易，而不会创建新交易。


## Related topics

- [划转待处理资金](https://docs.velafi.com/cn/api-reference/merchant/transfer-pending-funds.md)
- [获取资金记录](https://docs.velafi.com/cn/api-reference/merchant/retrieve-funding-records.md)
- [资金记录事件](https://docs.velafi.com/cn/api-reference/webhooks/funding-records-message-push.md)
- [获取转账手续费](https://docs.velafi.com/cn/api-reference/merchant/get-transfer-pending-funds-fee.md)
- [入金（法币兑加密货币）](https://docs.velafi.com/cn/docs/guides/on-ramp.md)


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