SmallSwap SmallSwap

API Reference / GET /trade

GET /api/v1/trade

Look up swap status by ID. Returns a single-element array (Trocador's convention; Cake reads responseListJson.first).

Request

curl 'https://smallswap.example/api/v1/trade?id=7K3M9P2X8B4Q5R6S' \
  -H 'API-Key: prt_yourkeyhere'

Alternatively, omit API-Key and pass the per-trade password returned by /new_trade:

curl 'https://smallswap.example/api/v1/trade?id=7K3M9P2X8B4Q5R6S&password=8c4f0e2a1b9d7e6f5a3c2b1d0e9f8a7b'

Query parameters

NameRequiredDescription
idyesThe trade_id returned by /new_trade.
passwordnoPer-trade lookup secret. When provided, alternative auth to API-Key.

Response — 200 OK

[
  {
    "trade_id": "7K3M9P2X8B4Q5R6S",
    "status": "confirming",
    "status_detail": "Waiting for 2 of 10 Monero confirmations",
    "ticker_from": "xmr",
    "ticker_to": "usdt",
    "network_from": "monero",
    "network_to": "tron",
    "amount_from": "1.0",
    "amount_to": "398.32",
    "amount_received": "1.0",
    "rate": "398.32",
    "provider": "SmallSwap",
    "id_provider": "ss_01HZJ4G...",
    "password": "8c4f0e2a1b9d7e6f5a3c2b1d0e9f8a7b",
    "address_provider": "4AfUP...",
    "address_provider_memo": null,
    "refund_address": "4Bd...",
    "address_user": "TWdYcN...",
    "deposit_tx_hash": "8a3b1c...",
    "payout_tx_hash": null,
    "refund_tx_hash": null,
    "date": "2026-05-13T15:50:00Z",
    "updated_at": "2026-05-13T15:52:13Z",
    "expires_at": "2026-05-13T16:50:00Z"
  }
]

Returns an array even for a single trade — matches Trocador's response shape so Cake's responseListJson.first parser works.

Status values

StatusMeaningCake TradeState
awaiting_depositDeposit address issued. No incoming funds detected yet.pending
deposit_detectedIncoming tx seen in mempool / unconfirmed.confirming
confirmingDeposit confirmed N/M blocks. Awaiting full confirmation count.confirming
processingDeposit fully confirmed. Executing swap.processing
sendingOutput transaction broadcast.trading
completedPayout confirmed on destination chain.finished / traded
refundedRefunded to refund address.refunded
failedManual intervention required. Operator notified.failed
expiredDeposit window passed with no deposit.expired
holdPartner-side AML/compliance hold (Controlled routes only).hold

Only awaiting_deposit and expired are reachable without a deposit being received. Every other state implies at least one inbound tx exists.

Webhooks (partner-only)

If you set webhook_url on /new_trade, every status transition triggers:

POST <webhook_url>
Content-Type: application/json
X-SmallSwap-Signature: <hmac-sha256 of body, partner secret>
X-SmallSwap-Event: swap.status_changed

{
  "id": "7K3M9P2X8B4Q5R6S",
  "status": "completed",
  "prev_status": "sending",
  "occurred_at": "2026-05-13T15:58:00Z"
}
  • HMAC-SHA256 over the raw request body using your partner secret. Verify on every webhook.
  • At-least-once delivery, exponential backoff. Retries continue for 24h, then dead-letter.
  • Idempotency: key on id + status + occurred_at.