API
Developer API
Public swap endpoints for wallets and apps: list markets, quote float rates, create orders, and poll status — the same contract the Anonymous Swap site uses.
https://anonymousswap.ioSend JSON with Content-Type: application/json. Errors return { "error": "…" } with a safe message. Do not rely on provider names in responses.
Authentication
Public callers may use /api/price, /api/create, and /api/order without a key. Partners who create an HMAC key in the dashboard should sign those same routes so creates attribute to their referral code. Rate limits and deposit pauses may still apply.
Partner HMAC
Create a key under Partners → Business. The secret is shown once. Sign every request with your secret; clock skew tolerance is ±5 minutes.
Headers: X-AS-Key (key id), X-AS-Timestamp (unix seconds), X-AS-Signature (hex).
Canonical string: timestamp.METHOD.pathname.sha256hex(rawBody). Signature = hex(HMAC-SHA256(secret, canonical)). Example pathname: /api/create
/api/currenciesList currencies
Returns the live currency catalog used by the swap UI and wallet. Each item includes codes, networks, deposit/receive flags, and limits when available.
Response
[
{
"code": "btc",
"coin": "BTC",
"network": "Bitcoin",
"name": "Bitcoin",
"recv": true,
"send": true,
"tag": null,
"precision": 8,
"minAmount": "0.0001",
"maxAmount": null,
"image": "https://…",
"ticker": "btc",
"networkId": "btc"
}
]/api/pairsList pairs
Returns supported float swap directions. Use with currencies to validate from/to before quoting.
Response
[
{
"from": "btc",
"to": "xmr",
"fromNetwork": "btc",
"toNetwork": "xmr",
"rateTypes": ["float"]
}
]/api/priceGet float quote
Quotes a float receive amount for a send size. The response already includes fees at quote time. Provider identity is never exposed.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Content-Type | application/json | yes | application/json |
| X-AS-Key | string | no | Partner key id from the Business panel. When set, also send Timestamp and Signature. |
| X-AS-Timestamp | string | no | Unix seconds. Must be within ±5 minutes of server time. |
| X-AS-Signature | string | no | Hex HMAC-SHA256 of timestamp.METHOD.pathname.sha256hex(rawBody) using your secret. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
| type | "float" | yes | Only float quotes are supported. |
| fromCcy | string | yes | Send currency code (e.g. btc, usdttrc20). |
| toCcy | string | yes | Receive currency code. |
| direction | "from" | "to" | yes | Use "from" when amount is the send size. |
| amount | string | yes | Amount in the from currency (decimal string). |
| probe | boolean | no | When true, skips minimum enforcement so you can discover floors. |
- Without probe, amounts below the pair minimum return HTTP 400 with a safe error message.
- partnerSigned is true when a live liquidity path returned the quote; it does not name the path.
- Optional partner HMAC attributes the session; creates use the same key for referral credit.
Request
{
"type": "float",
"fromCcy": "btc",
"toCcy": "xmr",
"direction": "from",
"amount": "0.05"
}Response
{
"from": {
"code": "btc",
"coin": "BTC",
"network": "Bitcoin",
"amount": "0.05",
"rate": "…",
"precision": 8,
"min": "0.0005",
"max": ""
},
"to": {
"code": "xmr",
"coin": "XMR",
"network": "Monero",
"amount": "12.34",
"rate": "…",
"precision": 12,
"min": "0",
"max": ""
},
"errors": [],
"partnerSigned": true
}/api/createCreate order
Creates a float swap order and returns the deposit address. Poll /api/order with the returned id.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Idempotency-Key | string | no | Optional. Reuse the same key to avoid duplicate creates on retries. |
| X-AS-Key | string | no | Partner key id from the Business panel. When set, also send Timestamp and Signature. |
| X-AS-Timestamp | string | no | Unix seconds. Must be within ±5 minutes of server time. |
| X-AS-Signature | string | no | Hex HMAC-SHA256 of timestamp.METHOD.pathname.sha256hex(rawBody) using your secret. |
| Content-Type | application/json | yes | JSON body. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
| type | "float" | yes | Only float orders are supported. |
| fromCcy | string | yes | Send currency code. |
| toCcy | string | yes | Receive currency code. |
| direction | "from" | "to" | yes | Use "from" when amount is the send size. |
| amount | string | yes | Send amount (decimal string). |
| toAddress | string | yes | Payout address you control. |
| refundAddress | string | no | Optional refund address when required by the pair. |
| referralCode | string | no | Optional affiliate code (embed/widgets). Cookie referral is used as fallback. |
- Returns HTTP 503 when new deposits are paused.
- Amounts below minimum return HTTP 400.
- Some pairs may require a refund/sender address (HTTP 400 with SENDER_ADDRESS_REQUIRED or REFUND_REQUIRED).
- Store order.id (and token when present) to poll status. Do not show internal provider fields in your UI.
Request
{
"type": "float",
"fromCcy": "btc",
"toCcy": "xmr",
"direction": "from",
"amount": "0.05",
"toAddress": "4…"
}Response
{
"id": "…",
"token": "…",
"type": "float",
"status": "WAIT",
"time": {
"reg": 1710000000,
"expiration": 1710086400,
"left": 86400,
"update": 1710000000,
"finish": null
},
"from": {
"code": "btc",
"coin": "BTC",
"network": "Bitcoin",
"amount": "0.05",
"address": "bc1…"
},
"to": {
"code": "xmr",
"coin": "XMR",
"network": "Monero",
"amount": "12.34",
"address": "4…"
}
}/api/orderGet order status
Fetches the latest status for an order id returned by create. Used by the public status page and in-app polling.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Content-Type | application/json | yes | application/json |
| X-AS-Key | string | no | Partner key id from the Business panel. When set, also send Timestamp and Signature. |
| X-AS-Timestamp | string | no | Unix seconds. Must be within ±5 minutes of server time. |
| X-AS-Signature | string | no | Hex HMAC-SHA256 of timestamp.METHOD.pathname.sha256hex(rawBody) using your secret. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Order id from /api/create. |
| token | string | no | Session token from create when your client stored one. |
| provider | string | no | Internal routing hint only. Omit unless you persisted it from create; never show it to end users. |
- Typical status values: WAIT, CONFIRMING, EXCHANGE, SENDING, DONE, EXPIRED, EMERGENCY.
- Public status lookup works with id alone; include token when available for session restores.
Request
{
"id": "…"
}Response
{
"id": "…",
"type": "float",
"status": "CONFIRMING",
"time": { "reg": 1710000000, "expiration": 1710086400, "left": 85000, "update": 1710000600, "finish": null },
"from": { "code": "btc", "network": "Bitcoin", "amount": "0.05", "address": "bc1…", "tx": { "id": "…", "amount": "0.05" } },
"to": { "code": "xmr", "network": "Monero", "amount": "12.34", "address": "4…", "tx": { "id": null, "amount": null } }
}Business API
See /business for white-label setup packages. Affiliate partners can also use HMAC keys in the partners dashboard for signed price/create/order calls. A dedicated API host remains a later cutover.