Exchange API

Quote and create crypto swaps from your own product. Every swap created with your key is counted for your partner account and earns you a share.

Base URL
https://cloudswap.io/api/partner/v1
Format
JSON over HTTPS. Amounts are decimal strings.
Limit
120 requests per minute per key

Authentication

Create a key in the partner dashboard and send it in the X-Api-Key header of every request. The key is shown once; if it leaks, issue a new one and the old key stops working at once. Keep the key on your server: do not put it into a web page or a mobile app.

List currencies

GET/currencies

Coins you can send to us (side=from) or receive (side=to). Every coin has an id of the form ticker:network — use it in all other calls.

sidefrom | toWhich list to return. Default: to.
qstringSearch by ticker or name.
limit1–100How many to return. Default: 50.
Request
curl "https://cloudswap.io/api/partner/v1/currencies?side=from&q=btc" \
  -H "X-Api-Key: csk_your_key"
Response
{
  "total": 1,
  "currencies": [
    {
      "id": "btc:btc",
      "symbol": "BTC",
      "name": "Bitcoin",
      "network": "Bitcoin",
      "hasExtraId": false,
      "extraIdName": null,
      "addressRegex": "^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,62}$",
      "canSend": true,
      "minSend": "0.0002"
    }
  ]
}

Get an estimate

GET/estimate

How much the customer receives. With fixed=true the answer includes a quoteId: a swap created with it within the validity time pays exactly amountOut. With fixed=false the amount is an estimate and is settled at the rate when the deposit is confirmed.

fromcoin idWhat the customer sends.
tocoin idWhat the customer receives.
amountstringAmount to send, as a decimal string.
fixedtrue | falseFixed or floating rate. Default: true.
Request
curl "https://cloudswap.io/api/partner/v1/estimate?from=btc:btc&to=usdt:trx&amount=0.1" \
  -H "X-Api-Key: csk_your_key"
Response
{
  "from": "btc:btc",
  "to": "usdt:trx",
  "amountIn": "0.1",
  "amountOut": "6742.31",
  "rate": "67423.1",
  "networkFee": "1.5",
  "fixed": true,
  "quoteId": "eyJmIjoiYnRjOmJ0YyIsInQiOiJ1c2R0OnRyeCJ9…",
  "validUntil": "2026-11-13T19:05:00.000Z"
}

Create an exchange

POST/exchanges

Creates a swap and returns the deposit address. Show the customer depositAddress (and depositExtraId when it is not null) and the exact amount. The swap is counted for your partner account.

from, tocoin idThe pair.
amountstringAmount the customer will send.
addressstringWhere the customer receives the coins.
extraIdstringMemo or tag for the payout, for coins that need one.
refundAddressstringWhere to return the deposit if the swap cannot be completed. Optional, recommended.
fixedbooleanFixed or floating rate. Default: true.
quoteIdstringFrom /estimate, to lock the shown amount.
Request
curl -X POST "https://cloudswap.io/api/partner/v1/exchanges" \
  -H "X-Api-Key: csk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "btc:btc",
    "to": "usdt:trx",
    "amount": "0.1",
    "address": "TQ7xkV3mGq1nB8sYpL2dWcR5uJ9LpA2cXe",
    "refundAddress": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
  }'
Response
{
  "id": "a3f9k2m8x7q1",
  "status": "waiting",
  "from": { "id": "btc:btc", "symbol": "BTC", "name": "Bitcoin", "network": "Bitcoin" },
  "to": { "id": "usdt:trx", "symbol": "USDT", "name": "Tether", "network": "TRON" },
  "fixed": true,
  "amountExpected": "0.1",
  "amountReceived": null,
  "amountOutEstimated": "6742.31",
  "amountOut": null,
  "rate": "67423.1",
  "depositAddress": "bc1q9d4ywgfnd8h43da5tpcxcn6ajv590cg6d3tg6a",
  "depositExtraId": null,
  "depositDeadline": "2026-11-13T19:20:00.000Z",
  "address": "TQ7xkV3mGq1nB8sYpL2dWcR5uJ9LpA2cXe",
  "extraId": null,
  "refundAddress": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "depositTxHash": null,
  "payoutTxHash": null,
  "refundTxHash": null,
  "commission": null,
  "createdAt": "2026-11-13T19:00:00.000Z",
  "updatedAt": "2026-11-13T19:00:00.000Z"
}

Get an exchange

GET/exchanges/{id}

The current state of one of your exchanges. Poll it every 15–30 seconds until the status is final. Exchanges of other partners return 404.

Request
curl "https://cloudswap.io/api/partner/v1/exchanges/a3f9k2m8x7q1" \
  -H "X-Api-Key: csk_your_key"
Response
{
  "id": "a3f9k2m8x7q1",
  "status": "finished",
  "amountReceived": "0.1",
  "amountOut": "6742.31",
  "depositTxHash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
  "payoutTxHash": "c4f2a1d09b7e63580a1f5c2e8d7b6a4930e1f2c3d4b5a69788796a5b4c3d2e1f",
  "commission": "26.97",
  "…": "the same fields as on creation"
}

List your exchanges

GET/exchanges

All swaps counted for your partner account, newest first: created through the API, the widget or your referral link.

limit1–100Page size. Default: 20.
offsetnumberHow many to skip. Default: 0.
Request
curl "https://cloudswap.io/api/partner/v1/exchanges?limit=20&offset=0" \
  -H "X-Api-Key: csk_your_key"
Response
{
  "total": 134,
  "limit": 20,
  "offset": 0,
  "exchanges": [ { "id": "a3f9k2m8x7q1", "status": "finished", "…": "…" } ]
}

Partner balance

GET/balance

Your rate and how much you have earned, been paid and can withdraw. Amounts are in USDT.

Request
curl "https://cloudswap.io/api/partner/v1/balance" \
  -H "X-Api-Key: csk_your_key"
Response
{
  "commissionPct": "0.4",
  "earned": "512.40",
  "paid": "400.00",
  "balance": "112.40",
  "currency": "USDT"
}

Statuses

waitingThe deposit address is issued; we are waiting for the customer's coins.
confirmingThe deposit is seen on the network and is collecting confirmations.
verifyingThe incoming transaction is being checked.
exchangingThe coins are being exchanged.
sendingThe payout to the customer has been sent.
finishedFinal. The customer has been paid; your reward is credited.
refundingThe deposit is being returned to the refund address.
refundedFinal. The deposit was returned.
expiredFinal unless a late deposit arrives: nothing was sent in time.

Errors

An error answer has the HTTP status and a body of the form { "code": "…", "message": "…" }. Rely on the code, not on the message text.

400VALIDATION_ERRORA field is missing or malformed. See issues[] in the answer.
400INVALID_PAYOUT_ADDRESSThe address does not match the coin and network.
400AMOUNT_TOO_LOW / AMOUNT_TOO_HIGHThe amount is outside the limits; min or max is in the answer.
400PAIR_NOT_SUPPORTEDThis pair cannot be exchanged.
401INVALID_API_KEYThe X-Api-Key header is missing, wrong or the key was replaced.
404NOT_FOUNDNo such exchange among yours.
429RATE_LIMITEDMore than 120 requests per minute with one key.
503RATE_UNAVAILABLEThe rate source did not answer. Retry in a few seconds.
503DEPOSIT_ADDRESS_UNAVAILABLEA deposit address could not be issued. Retry in a minute.

Widget

No backend needed: paste a frame into your page and your visitors get a live swap form. Build it with your code in the partner dashboard, or write the address by hand.

HTML
<iframe
  src="https://cloudswap.io/widget?ref=YOUR_CODE&from=btc:btc&to=eth:eth&amount=0.1"
  title="Cloudswap exchange"
  width="100%" height="420"
  style="max-width:460px;border:0;border-radius:24px"
  loading="lazy"></iframe>
refYour partner code. Without it the widget works, but swaps are not counted for you.
from, toCoin ids shown first. The visitor can change them.
amountThe amount shown first.