商户
提取待处理资金
将商户待处理资金 (Pending Fund) 账户中的可用余额提取到已注册的支付方式,并获取可追踪的交易 ID。
POST
/
v2
/
merchant
/
claimfunds
提取待处理资金
curl --request POST \
--url https://api-test.velafi.com/v2/merchant/claimfunds \
--header 'Content-Type: application/json' \
--header 'X-BH-TOKEN: <api-key>' \
--data '
{
"merchantId": 123,
"fiat": "<string>",
"amount": 123,
"userPaymentId": 123,
"clientId": "<string>"
}
'import requests
url = "https://api-test.velafi.com/v2/merchant/claimfunds"
payload = {
"merchantId": 123,
"fiat": "<string>",
"amount": 123,
"userPaymentId": 123,
"clientId": "<string>"
}
headers = {
"X-BH-TOKEN": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-BH-TOKEN': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: 123,
fiat: '<string>',
amount: 123,
userPaymentId: 123,
clientId: '<string>'
})
};
fetch('https://api-test.velafi.com/v2/merchant/claimfunds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api-test.velafi.com/v2/merchant/claimfunds")
.header("X-BH-TOKEN", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": 123,\n \"fiat\": \"<string>\",\n \"amount\": 123,\n \"userPaymentId\": 123,\n \"clientId\": \"<string>\"\n}")
.asString();{
"code": 123,
"msg": "<string>",
"data": {
"txId": 123,
"merchantId": 123,
"clientId": "<string>",
"fiat": "<string>",
"totalAmount": 123,
"amount": 123,
"fee": 123,
"userPaymentId": 123,
"createTime": "<string>"
}
}使用此端点从商户的待处理资金 (Pending Fund) 账户发起提现。请指定商户、法币、金额以及目标支付方式 ID(可通过
GET /v2/payments 获取)。VelaFi 会返回一个 txId,您可以通过资金记录端点使用它来追踪该提现。根据提现渠道的不同,可能会收取手续费。
所有请求都必须包含
X-BH-TOKEN 请求头和 Content-Type: application/json。目前支持的币种为 MXN 和 ARS。端点
POST https://api.velafi.com/v2/merchant/claimfunds
请求参数
number
必填
发起提现的商户 ID。
string
必填
要提现的法币。目前支持:
MXN、ARS。number
必填
以指定法币计的提现金额。
number
必填
用于接收资金的用户已注册支付方式的 ID。可通过
GET /v2/payments 获取。string
您为此次提现自定义的唯一标识符,用于幂等性控制和追踪。
响应字段
number
HTTP 风格的响应码。
200 表示成功。string
人类可读的状态消息,例如
SUCCESS。object
示例
cURL
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
}'
Response
{
"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"
}
}
请始终为每个提现请求提供唯一的
clientId。如果检测到重复的 clientId,API 将返回原始交易,而不会创建新交易。⌘I
提取待处理资金
curl --request POST \
--url https://api-test.velafi.com/v2/merchant/claimfunds \
--header 'Content-Type: application/json' \
--header 'X-BH-TOKEN: <api-key>' \
--data '
{
"merchantId": 123,
"fiat": "<string>",
"amount": 123,
"userPaymentId": 123,
"clientId": "<string>"
}
'import requests
url = "https://api-test.velafi.com/v2/merchant/claimfunds"
payload = {
"merchantId": 123,
"fiat": "<string>",
"amount": 123,
"userPaymentId": 123,
"clientId": "<string>"
}
headers = {
"X-BH-TOKEN": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-BH-TOKEN': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: 123,
fiat: '<string>',
amount: 123,
userPaymentId: 123,
clientId: '<string>'
})
};
fetch('https://api-test.velafi.com/v2/merchant/claimfunds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api-test.velafi.com/v2/merchant/claimfunds")
.header("X-BH-TOKEN", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": 123,\n \"fiat\": \"<string>\",\n \"amount\": 123,\n \"userPaymentId\": 123,\n \"clientId\": \"<string>\"\n}")
.asString();{
"code": 123,
"msg": "<string>",
"data": {
"txId": 123,
"merchantId": 123,
"clientId": "<string>",
"fiat": "<string>",
"totalAmount": 123,
"amount": 123,
"fee": 123,
"userPaymentId": 123,
"createTime": "<string>"
}
}
