AllSwap

Quickstart

From zero to a tracked cross-chain order in 5 curl commands. Direct API access is for approved partner integrations; request access here.

Sandbox vs. live. Start with sandbox keys while you test the HTTP flow. Move to live keys only after your deposit-address UI, memo handling, and status tracking are reviewed.

1. Get your API key

Every request is authenticated with two headers: X-Key-Id identifies the key, and Authorization: Bearer carries the secret. Keep the secret on your server; never ship it to a browser.

X-Key-Id: ak_live_yourapp
Authorization: Bearer sk_live_REPLACE_ME
Content-Type: application/json

Read more in Authentication, including rotation and key-scope behavior.

2. List routable assets

Assets are identified by CAIP-19. Store the returned assetId; that is what you pass as originAsset and destinationAsset.

curl https://api.allswap.io/v1/assets \
  -H "X-Key-Id: ak_live_yourapp" \
  -H "Authorization: Bearer sk_live_..."

3. Preview a quote

Use dry: true to get a non-binding preview. The response returns provider candidates, a best provider, destination amount, fee estimate, and ETA.

curl -X POST https://api.allswap.io/v1/quote \
  -H "X-Key-Id: ak_live_yourapp" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "originAsset": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7",
    "destinationAsset": "tron:mainnet/trc20:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
    "amount": "1000000000",
    "sender": "0xYourSourceAddress",
    "recipient": "TYourDestinationAddress",
    "dry": true
  }'

amount is always in the source asset's smallest unit. Refresh the preview before the user confirms because liquidity and provider availability move quickly.

4. Create an order

Submit the accepted route with a providerId. Allswap returns a one-time depositAddress; if depositMemo is present, show it next to the address and require the user to copy both.

curl -X POST https://api.allswap.io/v1/order \
  -H "X-Key-Id: ak_live_yourapp" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "originAsset": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7",
    "destinationAsset": "tron:mainnet/trc20:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
    "amount": "1000000000",
    "sender": "0xYourSourceAddress",
    "recipient": "TYourDestinationAddress",
    "providerId": "route_A"
  }'
Deposit-address mode. Your app does not sign transactions. The user sends funds from their own wallet to the deposit address, and Allswap executes after the deposit is detected.

5. Track status

Poll GET /v1/order/{id} every 10-15 seconds until a terminal status, or use webhooks once enabled for your partner account.

curl https://api.allswap.io/v1/order/ord_01HW9... \
  -H "X-Key-Id: ak_live_yourapp" \
  -H "Authorization: Bearer sk_live_..."

Where to go next