接入教程
1. 获取API密钥或基本认证凭证
2. 确定源账户和目标账户ID
3. 构建资金转移请求
4. 调用余额控制API端点
5. 处理API响应
6. 验证资金转移状态
使用Python转移资金
python
import requests
import json
url = "https://api.example.com/balanceTransfer"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"sourceAccount": "source_merchant_account",
"targetAccount": "target_merchant_account",
"amount": {
"value": 10000,
"currency": "EUR"
},
"reference": "internal_transfer_001"
}
response = requests.post(url, headers=headers, json=payload)
print(f"Status Code: {response.status_code}")
print(f"Response: {response.json()}")
使用PHP转移资金
php
<?php
$url = "https://api.example.com/balanceTransfer";
$apiKey = "YOUR_API_KEY";
$data = [
"sourceAccount" => "source_merchant_account",
"targetAccount" => "target_merchant_account",
"amount" => [
"value" => 10000,
"currency" => "EUR"
],
"reference" => "internal_transfer_001"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: $apiKey",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "Status Code: $httpCode\n";
echo "Response: $response\n";
?>
使用JavaScript转移资金
javascript
const fetch = require('node-fetch');
const url = "https://api.example.com/balanceTransfer";
const apiKey = "YOUR_API_KEY";
const payload = {
sourceAccount: "source_merchant_account",
targetAccount: "target_merchant_account",
amount: {
value: 10000,
currency: "EUR"
},
reference: "internal_transfer_001"
};
const options = {
method: 'POST',
headers: {
"X-API-Key": apiKey,
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log("Response:", data))
.catch(error => console.error("Error:", error));
常见问题
余额控制API支持哪些货币?
该API支持Adyen平台处理的所有货币,具体货币列表需参考Adyen官方文档。资金转移必须在同一货币的账户间进行。
资金转移是实时的吗?
资金转移通常是即时处理的,但具体到账时间可能受银行处理时间和系统审核的影响。建议在非高峰时段操作并保留交易参考号。
转移资金需要额外费用吗?
在同一公司账户下的商户账户间转移资金通常不收取额外费用,但请查阅您的服务协议或联系Adyen客服确认具体条款。
Aitishiku.com