VeilSwap Docs← Home

VeilSwap API Documentation

Public, unauthenticated REST API for instant cross-chain swaps with fixed-rate locking (Visual use only? Then you don't need this — the web UI at veilswap.io does everything without an account). This documentation targets builders integrating exchange functionality into wallets, bots and market tools.

Quick start

Three calls make a complete swap: get a quote → create an order with your payout address → send the deposit and poll status until paid. No API key, no registration — every endpoint is public.

  1. GET /api/quote — see what you receive for a given amount.
  2. POST /api/order — returns your unique deposit address.
  3. Send funds and poll GET /api/order/{id} until terminal state.
GET/api/currencies

Supported currencies

Returns every tradable asset (each coin × network combination) with fixed-rate availability, logos and metadata. Server-cached for 1 hour.

Example request

curl "https://veilswap.io/api/currencies"

Example response

{
  "coins": [
    {
      "id": "btc-btc",
      "ticker": "btc",
      "network": "btc",
      "name": "Bitcoin",
      "logo": "https://content-api.changenow.io/uploads/btc_1_527dc9ec3c.svg",
      "hasExtraId": false,
      "featured": true,
      "isStable": false
    }
    // … 460+ assets
  ]
}

Errors

  • 502 — Upstream provider unreachable (stale cache served when possible)
GET/api/quote

Get a quote

Returns the best available fixed-rate quote for a pair. The amount you send and what you receive are both locked at order creation — market movement after that does not change your payout.

ParameterTypeRequiredDescription
fromstringyesAsset ID from /api/currencies (e.g. `usdt-trx`)
tostringyesDestination asset ID (e.g. `xmr-xmr`)
amountnumberyesAmount of `from` asset to swap, must be > 0

Example request

curl "https://veilswap.io/api/quote?from=btc&to=eth&amount=0.1"

Example response

{
  "best": {
    "fromAsset": "btc",
    "toAsset": "eth",
    "fromAmount": 0.1,
    "toAmount": 3.09265379,
    "rate": 30.926538
  }
}

Errors

  • 400 — from/to/amount required — missing or invalid parameters
  • 404 — no route — pair not supported
  • 429 — rate limited — too many quote requests
POST/api/order

Create an order

Creates a fixed-rate order. The server re-quotes and locks the price at creation time — the `toAmount` returned is what you receive (up to network fees already accounted in the quote). No registration, no API key required.

ParameterTypeRequiredDescription
fromAssetstringyesSource asset ID, ≤32 chars (e.g. `btc-btc`)
toAssetstringyesDestination asset ID, ≤32 chars
fromAmountnumberyesAmount to send, must be within the pair's min/max (server validates)
toAddressstringyesDestination address on the target network, ≤256 chars
toExtraIdstringnoDestination memo/tag if required (e.g. XRP), ≤128 chars
refundAddressstringnoAddress to refund to if the order cannot complete
refundExtraIdstringnoRefund memo/tag if required

Example request

curl -X POST "https://veilswap.io/api/order" \
  -H "Content-Type: application/json" \
  -d '{
    "fromAsset": "eth-eth",
    "toAsset": "btc-btc",
    "fromAmount": 0.05,
    "toAddress": "bc1q…",
    "refundAddress": "0x…"
  }'

Example response

{
  "id": "26e65cce-2172-493f-9768-6f9d4badea93",
  "depositAddress": "TDcxfWaqzCXZvjeo3ccwxUS43LpLZoej6w",
  "depositExtraId": null,
  "fromAmount": 0.05,
  "toAmount": 1.54321000,
  "status": "waiting_deposit"
}

Errors

  • 400 — field validation failed (length/type) or amount outside pair limits — response includes `minAmount`/`maxAmount` when applicable
  • 409 — no route — pair unavailable for fixed-rate at this moment
  • 429 — rate limited — 10 orders / 10 minutes per IP
GET/api/order/{id}

Check order status

Polls current order status. Terminal states (`paid`, `expired`, `refunded`, `failed`) never regress and stop being polled — safe to stop checking once you see one.

ParameterTypeRequiredDescription
idstring (URL path)yesOrder UUID returned by POST /api/order

Example request

curl "https://veilswap.io/api/order/26e65cce-2172-493f-9768-6f9d4badea93"

Example response

{
  "id": "26e65cce-2172-493f-9768-6f9d4badea93",
  "status": "paid",
  "providerStatus": "finished",
  "toAmount": "1.54321000",
  "depositAddress": "TDcxfWaqzCXZvjeo3ccwxUS43LpLZoej6w",
  "depositExtraId": null,
  "fromAmount": "0.05",
  "fromAsset": "eth-eth",
  "toAsset": "btc-btc",
  "payinHash": "0xabc…",
  "payoutHash": "0xdef…"
}

Errors

  • 404 — not found — unknown order ID

Order lifecycle

1

waiting_deposit

2

confirming — your deposit is on-chain, waiting network confirmations

3

settling — provider is exchanging and broadcasting your payout

4

paid — complete, payout hash available

5

expired / refunded / failed — deposit auto-refunded to refundAddress

Usage guidelines

Questions & integrations

For API guidance, rate-limit increases or partnership integrations: [email protected] · Telegram @veilswap

Ready to try it out?

Open the exchange
API Documentation — VeilSwap