商户
划转待处理资金
在 VelaFi 平台内将法币余额从一个商户的待处理资金账户即时划转至另一个商户,无需银行转账。
POST
/
v2
/
merchant
/
transfer
划转待处理资金
curl --request POST \
--url https://api-test.velafi.com/v2/merchant/transfer \
--header 'Content-Type: application/json' \
--header 'X-BH-TOKEN: <api-key>' \
--data '
{
"clientId": "<string>",
"fromMerchantId": 123,
"toMerchantId": 123,
"fiat": "<string>",
"paymentId": 123,
"fiatAmount": 123
}
'import requests
url = "https://api-test.velafi.com/v2/merchant/transfer"
payload = {
"clientId": "<string>",
"fromMerchantId": 123,
"toMerchantId": 123,
"fiat": "<string>",
"paymentId": 123,
"fiatAmount": 123
}
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({
clientId: '<string>',
fromMerchantId: 123,
toMerchantId: 123,
fiat: '<string>',
paymentId: 123,
fiatAmount: 123
})
};
fetch('https://api-test.velafi.com/v2/merchant/transfer', 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/transfer")
.header("X-BH-TOKEN", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"<string>\",\n \"fromMerchantId\": 123,\n \"toMerchantId\": 123,\n \"fiat\": \"<string>\",\n \"paymentId\": 123,\n \"fiatAmount\": 123\n}")
.asString();{
"code": 123,
"msg": "<string>",
"data": {
"clientId": "<string>",
"fromId": 123,
"toId": 123,
"fiat": "<string>",
"fiatAmount": "<string>",
"totalFiatAmount": "<string>",
"fee": "<string>",
"createTime": 123
}
}使用此端点在 VelaFi 系统内的两个商户账户之间划转法币资金。该划转为内部操作,无需银行交易。转出和转入商户都必须拥有与指定
fiat 和 paymentId 组合对应的有效账户。发起划转前,请先使用划转手续费端点查询适用的费用。
所有请求都必须包含
X-BH-TOKEN 请求头和 Content-Type: application/json。clientId 用于保证幂等性——重复的 clientId 值将返回原始结果。端点
POST https://api.velafi.com/v2/merchant/transfer
请求参数
string
必填
您为此次划转设置的唯一标识符。用于去重和追踪。
number
必填
转出资金的商户 ID。
number
必填
接收资金的商户 ID。
string
必填
要划转的法币。支持的值:
MXN、ARS、COP、BRL、PEN。number
必填
与法币对应的支付渠道 ID:
105或72— MXN63— ARS68— COP90— BRL95— PEN
number
必填
以指定法币计价的划转金额。
响应字段
number
HTTP 风格的响应码。
200 表示成功。string
可读的状态消息,例如
SUCCESS。object
示例
- MXN
- ARS
- COP / BRL / PEN
cURL
curl -X POST https://api.velafi.com/v2/merchant/transfer \
-H "X-BH-TOKEN: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"clientId": "transfer-mxn-001",
"fromMerchantId": 434,
"toMerchantId": 5,
"fiat": "MXN",
"paymentId": 105,
"fiatAmount": 10
}'
Response
{
"code": 200,
"msg": "SUCCESS",
"data": {
"clientId": "transfer-mxn-001",
"fromId": 521006138624569344,
"toId": 521006138641346560,
"fiat": "MXN",
"fiatAmount": "10",
"totalFiatAmount": "10",
"fee": "0",
"createTime": 1746694343261
}
}
Request body
{
"clientId": "transfer-ars-001",
"fromMerchantId": 434,
"toMerchantId": 5,
"fiat": "ARS",
"paymentId": 63,
"fiatAmount": 10
}
Response
{
"code": 200,
"msg": "SUCCESS",
"data": {
"clientId": "transfer-ars-001",
"fromId": 521006138624569345,
"toId": 521006138641346561,
"fiat": "ARS",
"fiatAmount": "10",
"totalFiatAmount": "10",
"fee": "0",
"createTime": 1746694343261
}
}
COP Request body
{
"clientId": "transfer-cop-001",
"fromMerchantId": 15127301,
"toMerchantId": 15127302,
"fiat": "COP",
"paymentId": 68,
"fiatAmount": 10
}
BRL Request body
{
"clientId": "transfer-brl-001",
"fromMerchantId": 15127301,
"toMerchantId": 15127302,
"fiat": "BRL",
"paymentId": 90,
"fiatAmount": 10
}
PEN Request body
{
"clientId": "transfer-pen-001",
"fromMerchantId": 15127301,
"toMerchantId": 15127302,
"fiat": "PEN",
"paymentId": 95,
"fiatAmount": 10
}
使用
fromId 和 toId 值在资金记录端点中查找对应条目,以获取完整的审计轨迹。⌘I
划转待处理资金
curl --request POST \
--url https://api-test.velafi.com/v2/merchant/transfer \
--header 'Content-Type: application/json' \
--header 'X-BH-TOKEN: <api-key>' \
--data '
{
"clientId": "<string>",
"fromMerchantId": 123,
"toMerchantId": 123,
"fiat": "<string>",
"paymentId": 123,
"fiatAmount": 123
}
'import requests
url = "https://api-test.velafi.com/v2/merchant/transfer"
payload = {
"clientId": "<string>",
"fromMerchantId": 123,
"toMerchantId": 123,
"fiat": "<string>",
"paymentId": 123,
"fiatAmount": 123
}
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({
clientId: '<string>',
fromMerchantId: 123,
toMerchantId: 123,
fiat: '<string>',
paymentId: 123,
fiatAmount: 123
})
};
fetch('https://api-test.velafi.com/v2/merchant/transfer', 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/transfer")
.header("X-BH-TOKEN", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"<string>\",\n \"fromMerchantId\": 123,\n \"toMerchantId\": 123,\n \"fiat\": \"<string>\",\n \"paymentId\": 123,\n \"fiatAmount\": 123\n}")
.asString();{
"code": 123,
"msg": "<string>",
"data": {
"clientId": "<string>",
"fromId": 123,
"toId": 123,
"fiat": "<string>",
"fiatAmount": "<string>",
"totalFiatAmount": "<string>",
"fee": "<string>",
"createTime": 123
}
}
