Back to API overview

    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.

    Base URL
    url
    https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-api
    API version
    v1

    All 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.

    bash
    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.

    json
    {
      "error": "Missing required fields: coinFrom, coinTo, amount",
      "code": "invalid_request"
    }
    StatusCodeMeaning
    401missing_api_keyNo Authorization header was sent.
    401invalid_api_keyAPI key is unknown, revoked, or malformed.
    400invalid_requestRequired fields missing or malformed.
    400invalid_order_idOrder ID must be 16 lowercase hex characters.
    404not_foundNo order matches the supplied ID, or unknown route.
    429rate_limitedAPI key exceeded its per-minute quota.
    500internal_errorUnexpected server error — safe to retry.

    List supported pairs

    GET
    /v1/pairs

    Returns 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.

    Request
    bash
    curl https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-api/v1/pairs \
      -H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx"
    Response
    json
    {
      "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

    POST
    /v1/rates

    Returns 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.

    Parameters
    coinFromstringrequired

    Source coin ticker, lowercase. e.g. "btc".

    coinTostringrequired

    Destination coin ticker, lowercase.

    amountnumberrequired

    Amount to send in coinFrom units.

    networkFromstring

    Optional network for coinFrom (e.g. "trx" for USDT-TRC20). Defaults to coin's native network.

    networkTostring

    Optional network for coinTo.

    modestring

    "privacy" (default, XMR-routed) or "direct" (single-leg, faster). Direct mode cannot do identical coin+network swaps.

    Request
    bash
    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
      }'
    Response
    json
    {
      "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

    POST
    /v1/orders

    Creates 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.

    Parameters
    coinFromstringrequired

    Source coin ticker.

    coinTostringrequired

    Destination coin ticker.

    amountnumberrequired

    Amount to send in coinFrom units.

    destinationAddressstringrequired

    End-user destination address. Funds are sent here directly (passthrough model).

    networkFromstring

    Optional source network override.

    networkTostring

    Optional destination network override.

    refundAddressstring

    Optional 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".

    Request
    bash
    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..."
      }'
    Response
    json
    {
      "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

    GET
    /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.

    Parameters
    orderIdstring (path)required

    16 lowercase hex characters returned from order creation.

    Request
    bash
    curl https://qrimfckybgwniswcxtim.supabase.co/functions/v1/public-api/v1/orders/a1b2c3d4e5f6g7h8 \
      -H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx"
    Response
    json
    {
      "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

    StatusMeaning
    awaiting_depositAwaiting deposit from user. Order expires in 30 minutes if unfunded.
    leg1_confirmingSource coin deposit detected on-chain. Confirming and converting to XMR via leg-1 provider (privacy mode only).
    leg1_completeXMR received and unlocked (10 confirmations). Leg 2 about to start (privacy mode only).
    leg2_processingXMR sent to leg-2 provider. Converting to destination coin.
    completedFunds delivered to destination address.
    expiredDeposit window elapsed without funds being received.
    failedManual review required — contact support with the orderId.
    refundedReturned 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

    EventWhen it fires
    order.deposit_receivedUser deposit detected on-chain (leg 1 starting).
    order.leg1_confirmedXMR received with 10 confirmations; leg 2 about to start.
    order.completedDestination funds sent successfully.
    order.failedOrder failed — manual review may be required.
    order.expiredDeposit window elapsed without funds.
    order.refundedFunds returned to refund address.

    Headers

    X-Shadowdesk-EventEvent type (e.g. order.completed).
    X-Shadowdesk-DeliveryUnique delivery ID — use for idempotency.
    X-Shadowdesk-TimestampUnix timestamp (seconds) used in the signature.
    X-Shadowdesk-SignatureHMAC-SHA256 of "{timestamp}.{rawBody}" prefixed with sha256=.

    Example payload

    json
    {
      "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)

    javascript
    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.