Swaps

Convert money you hold on your balance from one currency to another.

✅

What this does

You 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'

→ Get Balance

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'

→ Get Exchange Rates

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"
    }
  }'

→ Create Order

4. Wait for the final status

StatusMeaningWhat to do
initiatedSwap accepted—
asset_processingConverting—
asset_settledDone. Both balances updatedRefresh your balances
asset_settle_failedCouldn't convert. Your original balance is untouchedCreate a new order

Test it

Simulate Order Status

Related

Add Funds · Payouts · Balances


Did this page help you?