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.
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:
Get coins to learn the valid coin and network values. Cache the list for an hour or so.
Get range to check the amount is inside the current minimum and maximum for the pair.
Get estimate to show your user how much they will receive.
Create exchange with the user's receiving address. Show them the deposit address and exact amount to send.
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.
POSTcreate-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 code
Network
Coins
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 field
Type
Description
symbol
string
Coin symbol, lowercase. Use as from_coin / to_coin.
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.
Parameter
Type
Description
from_coinrequired
string
Coin you send, e.g. xmr.
from_networkrequired
string
Network of the coin you send, e.g. xmr.
to_coinrequired
string
Coin you receive, e.g. btc.
to_networkrequired
string
Network of the coin you receive, e.g. btc.
fixedoptional
boolean
true for a fixed rate, false (default) for floating. Limits can differ between the two.
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.
Parameter
Type
Description
from_coin, from_networkrequired
string
Coin and network you send.
to_coin, to_networkrequired
string
Coin and network you receive.
amountrequired
number
Amount of the send coin, e.g. 1.
fixedoptional
boolean
Fixed or floating rate (default floating).
Response field
Type
Description
estimated_amount
string
Amount of the receive coin your user can expect.
rate
string
Receive-coin units per one send-coin unit, all-in.
rate_id
string
Optional handle for this exact estimate. Pass it to create-exchange to use this rate.
valid_until
string
When the estimate (and its rate_id) expires.
refund_address_required
boolean
If true, create-exchange needs a refund_address.
network_fee, eta_minutes
string | null, integer | null
Payout network fee already included in the estimate, and typical completion time, when known.
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.
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.
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);
}
Most orders move waiting → confirming → exchanging → sending → finished. status_detail gives a finer view when you need it.
status
status_detail
Meaning
Final
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
}
HTTP
code
What to do
401
unauthorized
Missing or unknown API key. Check the x-api-key header.
403
key_disabled
Your key is switched off. Contact ChainSwap support.
404
not_found
No order with this ID for your key.
404
endpoint_not_found
Check the path against this guide.
405
method_not_allowed
Use the method shown for the endpoint (GET or POST).
409
rate_changed
The rate moved during creation. Show the new estimate in data and retry if accepted.
422
invalid_parameters
A parameter is missing or malformed. errors lists each field.
422
unsupported_coin, same_coin
Use a coin and network pair from get-coins, with two different coins.
422
amount_too_low, amount_too_high
Adjust the amount; min / max show the limit.
422
invalid_amount
Send a positive decimal amount.
422
pair_unavailable
The pair can't be swapped right now. Try later or offer another pair.
422
invalid_address
The address doesn't match the coin or network.
422
extra_id_required, refund_address_required
Add to_address_extra_id or refund_address.
422
rate_expired
The rate_id expired or doesn't match. Get a new estimate.
429
rate_limited
Too many requests. Wait for the seconds in Retry-After.
502
exchange_failed
The order couldn't be created and no deposit was requested. Retry.
503
api_disabled
The API is in maintenance. Retry later.
500
internal_error
Something 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.