商户
提取待处理资金
将商户待处理资金 (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、COP、BRL 和 PEN,且须使用支持提现的渠道:MXN 为 SPEI (Finco Pay) 和 CLABE - Tesored,ARS 为 CBU/CVU (Momentum),COP 为 Cobre,BRL 为 Pix (Genial) 和 Pix - Woovi,PEN 为 Supefina。提现通过该商户币种账户的渠道发出,userPaymentId 必须是登记在该账户下的收款人。端点
POST https://api.velafi.com/v2/merchant/claimfunds
请求参数
响应字段
示例
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 已被您账户下的任何资金记录(提现或划转)使用,请求将被拒绝并返回 -1174(Repeated submit request.),不会创建新的提现。请通过资金记录查询原提现。⌘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>"
}
}