curl --request POST \
--url https://api.qbank.cl/platform/v1/swaps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_asset": "USD",
"to_asset": "BTC",
"amount": "1000",
"idempotency_key": "swap-2026-07-10-a"
}
'
{
"swap_id": "8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"account_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"from_asset": "USD",
"to_asset": "BTC",
"from_amount": "1000.00",
"to_amount": "0.01568419",
"rate": "0.00001568",
"fees": [
{
"leg": "from",
"asset": "USD",
"percent": "0.20"
},
{
"leg": "to",
"asset": "BTC",
"percent": "0.15"
}
],
"fee_total_pct": "0.3500",
"fee_note": "included_in_rate",
"coverage_exempt": false,
"status": "completed",
"idempotency_key": "swap-2026-07-10-a",
"created_at": "2026-07-10T15:00:00Z",
"idempotency_hit": true
}
创建 swap
在你的两种货币之间同步、原子地兑换余额——余额即时变动,资金从不离开你的账户(无需 OTP)。波动性交易对(BTC/GOLD/SILVER/PLATINUM)使用独立的单笔限额(等值 100,000 USDT)及 24 小时交易量限额(每账户 500,000 USDT);payouts 和卡片消费保留其独立的共享额度池。必须提供幂等键:重放会返回原始 swap,绝不重复执行。
POST
/
v1
/
swaps
curl --request POST \
--url https://api.qbank.cl/platform/v1/swaps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_asset": "USD",
"to_asset": "BTC",
"amount": "1000",
"idempotency_key": "swap-2026-07-10-a"
}
'
{
"swap_id": "8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"account_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"from_asset": "USD",
"to_asset": "BTC",
"from_amount": "1000.00",
"to_amount": "0.01568419",
"rate": "0.00001568",
"fees": [
{
"leg": "from",
"asset": "USD",
"percent": "0.20"
},
{
"leg": "to",
"asset": "BTC",
"percent": "0.15"
}
],
"fee_total_pct": "0.3500",
"fee_note": "included_in_rate",
"coverage_exempt": false,
"status": "completed",
"idempotency_key": "swap-2026-07-10-a",
"created_at": "2026-07-10T15:00:00Z",
"idempotency_hit": true
}
请求体
application/json
响应
幂等重放(原始 swap,绝不重复执行)。