Skip to content

Partner API · v1

ChainSwap Developer API

Add crypto swaps to your wallet, app or website. One REST API gives you supported coins, live limits and estimates, exchange creation and order tracking. ChainSwap routes each swap to a vetted liquidity provider, and your users never need a ChainSwap account.

  • REST + JSON
  • API key in a header
  • Fixed and floating rates
  • 22 coins and tokens
  • Order tracking links

Overview

The ChainSwap API lets your platform offer crypto-to-crypto swaps without building exchange infrastructure. You send the coins, networks and amount; ChainSwap finds a liquidity provider that can fill the swap, returns a deposit address, and keeps the order updated until the payout lands.

  • No accounts for your users. Swaps need only a receiving address and, ideally, a refund address. The liquidity provider handling a swap may run its own checks.
  • All-in rates. Every estimate already includes service costs. There is no fee field to add or subtract: what estimated_amount says is what we expect your user to receive.
  • Stable identifiers. Coins are always identified by symbol and network, so USDT on Tron and USDT on Ethereum never get mixed up.
  • Trackable orders. Every exchange gets a ChainSwap order ID and a public tracking page you can link to.

Base URL

https://chainswap.io/api/v1

All endpoints are served over HTTPS only. The version is part of the path; changes inside v1 only ever add fields.

Quickstart

A complete swap takes five calls:

  1. Get coins to learn the valid coin and network values. Cache the list for an hour or so.
  2. Get range to check the amount is inside the current minimum and maximum for the pair.
  3. Get estimate to show your user how much they will receive.
  4. Create exchange with the user's receiving address. Show them the deposit address and exact amount to send.
  5. Get exchange every 30 to 60 seconds to follow the order until it is finished.
  • waiting
  • confirming
  • exchanging
  • sending
  • finished

Authentication

Every request must include your API key in the x-api-key header. Keys are issued per partner; contact us to get one.

Header
x-api-key: YOUR_API_KEY

Keep your key on your server. Never put it in browser JavaScript, a mobile app bundle or a public repository. Anyone with your key can create orders under your account. If a key leaks, ask us for a new one and the old key stops working at once.

A missing or unknown key returns 401 with "message": "Unauthorized". A key that has been switched off returns 403.

Requests and responses

  • GET endpoints take query-string parameters.
  • POST create-exchange accepts multipart/form-data, application/x-www-form-urlencoded or a JSON body with the same field names.
  • Booleans (fixed) accept true/false, 1/0 or a JSON boolean. If you leave fixed out, a floating rate is used.
  • Amounts are decimal numbers with a dot, such as 0.25. Responses return amounts as strings so no precision is lost; parse them with a decimal library rather than floating point.
  • Coin and network values are case-insensitive. Responses always use lowercase.
  • Timestamps are ISO 8601 in UTC.

Every response has the same envelope. Successful calls return "status": "success" with the result in data. Failed calls return "status": "error", a readable message and a stable code you can branch on (see Errors).

Coins and networks

A coin is identified by its symbol plus its network, for example usdt + trx for USDT on Tron. Always take both values from get-coins. These network codes are in use today:

Network codeNetworkCoins
btc Bitcoin BTC
xmr Monero XMR
eth Ethereum (ERC-20) 1INCH, AAVE, ETH, USDC, USDT, YFI
trx Tron (TRC-20) TRX, USDT
sol Solana SOL, USDC, USDT
ltc Litecoin LTC
bsc BNB Smart Chain (BEP-20) BNB
arbitrum Arbitrum One ARB
ada Cardano ADA
doge Dogecoin DOGE
ton TON TON
xrp XRP Ledger XRP
zec Zcash ZEC
bch Bitcoin Cash BCH

For convenience, common token-standard names are accepted as input too: erc20, trc20, bep20 and spl, as well as full names such as ethereum or tron. Responses always use the codes above.

Coins with has_extra_id: true need a memo, tag or extra ID on the receiving side when the receiving account asks for one. Pass it as to_address_extra_id.

Endpoints

All paths are relative to https://chainswap.io/api/v1.

Get coins

GET/get-coins

Returns every coin and network you can swap, with its network code, contract address for tokens, whether it needs an extra ID, and its availability. No parameters.

Response fieldTypeDescription
symbolstringCoin symbol, lowercase. Use as from_coin / to_coin.
networkstringNetwork code. Use as from_network / to_network.
name, network_namestringDisplay names.
contract_addressstring | nullToken contract, or null for a network's own coin.
has_extra_idbooleanThe coin can need a memo, tag or extra ID.
is_token, decimalsboolean, integerToken flag and on-chain precision.
is_availablebooleanCurrently offered for swaps.
imagestring | nullLogo URL (SVG).
cURL
curl https://chainswap.io/api/v1/get-coins \
  -H "x-api-key: YOUR_API_KEY"
JavaScript (Node.js 18+, server side)
const res = await fetch('https://chainswap.io/api/v1/get-coins', {
  headers: { 'x-api-key': process.env.CHAINSWAP_API_KEY },
});
const { status, data } = await res.json();
// data: [{ symbol: 'btc', network: 'btc', ... }, ...]
Response 200 (shortened)
{
  "status": "success",
  "data": [
    {
      "symbol": "btc",
      "name": "Bitcoin",
      "network": "btc",
      "network_name": "Bitcoin",
      "contract_address": null,
      "has_extra_id": false,
      "is_token": false,
      "decimals": 8,
      "is_available": true,
      "image": "https://chainswap.io/images/coins/btc.svg"
    },
    {
      "symbol": "usdt",
      "name": "Tether USD",
      "network": "trx",
      "network_name": "Tron (TRC-20)",
      "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "has_extra_id": false,
      "is_token": true,
      "decimals": 6,
      "is_available": true,
      "image": "https://chainswap.io/images/coins/usdt.svg"
    }
  ]
}

Get range

GET/get-range

Returns the current minimum and maximum amount of the send coin for a pair. Call it before creating an exchange, and show the limits in your form. max is null when there is no upper limit. Limits change with the market, so don't hard-code them.

ParameterTypeDescription
from_coin requiredstringCoin you send, e.g. xmr.
from_network requiredstringNetwork of the coin you send, e.g. xmr.
to_coin requiredstringCoin you receive, e.g. btc.
to_network requiredstringNetwork of the coin you receive, e.g. btc.
fixed optionalbooleantrue for a fixed rate, false (default) for floating. Limits can differ between the two.
cURL
curl "https://chainswap.io/api/v1/get-range?from_coin=xmr&from_network=xmr&to_coin=btc&to_network=btc&fixed=false" \
  -H "x-api-key: YOUR_API_KEY"
JavaScript (Node.js 18+, server side)
const params = new URLSearchParams({
  from_coin: 'xmr', from_network: 'xmr',
  to_coin: 'btc', to_network: 'btc',
  fixed: 'false',
});
const res = await fetch(`https://chainswap.io/api/v1/get-range?${params}`, {
  headers: { 'x-api-key': process.env.CHAINSWAP_API_KEY },
});
const { data } = await res.json();
console.log(data.min, data.max); // max is null when there is no upper limit
Response 200
{
  "status": "success",
  "data": {
    "from_coin": "xmr",
    "from_network": "xmr",
    "to_coin": "btc",
    "to_network": "btc",
    "fixed": false,
    "min": "0.12",
    "max": null
  }
}

Get estimate

GET/get-estimate

Returns how much of the receive coin your user can expect for an amount, with the rate. The estimate is all-in: service costs are already included. With a floating rate the final amount can move a little with the market until the deposit confirms.

ParameterTypeDescription
from_coin, from_network requiredstringCoin and network you send.
to_coin, to_network requiredstringCoin and network you receive.
amount requirednumberAmount of the send coin, e.g. 1.
fixed optionalbooleanFixed or floating rate (default floating).
Response fieldTypeDescription
estimated_amountstringAmount of the receive coin your user can expect.
ratestringReceive-coin units per one send-coin unit, all-in.
rate_idstringOptional handle for this exact estimate. Pass it to create-exchange to use this rate.
valid_untilstringWhen the estimate (and its rate_id) expires.
refund_address_requiredbooleanIf true, create-exchange needs a refund_address.
network_fee, eta_minutesstring | null, integer | nullPayout network fee already included in the estimate, and typical completion time, when known.
cURL
curl "https://chainswap.io/api/v1/get-estimate?from_coin=btc&from_network=btc&to_coin=eth&to_network=eth&amount=1&fixed=false" \
  -H "x-api-key: YOUR_API_KEY"
JavaScript (Node.js 18+, server side)
const params = new URLSearchParams({
  from_coin: 'btc', from_network: 'btc',
  to_coin: 'eth', to_network: 'eth',
  amount: '1', fixed: 'false',
});
const res = await fetch(`https://chainswap.io/api/v1/get-estimate?${params}`, {
  headers: { 'x-api-key': process.env.CHAINSWAP_API_KEY },
});
const { status, data, message } = await res.json();
if (status !== 'success') throw new Error(message);
console.log(`You receive about ${data.estimated_amount} ETH`);
Response 200
{
  "status": "success",
  "data": {
    "from_coin": "btc",
    "from_network": "btc",
    "to_coin": "eth",
    "to_network": "eth",
    "amount": "1",
    "estimated_amount": "31.42857",
    "rate": "31.42857",
    "fixed": false,
    "network_fee": null,
    "rate_id": "9d6c2f1e-3b7a-4c55-9e0f-2a8b1c4d5e6f",
    "valid_until": "2026-11-28T10:32:00+00:00",
    "refund_address_required": false,
    "eta_minutes": 20
  }
}

Create exchange

POST/create-exchange

Creates the order and returns the deposit address. Show your user the deposit_address, the exact from_amount and any deposit_extra_id, and ask them to send before valid_until. Store the id to track the order.

FieldTypeDescription
from_coin, from_network requiredstringCoin and network your user sends.
to_coin, to_network requiredstringCoin and network your user receives.
from_amount requirednumberAmount of the send coin, inside the range.
to_address requiredstringAddress that receives the swapped coins, on to_network.
fixed optionalbooleanFixed or floating rate (default floating).
to_address_extra_id optionalstringMemo, tag or extra ID for the receiving address. Required when the receiving account needs one.
refund_address optionalstringAddress on from_network for a refund if the swap can't be completed. Strongly recommended; required for some pairs (see refund_address_required).
refund_extra_id optionalstringMemo or tag for the refund address.
rate_id optionalstringThe rate_id from get-estimate, to create the order at that exact estimate. Must match the coins and amount and still be valid.

A successful call returns 201 Created with the order (same fields as get-exchange).

cURL
curl -X POST https://chainswap.io/api/v1/create-exchange \
  -H "x-api-key: YOUR_API_KEY" \
  -F from_coin=xmr \
  -F from_network=xmr \
  -F to_coin=btc \
  -F to_network=btc \
  -F from_amount=10 \
  -F to_address=bc1qmcgjmgd7fj4kmcxd2cnnkdrccg0aepw3l9u02l \
  -F refund_address=YOUR_USERS_XMR_REFUND_ADDRESS \
  -F fixed=false
JavaScript (Node.js 18+, server side)
const res = await fetch('https://chainswap.io/api/v1/create-exchange', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.CHAINSWAP_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from_coin: 'xmr', from_network: 'xmr',
    to_coin: 'btc', to_network: 'btc',
    from_amount: '10',
    to_address: 'bc1qmcgjmgd7fj4kmcxd2cnnkdrccg0aepw3l9u02l',
    refund_address: userRefundAddress,
    fixed: false,
  }),
});
const { status, data, message, code } = await res.json();
if (status !== 'success') throw new Error(`${code}: ${message}`);
// Show data.deposit_address and data.from_amount to your user, store data.id
Response 201
{
  "status": "success",
  "data": {
    "id": "CS-7K2QH-M9XTB",
    "status": "waiting",
    "status_detail": "awaiting_deposit",
    "status_label": "Waiting for your deposit",
    "from_coin": "xmr",
    "from_network": "xmr",
    "to_coin": "btc",
    "to_network": "btc",
    "from_amount": "10",
    "to_amount": "0.0412",
    "expected_to_amount": "0.0412",
    "rate": "0.00412",
    "fixed": false,
    "deposit_address": "84hDepositAddressExample...",
    "deposit_extra_id": null,
    "to_address": "bc1qmcgjmgd7fj4kmcxd2cnnkdrccg0aepw3l9u02l",
    "to_address_extra_id": null,
    "refund_address": "88RefundAddressExample...",
    "refund_extra_id": null,
    "deposit_hash": null,
    "payout_hash": null,
    "refund_hash": null,
    "valid_until": "2026-11-28T11:05:00+00:00",
    "track_url": "https://chainswap.io/order-status/CS-7K2QH-M9XTB",
    "created_at": "2026-11-28T10:05:00+00:00",
    "updated_at": "2026-11-28T10:05:01+00:00"
  }
}

If the rate moves while the order is being created, you get 409 with "code": "rate_changed" and the new estimate in data. Nothing was created and nothing should be sent. Show the new estimate to your user and call create-exchange again if they accept.

Get exchange

GET/get-exchange/{id}

Returns the current status and full details of an order you created. A key can only read its own orders. The ID is not case-sensitive.

Response fieldTypeDescription
idstringChainSwap order ID, e.g. CS-7K2QH-M9XTB.
statusstringOrder status (see Order statuses).
status_detail, status_labelstringFiner-grained status and a plain-language label you can show to users.
from_amountstringAmount to deposit.
to_amountstringExpected payout; the actual payout once finished.
expected_to_amount, ratestringAmount and rate quoted when the order was created.
deposit_address, deposit_extra_idstringWhere the user sends the deposit, with a memo if one is shown.
to_address, refund_address and extra IDsstringThe addresses you provided.
deposit_hash, payout_hash, refund_hashstring | nullBlockchain transaction IDs as they become known.
valid_untilstring | nullDeposit deadline.
track_urlstringPublic tracking page for this order. Safe to show your user.
created_at, updated_atstringTimestamps (UTC).
cURL
curl https://chainswap.io/api/v1/get-exchange/CS-7K2QH-M9XTB \
  -H "x-api-key: YOUR_API_KEY"
JavaScript (Node.js 18+, server side)
async function getExchange(id) {
  const res = await fetch(`https://chainswap.io/api/v1/get-exchange/${encodeURIComponent(id)}`, {
    headers: { 'x-api-key': process.env.CHAINSWAP_API_KEY },
  });
  const body = await res.json();
  if (body.status !== 'success') throw new Error(body.message);
  return body.data;
}

// Poll every 30 to 60 seconds until the order reaches a final status.
const FINAL = ['finished', 'refunded', 'failed', 'expired'];
let order = await getExchange('CS-7K2QH-M9XTB');
while (!FINAL.includes(order.status)) {
  await new Promise((r) => setTimeout(r, 45_000));
  order = await getExchange(order.id);
}
Response 200
{
  "status": "success",
  "data": {
    "id": "CS-7K2QH-M9XTB",
    "status": "finished",
    "status_detail": "completed",
    "status_label": "Completed",
    "from_coin": "xmr",
    "from_network": "xmr",
    "to_coin": "btc",
    "to_network": "btc",
    "from_amount": "10",
    "to_amount": "0.04131",
    "expected_to_amount": "0.0412",
    "rate": "0.00412",
    "fixed": false,
    "deposit_address": "84hDepositAddressExample...",
    "deposit_extra_id": null,
    "to_address": "bc1qmcgjmgd7fj4kmcxd2cnnkdrccg0aepw3l9u02l",
    "to_address_extra_id": null,
    "refund_address": "88RefundAddressExample...",
    "refund_extra_id": null,
    "deposit_hash": "a1b2c3...",
    "payout_hash": "f6e5d4...",
    "refund_hash": null,
    "valid_until": "2026-11-28T11:05:00+00:00",
    "track_url": "https://chainswap.io/order-status/CS-7K2QH-M9XTB",
    "created_at": "2026-11-28T10:05:00+00:00",
    "updated_at": "2026-11-28T10:41:12+00:00"
  }
}

Order statuses

Most orders move waiting → confirming → exchanging → sending → finished. status_detail gives a finer view when you need it.

statusstatus_detailMeaningFinal
waiting creating Preparing your order. Please wait a moment while we prepare your deposit details. No
waiting awaiting_deposit Waiting for your deposit. Send the exact amount to the deposit address before the window closes. No
confirming confirming Deposit received, confirming. No action needed. We're waiting for network confirmations. No
exchanging exchanging Exchanging. No action needed. Your swap is in progress. No
sending sending Sending to your wallet. No action needed. The payout is on its way. No
finished completed Completed. Your swap is complete. Check your wallet for the payout. Yes
verifying action_required Action needed. The liquidity provider needs something from you. Follow the steps below or contact support. No
refunding refund_pending Refund in progress. Your refund is being processed. We'll show the transaction once it's sent. No
refunded refunded Refunded. Your refund has been sent. See the refund transaction below. Yes
failed failed Swap could not be completed. Please contact support with your tracking ID so we can help. Usually
expired expired Deposit window closed. No deposit was matched in time. If you already sent funds, contact support with your tracking ID. Usually
failed create_failed Order not created. We couldn't create this order and no deposit was requested. Please start a new swap. Yes

verifying means the liquidity provider needs more information before it can continue; point your user to the track_url or ChainSwap support. failed and expired can still change, for example when a late deposit is matched or a refund is sent, so keep polling slowly for a while.

Errors

Errors use the HTTP status code and the same envelope as before, plus a code field that stays stable even if the wording of message changes.

Error response (422)
{
  "status": "error",
  "message": "Amount is below the minimum of 0.12.",
  "code": "amount_too_low",
  "min": "0.12",
  "max": null
}
HTTPcodeWhat to do
401unauthorizedMissing or unknown API key. Check the x-api-key header.
403key_disabledYour key is switched off. Contact ChainSwap support.
404not_foundNo order with this ID for your key.
404endpoint_not_foundCheck the path against this guide.
405method_not_allowedUse the method shown for the endpoint (GET or POST).
409rate_changedThe rate moved during creation. Show the new estimate in data and retry if accepted.
422invalid_parametersA parameter is missing or malformed. errors lists each field.
422unsupported_coin, same_coinUse a coin and network pair from get-coins, with two different coins.
422amount_too_low, amount_too_highAdjust the amount; min / max show the limit.
422invalid_amountSend a positive decimal amount.
422pair_unavailableThe pair can't be swapped right now. Try later or offer another pair.
422invalid_addressThe address doesn't match the coin or network.
422extra_id_required, refund_address_requiredAdd to_address_extra_id or refund_address.
422rate_expiredThe rate_id expired or doesn't match. Get a new estimate.
429rate_limitedToo many requests. Wait for the seconds in Retry-After.
502exchange_failedThe order couldn't be created and no deposit was requested. Retry.
503api_disabledThe API is in maintenance. Retry later.
500internal_errorSomething went wrong on our side. Retry with backoff; contact support if it persists.

Rate limits

Each API key has its own limit of requests per minute, agreed when the key is issued (60 per minute unless arranged otherwise). Every response tells you where you stand:

  • X-RateLimit-Limit: your requests per minute.
  • X-RateLimit-Remaining: requests left in the current minute.
  • Retry-After (on 429 only): seconds to wait before trying again.

To stay well inside your limit, cache get-coins, call get-range once per pair when your form loads rather than on every keystroke, and poll get-exchange no more than once every 30 seconds per order. Need more? Ask us to raise it.

Webhooks

The API does not send webhooks yet. Poll get-exchange for each active order: every 30 to 60 seconds while it is in progress, then stop once it is finished or refunded. Webhooks are on the roadmap and will be announced in the changelog.

Best practices

  • Always send a refund address. It lets a failed swap be returned without a support ticket.
  • Make networks explicit in your UI. Show the network next to every coin, and ask for a memo or tag when has_extra_id is true.
  • Show the deposit details exactly. Display the full deposit address, the exact amount and the deadline, with a copy button.
  • Describe estimates honestly. Floating-rate amounts are estimates; fixed-rate amounts are locked only while the deposit window is open.
  • Store the order ID and link the tracking page. Give your users the track_url so they can follow the swap and reach ChainSwap support.
  • Handle errors by code. Messages are for people and may be reworded; codes are for your program.
  • Retry safely. Retry reads freely. Don't blindly retry create-exchange after a timeout: check your stored orders first so a user never gets two deposit addresses for one swap.

Changelog

28 November 2026: v1 on the new ChainSwap platform
Same base URL, endpoints, x-api-key header and parameter names, so existing integrations keep working. Added: a stable error code; status_detail, status_label and track_url on orders; rate_id to create an order at an exact estimate; JSON bodies for create-exchange; rate-limit headers; token-standard network names (erc20, trc20, bep20, spl) as input. Order IDs now look like CS-7K2QH-M9XTB; treat them as opaque strings. Each key now sees only its own orders.
19 February 2026: v1 published
First public version: get-coins, get-range, get-estimate, create-exchange and get-exchange.

Developer API FAQ

Contact ChainSwap through the contact page or live chat with your company name, website and expected volume. Keys are issued per partner and come with their own rate limit.

No. Your users swap without a ChainSwap account. The liquidity provider handling a swap may run its own checks, as on the ChainSwap website.

The rate is all-in. The estimated_amount you receive from get-estimate already includes service costs, so there is no separate fee field to add or subtract. The sender only pays their own wallet's network fee for the deposit.

With fixed=true the receive amount is locked while the deposit window is open. With fixed=false the amount follows the market until the deposit confirms, so the final amount can differ slightly from the estimate.

Not yet. Poll get-exchange for status changes, about every 30 to 60 seconds while an order is active, and stop once it reaches a final status.

Yes. Version 1 keeps the same base URL, endpoints, x-api-key header and parameter names as before. New fields were added to responses, and nothing you already use was removed.

Ready to integrate?

Tell us about your product and expected volume, and we'll send your API key with a rate limit that fits. Questions while you build? We're on live chat.