Swaps
Convert money you hold on your balance from one currency to another.
What this doesYou change money on your TransFi balance from one currency into another — EUR to USDT, USDT to PHP, USDT to USDC. Nothing comes in or goes out. It stays yours.
Swap or payout?If the money ends up with someone else, it's a payout — even if the currency changes. A swap is only for money you keep.
Steps
1. Check what you hold
curl -X GET 'https://sandbox-api.transfi.com/v3/balance' \
-H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
-H 'mid: YOUR_MID'2. Get the rate
curl -X GET 'https://sandbox-api.transfi.com/v3/rates?orderType=swap&fromCurrency=USDT&toCurrency=EUR&amount=5000' \
-H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
-H 'mid: YOUR_MID'3. Create the swap
No userId — a swap has no customer.
curl -X POST 'https://sandbox-api.transfi.com/v3/orders' \
-H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
-H 'mid: YOUR_MID' \
-H 'Content-Type: application/json' \
-d '{
"orderType": "swap",
"purposeCode": "company_expenses",
"partnerId": "swap-5001",
"source": {
"currency": "USDT",
"amount": "5000"
},
"destination": {
"currency": "EUR"
}
}'4. Wait for the final status
| Status | Meaning | What to do |
|---|---|---|
initiated | Swap accepted | — |
asset_processing | Converting | — |
asset_settled | Done. Both balances updated | Refresh your balances |
asset_settle_failed | Couldn't convert. Your original balance is untouched | Create a new order |
Test it
Related
Updated about 7 hours ago
Did this page help you?