API Reference
The Shadowdesk Partner API lets you offer Monero-routed privacy swaps from your own product. All requests use JSON over HTTPS and are authenticated with a Bearer API key from your partner account.
https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-apiAll endpoints are versioned under /v1.
Authentication
Send your API key as a Bearer token in the Authorization header on every request. Keys start with the prefix sk_live_ and must be kept server-side. Never embed them in client-side code.
curl https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-api/v1/pairs \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx"Don't have a key yet? Create a free partner account and generate up to 3 keys yourself. Each key starts with 60 requests per minute and the standard commission; swaps placed with your keys earn you XMR. For a custom commission, higher limits or webhooks, email api@shadowdesk.io with your account email and expected volume.
Rate limits
Each API key has a per-minute request quota, shared across all endpoints. Keys you create in your partner account get 60 requests per minute; keys issued by our team default to 300 requests per minute. Higher limits can be configured per partner on request.
Exceeding the limit returns 429 Too Many Requests with error code rate_limited. Wait approximately 60 seconds before retrying.
Errors
All errors return a JSON body with an error message and a machine-readable code.
{
"error": "Missing required fields: coinFrom, coinTo, amount",
"code": "invalid_request"
}| Status | Code | Meaning |
|---|---|---|
| 401 | missing_api_key | No Authorization header was sent. |
| 401 | invalid_api_key | API key is unknown, revoked, or malformed. |
| 400 | invalid_request | Required fields missing or malformed. |
| 400 | invalid_order_id | Order ID must be 16 lowercase hex characters. |
| 404 | not_found | No order matches the supplied ID, or unknown route. |
| 429 | rate_limited | API key exceeded its per-minute quota. |
| 500 | internal_error | Unexpected server error — safe to retry. |
List supported pairs
/v1/pairsReturns all coins and the networks each one can be sent or received on. Coins disabled in admin settings are filtered out automatically, so this list always reflects what can actually be swapped right now.
curl https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-api/v1/pairs \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx"{
"coins": [
{ "ticker": "btc", "name": "Bitcoin", "networks": ["btc"] },
{ "ticker": "eth", "name": "Ethereum", "networks": ["eth", "arbitrum", "optimism", "base"] },
{ "ticker": "usdt", "name": "Tether", "networks": ["eth", "trx", "bsc", "sol", "polygon"] },
{ "ticker": "xmr", "name": "Monero", "networks": ["xmr"] }
],
"notes": "Two modes: 'privacy' (default, routed via XMR) and 'direct' (single-leg via best provider)."
}Get a swap quote
/v1/ratesReturns the estimated receive amount for a given send amount. Set mode to 'privacy' (XMR-routed, default) or 'direct' (single-leg via best provider, faster, no XMR routing). Same-asset swaps (e.g. BTC→BTC, USDT-ERC20→USDT-TRC20) require 'privacy' mode.
coinFromstringrequiredSource coin ticker, lowercase. e.g. "btc".
coinTostringrequiredDestination coin ticker, lowercase.
amountnumberrequiredAmount to send in coinFrom units.
networkFromstringOptional network for coinFrom (e.g. "trx" for USDT-TRC20). Defaults to coin's native network.
networkTostringOptional network for coinTo.
modestring"privacy" (default, XMR-routed) or "direct" (single-leg, faster). Direct mode cannot do identical coin+network swaps.
curl -X POST https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-api/v1/rates \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"coinFrom": "btc",
"networkFrom": "btc",
"coinTo": "eth",
"networkTo": "eth",
"amount": 0.1
}'{
"coinFrom": "btc",
"coinTo": "eth",
"networkFrom": "btc",
"networkTo": "eth",
"mode": "privacy",
"amountSend": 0.1,
"estimatedReceive": 2.4137,
"minAmount": 0.001,
"maxAmount": 10
}Create a swap order
/v1/ordersCreates a new swap order. Choose mode: 'privacy' (default, source → XMR → destination, two legs) or 'direct' (single leg via best provider, faster, no XMR hop). The user sends funds to the returned deposit address; once confirmed, the order progresses automatically and the destination amount is sent to destinationAddress. Order IDs are 16 lowercase hex characters.
coinFromstringrequiredSource coin ticker.
coinTostringrequiredDestination coin ticker.
amountnumberrequiredAmount to send in coinFrom units.
destinationAddressstringrequiredEnd-user destination address. Funds are sent here directly (passthrough model).
networkFromstringOptional source network override.
networkTostringOptional destination network override.
refundAddressstringOptional refund address used if the swap cannot be completed.
modestring"privacy" (default, XMR-routed) or "direct" (single-leg via best provider). Same-asset swaps require "privacy".
curl -X POST https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-api/v1/orders \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"coinFrom": "btc",
"networkFrom": "btc",
"coinTo": "eth",
"networkTo": "eth",
"amount": 0.1,
"destinationAddress": "0xAbC...123",
"refundAddress": "bc1q..."
}'{
"orderId": "a1b2c3d4e5f6g7h8",
"status": "awaiting_deposit",
"mode": "privacy",
"depositAddress": "bc1qxyz...",
"depositMemo": null,
"expiresAt": "2026-04-26T12:30:00Z",
"createdAt": "2026-04-26T12:00:00Z",
"trackingUrl": "https://shadowdesk.io/order/a1b2c3d4e5f6g7h8"
}Get order status
/v1/orders/{orderId}Poll this endpoint to track an order through both legs. Confirmation counts update live as deposits and outputs are detected on-chain. Sensitive fields like IP address and admin notes are never returned.
orderIdstring (path)required16 lowercase hex characters returned from order creation.
curl https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-api/v1/orders/a1b2c3d4e5f6g7h8 \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx"{
"orderId": "a1b2c3d4e5f6g7h8",
"status": "leg2_processing",
"statusMessage": "Converting XMR to ETH",
"mode": "privacy",
"coinFrom": "btc",
"coinTo": "eth",
"networkFrom": "btc",
"networkTo": "eth",
"amountSend": 0.1,
"amountReceiveEstimate": 2.4137,
"amountReceivedFinal": null,
"depositAddress": "bc1qxyz...",
"depositMemo": null,
"destinationAddress": "0xAbC...123",
"createdAt": "2026-04-26T12:00:00Z",
"expiresAt": "2026-04-26T12:30:00Z",
"completedAt": null,
"depositTxid": "abc123...",
"outputTxid": null,
"leg1Confirmations": 3,
"leg1ConfirmationsNeeded": 3,
"leg2Confirmations": 1,
"leg2ConfirmationsNeeded": 10,
"trackingUrl": "https://shadowdesk.io/order/a1b2c3d4e5f6g7h8"
}Order statuses
| Status | Meaning |
|---|---|
awaiting_deposit | Awaiting deposit from user. Order expires in 30 minutes if unfunded. |
leg1_confirming | Source coin deposit detected on-chain. Confirming and converting to XMR via leg-1 provider (privacy mode only). |
leg1_complete | XMR received and unlocked (10 confirmations). Leg 2 about to start (privacy mode only). |
leg2_processing | XMR sent to leg-2 provider. Converting to destination coin. |
completed | Funds delivered to destination address. |
expired | Deposit window elapsed without funds being received. |
failed | Manual review required — contact support with the orderId. |
refunded | Returned to refund address (if provided). |
Webhooks
Instead of polling, you can register a webhook URL and receive a signed POST whenever an order reaches a key milestone. Webhooks are enabled per key by our team: email api@shadowdesk.io with your account email, the key name and your HTTPS endpoint, and you will receive the signing secret once. Private, loopback and non-HTTPS URLs are rejected.
Events
| Event | When it fires |
|---|---|
order.deposit_received | User deposit detected on-chain (leg 1 starting). |
order.leg1_confirmed | XMR received with 10 confirmations; leg 2 about to start. |
order.completed | Destination funds sent successfully. |
order.failed | Order failed — manual review may be required. |
order.expired | Deposit window elapsed without funds. |
order.refunded | Funds returned to refund address. |
Headers
X-Shadowdesk-Event | Event type (e.g. order.completed). |
X-Shadowdesk-Delivery | Unique delivery ID — use for idempotency. |
X-Shadowdesk-Timestamp | Unix timestamp (seconds) used in the signature. |
X-Shadowdesk-Signature | HMAC-SHA256 of "{timestamp}.{rawBody}" prefixed with sha256=. |
Example payload
{
"event": "order.completed",
"createdAt": "2026-04-29T14:23:11Z",
"data": {
"orderId": "a1b2c3d4e5f6g7h8",
"status": "completed",
"statusMessage": "Funds delivered",
"coinFrom": "btc",
"coinTo": "eth",
"amountSend": 0.1,
"amountReceiveEstimate": 2.4137,
"amountReceivedFinal": 2.4129,
"depositTxid": "abc123...",
"outputTxid": "0xdef456...",
"completedAt": "2026-04-29T14:23:10Z",
"trackingUrl": "https://shadowdesk.io/order/a1b2c3d4e5f6g7h8"
}
}Verifying the signature (Node.js)
import crypto from "node:crypto";
function verifyShadowdeskSignature(rawBody, headers, secret) {
const ts = headers["x-shadowdesk-timestamp"];
const sig = (headers["x-shadowdesk-signature"] || "").replace(/^sha256=/, "");
const expected = crypto
.createHmac("sha256", secret)
.update(`${ts}.${rawBody}`)
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(sig, "hex"),
Buffer.from(expected, "hex"),
);
}Retries
Respond with any 2xx status within 10 seconds to acknowledge. Non-2xx responses, timeouts, or network errors are retried up to 5 times with backoff: 30s, 2m, 10m, 1h, 6h. After 6 total attempts the delivery is marked dead and an admin can manually replay it. Use X-Shadowdesk-Delivery as an idempotency key — the same delivery ID may be retried.
Ready to build?
Create a free partner account for a key now, or email us for custom commission, higher limits and webhooks.